aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorRok Garbas <rok@garbas.si>2022-01-21 14:31:17 +0100
committerRok Garbas <rok@garbas.si>2022-01-21 14:31:17 +0100
commita078a645da604ea68a0b619567b77c98fb9a63b3 (patch)
tree655d4f46b0876073f1c6627ab0a281908e0517f9 /flake.nix
parent2267c773f0b36861c13915b518f62376a23b6f46 (diff)
parente85cf34ea3518897a3f05e53ed6c75da630b65cf (diff)
Merge remote-tracking branch 'origin/master' into push-docker-image-to-docker-hub
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index a96aed490..9bfa36fdf 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;