summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-04-21 16:10:15 +0200
committerGitHub <noreply@github.com>2022-04-21 16:10:15 +0200
commit496254f7c573140aadaafee87e6ba5163ecfaf37 (patch)
tree44c05cc9c1adb37e069e95d053a0465b63e3a620
parent09a57b9eb3b40e6b90d8e6fa425949786cbc1761 (diff)
parent9cb508adf7d22359a98390577a2a95ba95d78bae (diff)
downloadnixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.tar
nixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.tar.gz
nixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.tar.bz2
nixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.tar.lz
nixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.tar.xz
nixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.tar.zst
nixpkgs-496254f7c573140aadaafee87e6ba5163ecfaf37.zip
Merge pull request #163170 from wineee/jamesdsp
jamesdsp: add PulseAudio support
-rw-r--r--pkgs/applications/audio/jamesdsp/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 39 insertions, 5 deletions
diff --git a/pkgs/applications/audio/jamesdsp/default.nix b/pkgs/applications/audio/jamesdsp/default.nix
index 16683564b2c..61f8907f99c 100644
--- a/pkgs/applications/audio/jamesdsp/default.nix
+++ b/pkgs/applications/audio/jamesdsp/default.nix
@@ -2,18 +2,31 @@
 , mkDerivation
 , fetchFromGitHub
 , pipewire
+, pulseaudio
+, gst_all_1
 , glibmm
 , qmake
+, qtbase
+, qtsvg
+, wrapQtAppsHook
 , makeDesktopItem
 , pkg-config
 , libarchive
 , fetchpatch
+, copyDesktopItems
+, usePipewire ? true
+, usePulseaudio ? false
 }:
 
-mkDerivation rec{
+assert lib.asserts.assertMsg (usePipewire != usePulseaudio) "You need to enable one and only one of pulseaudio or pipewire support";
+
+let
+  pluginPath = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good ]);
+in
+  mkDerivation rec {
   pname = "jamesdsp";
   version = "2.3";
-  src = fetchFromGitHub rec{
+  src = fetchFromGitHub rec {
     owner = "Audio4Linux";
     repo = "JDSP4Linux";
     fetchSubmodules = true;
@@ -29,13 +42,30 @@ mkDerivation rec{
     })
   ];
 
-  nativeBuildInputs = [ qmake pkg-config ];
+  nativeBuildInputs = [
+    qmake
+    pkg-config
+    copyDesktopItems
+    wrapQtAppsHook
+  ];
+
   buildInputs = [
     glibmm
     libarchive
-    pipewire
+    qtbase
+    qtsvg
+  ] ++ lib.optional usePipewire pipewire
+  ++ lib.optionals usePulseaudio [
+    pulseaudio
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-good
+    gst_all_1.gstreamer
   ];
 
+  qtWrapperArgs = lib.optionals usePulseaudio [ "--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${pluginPath}" ];
+
+  qmakeFlags = lib.optionals usePulseaudio [ "CONFIG+=USE_PULSEAUDIO" ];
+
   desktopItems = [
     (makeDesktopItem {
       name = "jamesdsp";
@@ -54,7 +84,7 @@ mkDerivation rec{
     description = "An audio effect processor for PipeWire clients";
     homepage = "https://github.com/Audio4Linux/JDSP4Linux";
     license = licenses.gpl3Only;
-    maintainers = with maintainers;[ pasqui23 ];
+    maintainers = with maintainers; [ pasqui23 rewine ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c2afa0ccceb..c239b37bf6b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7134,6 +7134,10 @@ with pkgs;
   jadx = callPackage ../tools/security/jadx { };
 
   jamesdsp = libsForQt5.callPackage ../applications/audio/jamesdsp { };
+  jamesdsp-pulse = libsForQt5.callPackage ../applications/audio/jamesdsp {
+    usePipewire = false;
+    usePulseaudio = true;
+  };
 
   jazzy = callPackage ../development/tools/jazzy { };