ft2-clone: fix darwin

This commit is contained in:
Francesco Gazzetta 2021-01-02 18:39:18 +01:00
parent 62f0b749d2
commit 5ec0a5636e
2 changed files with 26 additions and 2 deletions

View File

@ -5,6 +5,10 @@
, alsaLib , alsaLib
, SDL2 , SDL2
, libiconv , libiconv
, CoreAudio
, CoreMIDI
, CoreServices
, Cocoa
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -18,10 +22,28 @@ stdenv.mkDerivation rec {
sha256 = "0w3c1rgm8qlqi50gavrcjz40xb0nkis4i9mvpwmvzmdv9nipxry9"; 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 ]; nativeBuildInputs = [ cmake ];
buildInputs = [ SDL2 ] buildInputs = [ SDL2 ]
++ stdenv.lib.optional stdenv.isLinux alsaLib ++ 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 = { passthru.tests = {
ft2-clone-starts = nixosTests.ft2-clone; ft2-clone-starts = nixosTests.ft2-clone;

View File

@ -21390,7 +21390,9 @@ in
fsv = callPackage ../applications/misc/fsv { }; 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 { }; fvwm = callPackage ../applications/window-managers/fvwm { };