From 65bbb45ab7501206afb474439745a7298b548950 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 20 Oct 2006 16:01:38 +0000 Subject: [PATCH] * Add findutils to the bootstrap tools. svn path=/nixpkgs/trunk/; revision=6791 --- pkgs/stdenv/linux/make-bootstrap-tools.nix | 4 +- pkgs/stdenv/linux/make-bootstrap-tools.sh | 2 + pkgs/tools/misc/findutils-static/default.nix | 13 ----- .../findutils-static/findutils-path.patch | 12 ---- pkgs/tools/misc/findutils/default.nix | 5 +- pkgs/tools/misc/findutils/dietlibc-hack.patch | 58 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 -- 7 files changed, 66 insertions(+), 32 deletions(-) delete mode 100644 pkgs/tools/misc/findutils-static/default.nix delete mode 100644 pkgs/tools/misc/findutils-static/findutils-path.patch create mode 100644 pkgs/tools/misc/findutils/dietlibc-hack.patch diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 4194b7b42936..7d4d2fb19606 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -7,14 +7,14 @@ let # stdenv-linux's dependencies, rather than building new ones with # dietlibc. bootStdenv = removeAttrs (pkgs.useDietLibC pkgs.stdenv) - ["binutils" "gcc" "coreutils" "gnused" "gnugrep" "gnutar" "gzip" "bzip2" "bash" "patch" "patchelf"]; + ["binutils" "gcc" "coreutils" "findutils" "gnused" "gnugrep" "gnutar" "gzip" "bzip2" "bash" "patch" "patchelf"]; }; generator = pkgs.stdenv.mkDerivation { name = "bootstrap-tools-generator"; builder = ./make-bootstrap-tools.sh; - inherit (pkgsDiet) coreutils gnused gnugrep gnutar gzip bzip2 bash patch; + inherit (pkgsDiet) coreutils findutils gnused gnugrep gnutar gzip bzip2 bash patch; binutils = pkgsDiet.binutils; gcc = import ../../development/compilers/gcc-static-4.1 { diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.sh b/pkgs/stdenv/linux/make-bootstrap-tools.sh index 462d3b6ad7ac..70a9f9760430 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/make-bootstrap-tools.sh @@ -37,6 +37,8 @@ cp $coreutils/bin/* tools/bin rm tools/bin/groups # has references rm tools/bin/printf # idem +cp $findutils/bin/find tools/bin +cp $findutils/bin/xargs tools/bin cp $gnused/bin/* tools/bin cp $gnugrep/bin/* tools/bin cp $gnutar/bin/* tools/bin diff --git a/pkgs/tools/misc/findutils-static/default.nix b/pkgs/tools/misc/findutils-static/default.nix deleted file mode 100644 index 4b747e5ce49a..000000000000 --- a/pkgs/tools/misc/findutils-static/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{stdenv, fetchurl, coreutils}: - -stdenv.mkDerivation { - name = "findutils-4.2.26"; - src = fetchurl { - url = http://nix.cs.uu.nl/dist/tarballs/findutils-4.2.26.tar.gz; - md5 = "9ac4e62937b1fdc4eb643d1d4bf117d3"; - }; - buildInputs = [coreutils]; - patches = [./findutils-path.patch]; - LDFLAGS="-static"; - configureFlags="--disable-nls --without-included-regex"; -} diff --git a/pkgs/tools/misc/findutils-static/findutils-path.patch b/pkgs/tools/misc/findutils-static/findutils-path.patch deleted file mode 100644 index be8d85be3033..000000000000 --- a/pkgs/tools/misc/findutils-static/findutils-path.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruN findutils-4.2.20/locate/updatedb.sh findutils-4.2.20.new/locate/updatedb.sh ---- findutils-4.2.20/locate/updatedb.sh 2005-01-24 17:12:35.000000000 +0100 -+++ findutils-4.2.20.new/locate/updatedb.sh 2005-08-23 14:37:10.000000000 +0200 -@@ -141,7 +141,7 @@ - : ${code:=${LIBEXECDIR}/@code@} - - --PATH=/bin:/usr/bin:${BINDIR}; export PATH -+PATH=/bin:/usr/bin:${BINDIR}:${PATH}; export PATH - - : ${PRUNEFS="nfs NFS proc afs proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs sysfs shfs"} - diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index 93ef7f0aaf02..80f5fbfc5d70 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -7,5 +7,8 @@ stdenv.mkDerivation { md5 = "f1e0ddf09f28f8102ff3b90f3b5bc920"; }; buildInputs = [coreutils]; - patches = [./findutils-path.patch]; + patches = [./findutils-path.patch] + # Note: the dietlibc is just to get findutils to compile. The + # locate command probably won't work though. + ++ (if stdenv ? isDietLibC then [./dietlibc-hack.patch] else []); } diff --git a/pkgs/tools/misc/findutils/dietlibc-hack.patch b/pkgs/tools/misc/findutils/dietlibc-hack.patch new file mode 100644 index 000000000000..957c32d3d4ea --- /dev/null +++ b/pkgs/tools/misc/findutils/dietlibc-hack.patch @@ -0,0 +1,58 @@ +diff -rc findutils-4.2.27-orig/locate/code.c findutils-4.2.27/locate/code.c +*** findutils-4.2.27-orig/locate/code.c 2005-06-07 22:24:56.000000000 +0000 +--- findutils-4.2.27/locate/code.c 2006-10-20 15:53:53.000000000 +0000 +*************** +*** 210,216 **** +--- 210,218 ---- + if (diffcount < -LOCATEDB_OLD_OFFSET || diffcount > LOCATEDB_OLD_OFFSET) + { + putc (LOCATEDB_OLD_ESCAPE, stdout); ++ #if 0 + putw (diffcount + LOCATEDB_OLD_OFFSET, stdout); ++ #endif + } + else + putc (diffcount + LOCATEDB_OLD_OFFSET, stdout); +diff -rc findutils-4.2.27-orig/locate/locate.c findutils-4.2.27/locate/locate.c +*** findutils-4.2.27-orig/locate/locate.c 2005-09-01 20:42:43.000000000 +0000 +--- findutils-4.2.27/locate/locate.c 2006-10-20 15:53:11.000000000 +0000 +*************** +*** 468,473 **** +--- 468,474 ---- + return VISIT_CONTINUE; + } + ++ #if 0 + static int + visit_old_format(struct process_data *procdata, void *context) + { +*************** +*** 498,503 **** +--- 499,505 ---- + + return VISIT_CONTINUE; + } ++ #endif + + + static int +*************** +*** 911,920 **** + lastinspector = NULL; + past_pat_inspector = NULL; + +! if (old_format) +! add_visitor(visit_old_format, NULL); +! else +! add_visitor(visit_locate02_format, NULL); + + if (basename_only) + add_visitor(visit_basename, NULL); +--- 913,919 ---- + lastinspector = NULL; + past_pat_inspector = NULL; + +! add_visitor(visit_locate02_format, NULL); + + if (basename_only) + add_visitor(visit_basename, NULL); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 99c586a5702e..5f8be554b4de 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -271,10 +271,6 @@ rec { inherit fetchurl stdenv coreutils; }); - findutilsStatic = import ../tools/misc/findutils-static { - inherit stdenv fetchurl coreutils; - }; - findutilsWrapper = import ../tools/misc/findutils-wrapper { inherit stdenv findutils; };