about summary refs log tree commit diff
path: root/pkgs/development/libraries/libfive
diff options
context:
space:
mode:
authorStéphan Kochen <git@stephank.nl>2021-05-09 22:58:41 +0200
committerStéphan Kochen <git@stephank.nl>2021-05-11 09:18:32 +0200
commit8c24e79c15ad83c424c36708d7d1e1b9a8fa57cc (patch)
treea00175f278e8e4a9dbf4890d33b60231eb077fa7 /pkgs/development/libraries/libfive
parent0249e0417e2a53d34fc54aacf6c9beab81bc3bf7 (diff)
libfive: fix darwin build
Diffstat (limited to 'pkgs/development/libraries/libfive')
-rw-r--r--pkgs/development/libraries/libfive/default.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libfive/default.nix b/pkgs/development/libraries/libfive/default.nix
index 0f6ad84fe7550..3833a7fe880a7 100644
--- a/pkgs/development/libraries/libfive/default.nix
+++ b/pkgs/development/libraries/libfive/default.nix
@@ -10,6 +10,7 @@
 , libpng
 , boost
 , guile
+, stdenv
 }:
 
 mkDerivation {
@@ -26,8 +27,19 @@ mkDerivation {
   nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
   buildInputs = [ eigen zlib libpng boost guile ];
 
-  # Link "Studio" binary to "libfive-studio" to be more obvious:
-  postFixup = ''
+  postInstall = if stdenv.isDarwin then ''
+    # No rules to install the mac app, so do it manually.
+    mkdir -p $out/Applications
+    cp -r studio/Studio.app $out/Applications/Studio.app
+
+    install_name_tool \
+      -change libfive.dylib $out/lib/libfive.dylib \
+      -change libfive-guile.dylib $out/lib/libfive-guile.dylib \
+      $out/Applications/Studio.app/Contents/MacOS/Studio
+
+    wrapQtApp $out/Applications/Studio.app/Contents/MacOS/Studio
+  '' else ''
+    # Link "Studio" binary to "libfive-studio" to be more obvious:
     ln -s "$out/bin/Studio" "$out/bin/libfive-studio"
   '';