From 1a38734345f5ba461021fcf876eee9b68b804063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 1 Apr 2012 12:08:44 +0000 Subject: [PATCH] nixUnstable: Fix cross-compilation native/cross mismatch with bzip2. See for the original symptom. svn path=/nixpkgs/trunk/; revision=33515 --- pkgs/tools/package-management/nix/unstable.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix index 1e70435186b..edce730d73b 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}