aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-01-17 10:14:45 +0100
committerGitHub <noreply@github.com>2022-01-17 10:14:45 +0100
commit008ddef4b08e9bee530a5a4c597c88b344089021 (patch)
treeea246cd496c9fd7d3c7a7d09e02786374d7ebf09
parentbb24d1edd7c0d0c47a85b39c0c2c2b3093e897b6 (diff)
parentdd3aa1e5158f5692326f282985ec03300ed452b2 (diff)
Merge pull request #5915 from NixOS/disallow-boost-reference
Forbid runtime references to boost
-rw-r--r--flake.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index f4fae2a00..86601fcd9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -299,6 +299,8 @@
propagatedBuildInputs = propagatedDeps;
+ disallowedReferences = [ boost ];
+
preConfigure =
''
# Copy libboost_context so we don't get all of Boost in our closure.
@@ -310,6 +312,13 @@
chmod u+w $out/lib/*.so.*
patchelf --set-rpath $out/lib:${currentStdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
''}
+ ${lib.optionalString currentStdenv.isDarwin ''
+ for LIB in $out/lib/*.dylib; do
+ chmod u+w $LIB
+ install_name_tool -id $LIB $LIB
+ done
+ install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib
+ ''}
'';
configureFlags = configureFlags ++
@@ -326,6 +335,12 @@
postInstall = ''
mkdir -p $doc/nix-support
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
+ ${lib.optionalString currentStdenv.isDarwin ''
+ install_name_tool \
+ -change ${boost}/lib/libboost_context.dylib \
+ $out/lib/libboost_context.dylib \
+ $out/lib/libnixutil.dylib
+ ''}
'';
doInstallCheck = true;