1{
2 copyDesktopItems,
3 fetchFromGitHub,
4 fetchpatch,
5 glibmm,
6 gst_all_1,
7 lib,
8 libarchive,
9 makeDesktopItem,
10 pipewire,
11 pkg-config,
12 pulseaudio,
13 qmake,
14 qtbase,
15 qtsvg,
16 qtwayland,
17 stdenv,
18 usePipewire ? true,
19 usePulseaudio ? false,
20 wrapQtAppsHook,
21}:
22
23assert lib.asserts.assertMsg (
24 usePipewire != usePulseaudio
25) "You need to enable one and only one of pulseaudio or pipewire support";
26
27stdenv.mkDerivation (finalAttrs: {
28 pname = "jamesdsp";
29 version = "2.7.0";
30
31 src = fetchFromGitHub {
32 owner = "Audio4Linux";
33 repo = "JDSP4Linux";
34 fetchSubmodules = true;
35 rev = finalAttrs.version;
36 hash = "sha256-eVndqIqJ3DRceuFMT++g2riXq0CL5r+TWbvzvaYIfZ8=";
37 };
38
39 nativeBuildInputs = [
40 qmake
41 pkg-config
42 copyDesktopItems
43 wrapQtAppsHook
44 ];
45
46 patches = [
47 (fetchpatch {
48 url = "https://github.com/Audio4Linux/JDSP4Linux/pull/241.patch";
49 hash = "sha256-RtVKlw2ca8An4FodeD0RN95z9yHDHBgAxsEwLAmW7co=";
50 name = "fix-build-with-new-pipewire.patch";
51 })
52 ./fix-build-on-qt6_9.diff
53 ];
54
55 buildInputs = [
56 glibmm
57 libarchive
58 qtbase
59 qtsvg
60 qtwayland
61 ]
62 ++ lib.optionals usePipewire [
63 pipewire
64 ]
65 ++ lib.optionals usePulseaudio [
66 pulseaudio
67 gst_all_1.gst-plugins-base
68 gst_all_1.gst-plugins-good
69 gst_all_1.gstreamer
70 ];
71
72 preFixup = lib.optionalString usePulseaudio ''
73 qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
74 '';
75
76 qmakeFlags = lib.optionals usePulseaudio [ "CONFIG+=USE_PULSEAUDIO" ];
77
78 # https://github.com/Audio4Linux/JDSP4Linux/issues/228
79 env.NIX_CFLAGS_COMPILE = toString [
80 "-Wno-error=incompatible-pointer-types"
81 "-Wno-error=implicit-int"
82 "-Wno-error=implicit-function-declaration"
83 ];
84
85 desktopItems = [
86 (makeDesktopItem {
87 name = "jamesdsp";
88 desktopName = "JamesDSP";
89 genericName = "Audio effects processor";
90 exec = "jamesdsp";
91 icon = "jamesdsp";
92 comment = "JamesDSP for Linux";
93 categories = [
94 "AudioVideo"
95 "Audio"
96 ];
97 startupNotify = false;
98 keywords = [
99 "equalizer"
100 "audio"
101 "effect"
102 ];
103 })
104 ];
105
106 postInstall = ''
107 install -D resources/icons/icon.png $out/share/pixmaps/jamesdsp.png
108 install -D resources/icons/icon.svg $out/share/icons/hicolor/scalable/apps/jamesdsp.svg
109 '';
110
111 meta = {
112 broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
113 description = "Audio effect processor for PipeWire clients";
114 mainProgram = "jamesdsp";
115 homepage = "https://github.com/Audio4Linux/JDSP4Linux";
116 license = lib.licenses.gpl3Only;
117 maintainers = with lib.maintainers; [
118 pasqui23
119 rewine
120 ];
121 platforms = lib.platforms.linux;
122 };
123})