summary refs log tree commit diff
path: root/pkgs/tools/package-management
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-04-01 12:08:44 +0000
committerLudovic Courtès <ludo@gnu.org>2012-04-01 12:08:44 +0000
commit1a38734345f5ba461021fcf876eee9b68b804063 (patch)
treeaf63d6bbf3b7aff28de5ab5ca2662da4280dcc80 /pkgs/tools/package-management
parent3363c587a4710d4337c4e15dfbbb40dc563ad1da (diff)
downloadnixlib-1a38734345f5ba461021fcf876eee9b68b804063.tar
nixlib-1a38734345f5ba461021fcf876eee9b68b804063.tar.gz
nixlib-1a38734345f5ba461021fcf876eee9b68b804063.tar.bz2
nixlib-1a38734345f5ba461021fcf876eee9b68b804063.tar.lz
nixlib-1a38734345f5ba461021fcf876eee9b68b804063.tar.xz
nixlib-1a38734345f5ba461021fcf876eee9b68b804063.tar.zst
nixlib-1a38734345f5ba461021fcf876eee9b68b804063.zip
nixUnstable: Fix cross-compilation native/cross mismatch with bzip2.
See <http://hydra.nixos.org/build/2345751> for the original symptom.

svn path=/nixpkgs/trunk/; revision=33515
Diffstat (limited to 'pkgs/tools/package-management')
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index 1e70435186bc..edce730d73b8 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -13,7 +13,16 @@ stdenv.mkDerivation rec {
   };
 
   buildNativeInputs = [ perl pkgconfig ];
-  buildInputs = [ curl openssl boehmgc bzip2 sqlite ];
+
+  buildInputs = [ curl openssl boehmgc sqlite ];
+
+  # Note: bzip2 is not passed as a build input, because the unpack phase
+  # would end up using the wrong bzip2 when cross-compiling.
+  # XXX: The right thing would be to reinstate `--with-bzip2' in Nix.
+  postUnpack =
+    '' export CPATH="${bzip2}/include"
+       export LIBRARY_PATH="${bzip2}/lib"
+    '';
 
   configureFlags =
     ''
@@ -26,6 +35,11 @@ stdenv.mkDerivation rec {
     '';
 
   crossAttrs = {
+    postUnpack =
+      '' export CPATH="${bzip2.hostDrv}/include"
+         export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
+      '';
+
     configureFlags =
       ''
         --with-store-dir=${storeDir} --localstatedir=${stateDir}