From 8c24e79c15ad83c424c36708d7d1e1b9a8fa57cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Sun, 9 May 2021 22:58:41 +0200 Subject: [PATCH] libfive: fix darwin build --- pkgs/development/libraries/libfive/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libfive/default.nix b/pkgs/development/libraries/libfive/default.nix index 0f6ad84fe75..3833a7fe880 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" '';