diff options
author | Adam Stephens <adam@valkor.net> | 2023-05-17 11:45:45 -0400 |
---|---|---|
committer | Adam Stephens <adam@valkor.net> | 2023-05-21 09:40:11 -0400 |
commit | 524f06e386afc41c14696392df81fd81f403d05d (patch) | |
tree | 54739b964a259bae786d7549bd5d70ad4fcef9b3 | |
parent | 904f1e3235d78269b5365f2166179596cbdedd66 (diff) | |
download | nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.tar nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.tar.gz nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.tar.bz2 nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.tar.lz nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.tar.xz nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.tar.zst nixpkgs-524f06e386afc41c14696392df81fd81f403d05d.zip |
squeezelite: add darwin support
-rw-r--r-- | pkgs/applications/audio/squeezelite/default.nix | 27 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 10 |
2 files changed, 30 insertions, 7 deletions
diff --git a/pkgs/applications/audio/squeezelite/default.nix b/pkgs/applications/audio/squeezelite/default.nix index e88214f3bd8..394fb8be9f9 100644 --- a/pkgs/applications/audio/squeezelite/default.nix +++ b/pkgs/applications/audio/squeezelite/default.nix @@ -1,13 +1,14 @@ { lib , stdenv , fetchFromGitHub -, alsa-lib , flac , libmad , libpulseaudio , libvorbis , mpg123 -, audioBackend ? "alsa" +, audioBackend ? if stdenv.isLinux then "alsa" else "portaudio" +, alsaSupport ? stdenv.isLinux +, alsa-lib , dsdSupport ? true , faad2Support ? true , faad2 @@ -19,10 +20,18 @@ , soxr , sslSupport ? true , openssl +, portaudioSupport ? stdenv.isDarwin +, portaudio +, AudioToolbox +, AudioUnit +, Carbon +, CoreAudio +, CoreVideo +, VideoDecodeAcceleration }: let - inherit (lib) optional optionalString; + inherit (lib) optional optionals optionalString; pulseSupport = audioBackend == "pulse"; @@ -44,7 +53,10 @@ stdenv.mkDerivation { }; buildInputs = [ flac libmad libvorbis mpg123 ] - ++ lib.singleton (if pulseSupport then libpulseaudio else alsa-lib) + ++ optional pulseSupport libpulseaudio + ++ optional alsaSupport alsa-lib + ++ optional portaudioSupport portaudio + ++ optionals stdenv.isDarwin [ CoreVideo VideoDecodeAcceleration CoreAudio AudioToolbox AudioUnit Carbon ] ++ optional faad2Support faad2 ++ optional ffmpegSupport ffmpeg ++ optional opusSupport opusfile @@ -65,10 +77,15 @@ stdenv.mkDerivation { ++ optional (!faad2Support) "-DNO_FAAD" ++ optional ffmpegSupport "-DFFMPEG" ++ optional opusSupport "-DOPUS" + ++ optional portaudioSupport "-DPORTAUDIO" ++ optional pulseSupport "-DPULSEAUDIO" ++ optional resampleSupport "-DRESAMPLE" ++ optional sslSupport "-DUSE_SSL"; + LDADD = if stdenv.isLinux + then null + else "-lportaudio -lpthread -ldl -lm -framework CoreVideo -framework VideoDecodeAcceleration -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; + installPhase = '' runHook preInstall @@ -85,6 +102,6 @@ stdenv.mkDerivation { homepage = "https://github.com/ralph-irving/squeezelite"; license = with licenses; [ gpl3Plus ] ++ optional dsdSupport bsd2; maintainers = with maintainers; [ adamcstephens ]; - platforms = platforms.linux; + platforms = if (audioBackend == "pulse") then platforms.linux else platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 78db7fe2748..91555a5ef3c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34148,9 +34148,15 @@ with pkgs; psst = callPackage ../applications/audio/psst { }; - squeezelite = callPackage ../applications/audio/squeezelite { audioBackend = "alsa"; }; + squeezelite = darwin.apple_sdk_11_0.callPackage ../applications/audio/squeezelite { + inherit (darwin.apple_sdk_11_0.frameworks) CoreVideo VideoDecodeAcceleration CoreAudio AudioToolbox AudioUnit Carbon; + }; + + squeezelite-pulse = darwin.apple_sdk_11_0.callPackage ../applications/audio/squeezelite { + inherit (darwin.apple_sdk_11_0.frameworks) CoreVideo VideoDecodeAcceleration CoreAudio AudioToolbox AudioUnit Carbon; - squeezelite-pulse = callPackage ../applications/audio/squeezelite { audioBackend = "pulse"; }; + audioBackend = "pulse"; + }; ltunify = callPackage ../tools/misc/ltunify { }; |