boost: use sanitiseHeaderPathsHook

This commit is contained in:
Emily
2025-07-04 12:02:26 +01:00
parent 1b28a1e224
commit acf51915ab
+11 -9
View File
@@ -10,6 +10,7 @@
fixDarwinDylibNames,
libiconv,
libxcrypt,
sanitiseHeaderPathsHook,
makePkgconfigItem,
copyPkgconfigItems,
boost-build,
@@ -346,6 +347,7 @@ stdenv.mkDerivation {
which
boost-build
copyPkgconfigItems
sanitiseHeaderPathsHook
] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs =
[
@@ -394,15 +396,15 @@ stdenv.mkDerivation {
runHook postInstall
'';
postFixup =
''
# Make boost header paths relative so that they are not runtime dependencies
cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-exec sed '1s/^\xef\xbb\xbf//;1i#line 1 "{}"' -i '{}' \;
''
+ lib.optionalString stdenv.hostPlatform.isMinGW ''
$RANLIB "$out/lib/"*.a
'';
preFixup = ''
# Strip UTF8 BOMs for `sanitiseHeaderPathsHook`.
cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-exec sed '1s/^\xef\xbb\xbf//' -i '{}' \;
'';
postFixup = lib.optionalString stdenv.hostPlatform.isMinGW ''
$RANLIB "$out/lib/"*.a
'';
outputs = [
"out"