From f962ed7c2fa50639a10319fa24345af708ff4d14 Mon Sep 17 00:00:00 2001 From: Chuang Zhu Date: Tue, 21 Jan 2025 07:05:27 +0800 Subject: [PATCH] gqrx: add darwin support --- pkgs/applications/radio/gqrx/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/radio/gqrx/default.nix b/pkgs/applications/radio/gqrx/default.nix index a74aead0f80f..2bb626cc324a 100644 --- a/pkgs/applications/radio/gqrx/default.nix +++ b/pkgs/applications/radio/gqrx/default.nix @@ -17,9 +17,10 @@ # drivers (optional): rtl-sdr, hackrf, - pulseaudioSupport ? true, + stdenv, + pulseaudioSupport ? !stdenv.hostPlatform.isDarwin, libpulseaudio, - portaudioSupport ? false, + portaudioSupport ? stdenv.hostPlatform.isDarwin, portaudio, }: @@ -50,16 +51,18 @@ gnuradioMinimal.pkgs.mkDerivation rec { gnuradioMinimal.unwrapped.logLib mpir fftwFloat - alsa-lib libjack2 gnuradioMinimal.unwrapped.boost qtbase qtsvg - qtwayland gnuradioMinimal.pkgs.osmosdr rtl-sdr hackrf ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + qtwayland + ] ++ lib.optionals (gnuradioMinimal.hasFeature "gr-ctrlport") [ thrift gnuradioMinimal.unwrapped.python.pkgs.thrift @@ -78,7 +81,7 @@ gnuradioMinimal.pkgs.mkDerivation rec { "Gr-audio"; in [ - "-DLINUX_AUDIO_BACKEND=${audioBackend}" + "-D${if stdenv.hostPlatform.isDarwin then "OSX" else "LINUX"}_AUDIO_BACKEND=${audioBackend}" ]; # Prevent double-wrapping, inject wrapper args manually instead. @@ -100,7 +103,7 @@ gnuradioMinimal.pkgs.mkDerivation rec { # Some of the code comes from the Cutesdr project, with a BSD license, but # it's currently unknown which version of the BSD license that is. license = licenses.gpl3Plus; - platforms = platforms.linux; # should work on Darwin / macOS too + platforms = platforms.linux ++ platforms.darwin; maintainers = with maintainers; [ bjornfor fpletz