git.iko.soy/typeable/nixpkgs
on master help sign in
boost: Fix runtime dependencies in fixup instead of using a hook to fix binaries
83cecbdWilliam A. Kennington III
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
2, toolset ? null
2, toolset ? null
3, enableRelease ? true
3, enableRelease ? true
4, enableDebug ? false
4, enableDebug ? false
@@ -90,7 +90,7 @@ let
90
90
91 # Create a derivation which encompasses everything, making buildInputs nicer
91 # Create a derivation which encompasses everything, making buildInputs nicer
92 mkdir -p $out/nix-support
92 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
94 '';
94 '';
95
95
96 commonConfigureFlags = [
96 commonConfigureFlags = [
@@ -98,7 +98,13 @@ let
98 "--libdir=$(lib)/lib"
98 "--libdir=$(lib)/lib"
99 ];
99 ];
100
100
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+ '';
102
108
103in
109in
104
110
@@ -144,6 +150,8 @@ stdenv.mkDerivation {
144
150
145 installPhase = installer nativeB2Args;
151 installPhase = installer nativeB2Args;
146
152
153+ postFixup = fixup;
154+
147 outputs = [ "out" "dev" "lib" ];
155 outputs = [ "out" "dev" "lib" ];
148
156
149 crossAttrs = rec {
157 crossAttrs = rec {
@@ -162,5 +170,6 @@ stdenv.mkDerivation {
162 '';
170 '';
163 buildPhase = builder crossB2Args;
171 buildPhase = builder crossB2Args;
164 installPhase = installer crossB2Args;
172 installPhase = installer crossB2Args;
173+ postFixup = fixup;
165 };
174 };
166}
175}
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−}