From 38a5be67ea98e5e7d1a5466a9ed476e18a855b50 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 9 Nov 2023 22:41:50 -0500 Subject: [PATCH] libopenshot: fix build on Darwin Make sure it includes MagickCore when linking libopenshot.dylib, or it will fail with missing symbols. Use the 11.0 SDK to build. --- pkgs/applications/video/openshot-qt/libopenshot.nix | 4 ++++ pkgs/top-level/qt5-packages.nix | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/video/openshot-qt/libopenshot.nix b/pkgs/applications/video/openshot-qt/libopenshot.nix index 8335e01e2db3..38366782f3be 100644 --- a/pkgs/applications/video/openshot-qt/libopenshot.nix +++ b/pkgs/applications/video/openshot-qt/libopenshot.nix @@ -31,6 +31,10 @@ stdenv.mkDerivation rec { postPatch = '' sed -i 's/{UNITTEST++_INCLUDE_DIR}/ENV{UNITTEST++_INCLUDE_DIR}/g' tests/CMakeLists.txt + '' + lib.optionalString stdenv.isDarwin '' + # Darwin requires both Magick++ and MagickCore or it will fail to link. + substituteInPlace src/CMakeLists.txt \ + --replace 'target_link_libraries(openshot PUBLIC ImageMagick::Magick++)' 'target_link_libraries(openshot PUBLIC ImageMagick::Magick++ ImageMagick::MagickCore)' ''; nativeBuildInputs = lib.optionals stdenv.isLinux [ diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 2de212792e5d..93b9c23bc35b 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -128,7 +128,9 @@ in (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdParty // kdeGea liblastfm = callPackage ../development/libraries/liblastfm { }; - libopenshot = callPackage ../applications/video/openshot-qt/libopenshot.nix { }; + libopenshot = callPackage ../applications/video/openshot-qt/libopenshot.nix { + stdenv = if pkgs.stdenv.isDarwin then pkgs.overrideSDK pkgs.stdenv "11.0" else pkgs.stdenv; + }; packagekit-qt = callPackage ../tools/package-management/packagekit/qt.nix { };