Merge pull request #122468 from stephank/fix-libfive-darwin

libfive: fix darwin build
This commit is contained in:
Robert Scott 2021-05-12 22:54:51 +01:00 committed by GitHub
commit 012cb9d3e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@
, libpng , libpng
, boost , boost
, guile , guile
, stdenv
}: }:
mkDerivation { mkDerivation {
@ -26,8 +27,19 @@ mkDerivation {
nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ]; nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
buildInputs = [ eigen zlib libpng boost guile ]; buildInputs = [ eigen zlib libpng boost guile ];
# Link "Studio" binary to "libfive-studio" to be more obvious: postInstall = if stdenv.isDarwin then ''
postFixup = '' # 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" ln -s "$out/bin/Studio" "$out/bin/libfive-studio"
''; '';