From 037ec9ab0d7fc633ce95660f2a33432d4398654e Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sat, 30 Apr 2022 18:03:44 +0200 Subject: [PATCH] musikcube: fix darwin build --- .../audio/musikcube/0001-apple-cmake.patch | 14 +++++++++++++ pkgs/applications/audio/musikcube/default.nix | 20 ++++++++++++++----- pkgs/top-level/all-packages.nix | 4 +++- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 pkgs/applications/audio/musikcube/0001-apple-cmake.patch diff --git a/pkgs/applications/audio/musikcube/0001-apple-cmake.patch b/pkgs/applications/audio/musikcube/0001-apple-cmake.patch new file mode 100644 index 000000000000..3c4630af4aa7 --- /dev/null +++ b/pkgs/applications/audio/musikcube/0001-apple-cmake.patch @@ -0,0 +1,14 @@ +diff --git a/src/musikcube/CMakeLists.txt b/src/musikcube/CMakeLists.txt +index f42748aa..ae339946 100644 +--- a/src/musikcube/CMakeLists.txt ++++ b/src/musikcube/CMakeLists.txt +@@ -98,9 +98,6 @@ else() + endif() + + if (APPLE) +- message(STATUS "[ncurses] detected Darwin, linking statically") +- set(CURSES_LIBRARY_NAME "lib${CURSES_LIBRARY_NAME}.a") +- set(PANEL_LIBRARY_NAME "lib${PANEL_LIBRARY_NAME}.a") + else() + message(STATUS "[ncurses] not Darwin! will attempt to link against libtinfo") + find_library(LIBTINFO NAMES tinfo) diff --git a/pkgs/applications/audio/musikcube/default.nix b/pkgs/applications/audio/musikcube/default.nix index ce51206b12d8..0557ee2e676e 100644 --- a/pkgs/applications/audio/musikcube/default.nix +++ b/pkgs/applications/audio/musikcube/default.nix @@ -1,6 +1,5 @@ { cmake , pkg-config -, alsa-lib , boost , curl , fetchFromGitHub @@ -11,12 +10,17 @@ , libev , libmicrohttpd , ncurses -, pulseaudio , lib , stdenv , taglib +# Linux Dependencies +, alsa-lib +, pulseaudio , systemdSupport ? stdenv.isLinux , systemd +# Darwin Dependencies +, Cocoa +, SystemConfiguration }: stdenv.mkDerivation rec { @@ -38,14 +42,15 @@ stdenv.mkDerivation rec { url = "https://github.com/clangen/musikcube/commit/1240720e27232fdb199a4da93ca6705864442026.patch"; sha256 = "0bhjgwnj6d24wb1m9xz1vi1k9xk27arba1absjbcimggn54pinid"; }) + ./0001-apple-cmake.patch ]; nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ - alsa-lib boost curl ffmpeg @@ -54,9 +59,14 @@ stdenv.mkDerivation rec { libev libmicrohttpd ncurses - pulseaudio taglib - ] ++ lib.optional systemdSupport systemd; + ] ++ lib.optional systemdSupport [ + systemd + ] ++ lib.optional stdenv.isLinux [ + alsa-lib pulseaudio + ] ++ lib.optional stdenv.isDarwin [ + Cocoa SystemConfiguration + ]; cmakeFlags = [ "-DDISABLE_STRIP=true" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ae0c1c4f8033..7f3d7b8af9f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27047,7 +27047,9 @@ with pkgs; marker = callPackage ../applications/editors/marker { }; - musikcube = callPackage ../applications/audio/musikcube {}; + musikcube = callPackage ../applications/audio/musikcube { + inherit (darwin.apple_sdk.frameworks) Cocoa SystemConfiguration; + }; libmt32emu = callPackage ../applications/audio/munt/libmt32emu.nix { };