summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-04-04 18:10:42 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-04-04 18:10:42 +0000
commit19b98110126fde7cbb1127af7e3fe1568eacad3d (patch)
treea32e49d08765b5d8ff0b5b7eaae87ae3907e1542 /pkgs/tools
parent2d261d1c1ed28e396ec0305075ccffb25b416abc (diff)
downloadnixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.tar
nixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.tar.gz
nixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.tar.bz2
nixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.tar.lz
nixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.tar.xz
nixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.tar.zst
nixlib-19b98110126fde7cbb1127af7e3fe1568eacad3d.zip
Making a bunch of basic programs cross-buildable.
After this, the 'bootstrap-tools' can be cross-built.


svn path=/nixpkgs/branches/stdenv-updates/; revision=20945
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/compression/bzip2/default.nix10
-rw-r--r--pkgs/tools/misc/coreutils/default.nix4
-rw-r--r--pkgs/tools/misc/findutils/default.nix7
-rw-r--r--pkgs/tools/text/diffutils/default.nix2
-rw-r--r--pkgs/tools/text/gnupatch/default.nix4
-rw-r--r--pkgs/tools/text/replace/default.nix4
6 files changed, 29 insertions, 2 deletions
diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix
index 0523067cbade..e8ac6c6418cb 100644
--- a/pkgs/tools/compression/bzip2/default.nix
+++ b/pkgs/tools/compression/bzip2/default.nix
@@ -10,6 +10,16 @@ stdenv.mkDerivation {
     sha256 = "08py2s9vw6dgw457lbklh1vsr3b8x8dlv7d8ygdfaxlx61l57gzp";
   };
 
+  crossAttrs = {
+    patchPhase = ''
+      sed -i -e 's/CC=gcc/CC=${stdenv.cross.config}-gcc/' \
+        -e 's/AR=ar/AR=${stdenv.cross.config}-ar/' \
+        -e 's/RANLIB=ranlib/RANLIB=${stdenv.cross.config}-ranlib/' \
+        -e 's/bzip2recover test/bzip2recover/' \
+        Makefile*
+    '';
+  };
+
   sharedLibrary =
     !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
 
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 431684829b5b..6f7c0923d99f 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -16,6 +16,10 @@ stdenv.mkDerivation rec {
       ++ stdenv.lib.optional aclSupport acl.hostDrv
       ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
         stdenv.gccCross.libc.libiconv.hostDrv;
+
+    # Needed for fstatfs()
+    # I don't know why it is not properly detected cross building with glibc.
+    configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
   };
 
   # The tests are known broken on Cygwin
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index 2350ab260492..887f400b8c59 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0f61phan4q8w5i1lz768q973c1spfqgvc470jc89rpg0gxfvi9bp";
   };
 
-  buildInputs = [coreutils];
+  buildNativeInputs = [coreutils];
 
   patches = [ ./findutils-path.patch ./change_echo_path.patch ]
     # Note: the dietlibc patch is just to get findutils to compile.
@@ -17,6 +17,11 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  crossAttrs = {
+    # http://osdir.com/ml/bug-findutils-gnu/2009-08/msg00026.html
+    configureFlags = [ "gl_cv_func_wcwidth_works=yes" ];
+  };
+
   meta = {
     homepage = http://www.gnu.org/software/findutils/;
     description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system";
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index 44b7715607c8..d75485cf0473 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
   
   /* If no explicit coreutils is given, use the one from stdenv. */
-  buildInputs = [coreutils];
+  buildNativeInputs = [coreutils];
 
   meta = {
     homepage = http://www.gnu.org/software/diffutils/diffutils.html;
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index cd2a67f69933..e6383f40a7c1 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = (stdenv.lib.optional doCheck ed);
 
+  crossAttrs = {
+    configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
+  };
+
   doCheck = true;
 
   meta = {
diff --git a/pkgs/tools/text/replace/default.nix b/pkgs/tools/text/replace/default.nix
index 0182a3bb48df..339bf510c4b2 100644
--- a/pkgs/tools/text/replace/default.nix
+++ b/pkgs/tools/text/replace/default.nix
@@ -10,6 +10,10 @@ stdenv.mkDerivation {
 
   makeFlags = ["TREE=\$(out)"];
 
+  crossAttrs = {
+    makeFlags = [ "TREE=\$(out)" "CC=${stdenv.cross.config}-gcc" ];
+  };
+
   postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
 
   patches = [./malloc.patch];