git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #122468 from stephank/fix-libfive-darwin

libfive: fix darwin build

commit012cb9d3e28012ef176d96e69f07c991a3514060 authorRobert Scott <code@humanleg.org.uk> dateWed 12 May 2021, 22:54 (6 years ago) parente91e9168c24e79
1 file changed+14−2
pkgs/development/libraries/libfive/default.nix+14−2
pkgs/development/libraries/libfive/default.nix+14−2
@@ -10,6 +10,7 @@
1010, libpng
1111, boost
1212, guile
13+, stdenv
1314}:
1415
1516mkDerivation {
@@ -26,8 +27,19 @@ mkDerivation {
2627 nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
2728 buildInputs = [ eigen zlib libpng boost guile ];
2829
29− # Link "Studio" binary to "libfive-studio" to be more obvious:
30− postFixup = ''
30+ postInstall = if stdenv.isDarwin then ''
31+ # No rules to install the mac app, so do it manually.
32+ mkdir -p $out/Applications
33+ cp -r studio/Studio.app $out/Applications/Studio.app
34+
35+ install_name_tool \
36+ -change libfive.dylib $out/lib/libfive.dylib \
37+ -change libfive-guile.dylib $out/lib/libfive-guile.dylib \
38+ $out/Applications/Studio.app/Contents/MacOS/Studio
39+
40+ wrapQtApp $out/Applications/Studio.app/Contents/MacOS/Studio
41+ '' else ''
42+ # Link "Studio" binary to "libfive-studio" to be more obvious:
3143 ln -s "$out/bin/Studio" "$out/bin/libfive-studio"
3244 '';
3345