boost: Fix runtime dependencies in fixup instead of using a hook to fix binaries
This commit is contained in:
parent
e78a1603fc
commit
83cecbdcbc
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, makeSetupHook
|
{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames
|
||||||
, toolset ? null
|
, toolset ? null
|
||||||
, enableRelease ? true
|
, enableRelease ? true
|
||||||
, enableDebug ? false
|
, enableDebug ? false
|
||||||
@ -90,7 +90,7 @@ let
|
|||||||
|
|
||||||
# Create a derivation which encompasses everything, making buildInputs nicer
|
# Create a derivation which encompasses everything, making buildInputs nicer
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
echo "${stripHeaderPathHook} $dev $lib" > $out/nix-support/propagated-native-build-inputs
|
echo "$dev $lib" > $out/nix-support/propagated-native-build-inputs
|
||||||
'';
|
'';
|
||||||
|
|
||||||
commonConfigureFlags = [
|
commonConfigureFlags = [
|
||||||
@ -98,7 +98,13 @@ let
|
|||||||
"--libdir=$(lib)/lib"
|
"--libdir=$(lib)/lib"
|
||||||
];
|
];
|
||||||
|
|
||||||
stripHeaderPathHook = makeSetupHook { } ./strip-header-path.sh;
|
fixup = ''
|
||||||
|
# Make boost header paths relative so that they are not runtime dependencies
|
||||||
|
(
|
||||||
|
cd "$dev"
|
||||||
|
find include \( -name '*.hpp' -or -name '*.h' \) -exec sed '1i#line 1 "{}"' -i '{}' \;
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -144,6 +150,8 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
installPhase = installer nativeB2Args;
|
installPhase = installer nativeB2Args;
|
||||||
|
|
||||||
|
postFixup = fixup;
|
||||||
|
|
||||||
outputs = [ "out" "dev" "lib" ];
|
outputs = [ "out" "dev" "lib" ];
|
||||||
|
|
||||||
crossAttrs = rec {
|
crossAttrs = rec {
|
||||||
@ -162,5 +170,6 @@ stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
buildPhase = builder crossB2Args;
|
buildPhase = builder crossB2Args;
|
||||||
installPhase = installer crossB2Args;
|
installPhase = installer crossB2Args;
|
||||||
|
postFixup = fixup;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
postPhases+=" boostHeaderStripPhase"
|
|
||||||
|
|
||||||
boostHeaderStripPhase() {
|
|
||||||
runHook preBoostHeaderStrip
|
|
||||||
[ -z "$outputs" ] && outputs=out
|
|
||||||
for output in $outputs; do
|
|
||||||
eval "path=\$$outputs"
|
|
||||||
[ -d "$path/bin" ] || continue
|
|
||||||
find "$path/bin" -type f -exec sed -i "s,[^/]*\(-boost-[0-9.]*-dev\),xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\1,g" {} \;
|
|
||||||
done
|
|
||||||
runHook postBoostHeaderStrip
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user