git.iko.soy/typeable/nixpkgs
on master help sign in
boost: Fix runtime dependencies in fixup instead of using a hook to fix binaries
commit83cecbdcbcf1fa2d933a4bd2925e086bb7972008 authorWilliam A. Kennington III <william@wkennington.com> dateMon 10 Nov 2014, 11:31 (12 years ago) parente78a160
2 files changed+12−15
pkgs/development/libraries/boost/generic.nix+12−3 pkgs/development/libraries/boost/strip-header-path.sh−12
pkgs/development/libraries/boost/generic.nix+12−3
@@ -1,4 +1,4 @@
1−{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, makeSetupHook
1+{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames
22, toolset ? null
33, enableRelease ? true
44, enableDebug ? false
@@ -90,7 +90,7 @@ let
9090
9191 # Create a derivation which encompasses everything, making buildInputs nicer
9292 mkdir -p $out/nix-support
93− echo "${stripHeaderPathHook} $dev $lib" > $out/nix-support/propagated-native-build-inputs
93+ echo "$dev $lib" > $out/nix-support/propagated-native-build-inputs
9494 '';
9595
9696 commonConfigureFlags = [
@@ -98,7 +98,13 @@ let
9898 "--libdir=$(lib)/lib"
9999 ];
100100
101− stripHeaderPathHook = makeSetupHook { } ./strip-header-path.sh;
101+ fixup = ''
102+ # Make boost header paths relative so that they are not runtime dependencies
103+ (
104+ cd "$dev"
105+ find include \( -name '*.hpp' -or -name '*.h' \) -exec sed '1i#line 1 "{}"' -i '{}' \;
106+ )
107+ '';
102108
103109in
104110
@@ -144,6 +150,8 @@ stdenv.mkDerivation {
144150
145151 installPhase = installer nativeB2Args;
146152
153+ postFixup = fixup;
154+
147155 outputs = [ "out" "dev" "lib" ];
148156
149157 crossAttrs = rec {
@@ -162,5 +170,6 @@ stdenv.mkDerivation {
162170 '';
163171 buildPhase = builder crossB2Args;
164172 installPhase = installer crossB2Args;
173+ postFixup = fixup;
165174 };
166175}
pkgs/development/libraries/boost/strip-header-path.shdeleted−12
@@ -1,12 +0,0 @@
1−postPhases+=" boostHeaderStripPhase"
2−
3−boostHeaderStripPhase() {
4− runHook preBoostHeaderStrip
5− [ -z "$outputs" ] && outputs=out
6− for output in $outputs; do
7− eval "path=\$$outputs"
8− [ -d "$path/bin" ] || continue
9− find "$path/bin" -type f -exec sed -i "s,[^/]*\(-boost-[0-9.]*-dev\),xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\1,g" {} \;
10− done
11− runHook postBoostHeaderStrip
12−}