From 62f0b749d253dc73e4063e242b7848b599c5a57d Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Fri, 1 Jan 2021 22:08:07 +0100 Subject: [PATCH 1/2] ft2-clone: 1.41_fix -> 1.42 --- pkgs/applications/audio/ft2-clone/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/ft2-clone/default.nix b/pkgs/applications/audio/ft2-clone/default.nix index 7045d6811d38..6179ae71113e 100644 --- a/pkgs/applications/audio/ft2-clone/default.nix +++ b/pkgs/applications/audio/ft2-clone/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "ft2-clone"; - version = "1.41_fix"; + version = "1.42"; src = fetchFromGitHub { owner = "8bitbubsy"; repo = "ft2-clone"; rev = "v${version}"; - sha256 = "0c7jli79ckachl5n2rbhc4yzml8nc36pl9yzxcwgaz544q8pzmaa"; + sha256 = "0w3c1rgm8qlqi50gavrcjz40xb0nkis4i9mvpwmvzmdv9nipxry9"; }; nativeBuildInputs = [ cmake ]; From 5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sat, 2 Jan 2021 18:39:18 +0100 Subject: [PATCH 2/2] ft2-clone: fix darwin --- pkgs/applications/audio/ft2-clone/default.nix | 24 ++++++++++++++++++- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/ft2-clone/default.nix b/pkgs/applications/audio/ft2-clone/default.nix index 6179ae71113e..68b3871f29fe 100644 --- a/pkgs/applications/audio/ft2-clone/default.nix +++ b/pkgs/applications/audio/ft2-clone/default.nix @@ -5,6 +5,10 @@ , alsaLib , SDL2 , libiconv +, CoreAudio +, CoreMIDI +, CoreServices +, Cocoa }: stdenv.mkDerivation rec { @@ -18,10 +22,28 @@ stdenv.mkDerivation rec { sha256 = "0w3c1rgm8qlqi50gavrcjz40xb0nkis4i9mvpwmvzmdv9nipxry9"; }; + # Adapt the linux-only CMakeLists to darwin (more reliable than make-macos.sh) + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + sed -i -e 's@__LINUX_ALSA__@__MACOSX_CORE__@' -e 's@asound@@' CMakeLists.txt + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ SDL2 ] ++ stdenv.lib.optional stdenv.isLinux alsaLib - ++ stdenv.lib.optional stdenv.isDarwin libiconv; + ++ stdenv.lib.optionals stdenv.isDarwin [ + libiconv + CoreAudio + CoreMIDI + CoreServices + Cocoa + ]; + + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin [ + "-framework CoreAudio" + "-framework CoreMIDI" + "-framework CoreServices" + "-framework Cocoa" + ]; passthru.tests = { ft2-clone-starts = nixosTests.ft2-clone; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4dfdcfd3ae0a..25ae7160bf9a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21390,7 +21390,9 @@ in fsv = callPackage ../applications/misc/fsv { }; - ft2-clone = callPackage ../applications/audio/ft2-clone { }; + ft2-clone = callPackage ../applications/audio/ft2-clone { + inherit (darwin.apple_sdk.frameworks) CoreAudio CoreMIDI CoreServices Cocoa; + }; fvwm = callPackage ../applications/window-managers/fvwm { };