open62541pp: 0.16.0 -> 0.17.0 (#374938)
[NixPkgs.git] / pkgs / applications / audio / deadbeef / default.nix
blob537ed98806659873e7cd24f64919ee11558da877
2   lib,
3   config,
4   clangStdenv,
5   fetchFromGitHub,
6   autoconf,
7   automake,
8   libtool,
9   intltool,
10   pkg-config,
11   jansson,
12   swift-corelibs-libdispatch,
13   # deadbeef can use either gtk2 or gtk3
14   gtk2Support ? false,
15   gtk2,
16   gtk3Support ? true,
17   gtk3,
18   gsettings-desktop-schemas,
19   wrapGAppsHook3,
20   # input plugins
21   vorbisSupport ? true,
22   libvorbis,
23   mp123Support ? true,
24   libmad,
25   flacSupport ? true,
26   flac,
27   wavSupport ? true,
28   libsndfile,
29   cdaSupport ? true,
30   libcdio,
31   libcddb,
32   aacSupport ? true,
33   faad2,
34   opusSupport ? true,
35   opusfile,
36   wavpackSupport ? false,
37   wavpack,
38   ffmpegSupport ? false,
39   ffmpeg,
40   apeSupport ? true,
41   yasm,
42   # misc plugins
43   zipSupport ? true,
44   libzip,
45   artworkSupport ? true,
46   imlib2,
47   hotkeysSupport ? true,
48   libX11,
49   osdSupport ? true,
50   dbus,
51   # output plugins
52   alsaSupport ? true,
53   alsa-lib,
54   pulseSupport ? config.pulseaudio or true,
55   libpulseaudio,
56   pipewireSupport ? true,
57   pipewire,
58   # effect plugins
59   resamplerSupport ? true,
60   libsamplerate,
61   overloadSupport ? true,
62   zlib,
63   # transports
64   remoteSupport ? true,
65   curl,
68 assert gtk2Support || gtk3Support;
70 let
71   inherit (lib) optionals;
73   version = "1.9.6";
75 clangStdenv.mkDerivation {
76   pname = "deadbeef";
77   inherit version;
79   src = fetchFromGitHub {
80     owner = "DeaDBeeF-Player";
81     repo = "deadbeef";
82     fetchSubmodules = true;
83     rev = version;
84     hash = "sha256-Q6hL4fOFPHn26ZqvrebgTMTgQZrhbXCEhM4ZFzNeyJE=";
85   };
87   buildInputs =
88     [
89       jansson
90       swift-corelibs-libdispatch
91     ]
92     ++ optionals gtk2Support [
93       gtk2
94     ]
95     ++ optionals gtk3Support [
96       gtk3
97       gsettings-desktop-schemas
98     ]
99     ++ optionals vorbisSupport [
100       libvorbis
101     ]
102     ++ optionals mp123Support [
103       libmad
104     ]
105     ++ optionals flacSupport [
106       flac
107     ]
108     ++ optionals wavSupport [
109       libsndfile
110     ]
111     ++ optionals cdaSupport [
112       libcdio
113       libcddb
114     ]
115     ++ optionals aacSupport [
116       faad2
117     ]
118     ++ optionals opusSupport [
119       opusfile
120     ]
121     ++ optionals zipSupport [
122       libzip
123     ]
124     ++ optionals ffmpegSupport [
125       ffmpeg
126     ]
127     ++ optionals apeSupport [
128       yasm
129     ]
130     ++ optionals artworkSupport [
131       imlib2
132     ]
133     ++ optionals hotkeysSupport [
134       libX11
135     ]
136     ++ optionals osdSupport [
137       dbus
138     ]
139     ++ optionals alsaSupport [
140       alsa-lib
141     ]
142     ++ optionals pulseSupport [
143       libpulseaudio
144     ]
145     ++ optionals pipewireSupport [
146       pipewire
147     ]
148     ++ optionals resamplerSupport [
149       libsamplerate
150     ]
151     ++ optionals overloadSupport [
152       zlib
153     ]
154     ++ optionals wavpackSupport [
155       wavpack
156     ]
157     ++ optionals remoteSupport [
158       curl
159     ];
161   nativeBuildInputs =
162     [
163       autoconf
164       automake
165       intltool
166       libtool
167       pkg-config
168     ]
169     ++ optionals gtk3Support [
170       wrapGAppsHook3
171     ];
173   enableParallelBuilding = true;
175   preConfigure = ''
176     ./autogen.sh
177   '';
179   postPatch = ''
180     # Fix the build on c++17 compiler:
181     #   https://github.com/DeaDBeeF-Player/deadbeef/issues/3012
182     # TODO: remove after 1.9.5 release.
183     substituteInPlace plugins/adplug/Makefile.am --replace 'adplug_la_CXXFLAGS = ' 'adplug_la_CXXFLAGS = -std=c++11 '
184   '';
186   meta = with lib; {
187     description = "Ultimate Music Player for GNU/Linux";
188     mainProgram = "deadbeef";
189     homepage = "http://deadbeef.sourceforge.net/";
190     downloadPage = "https://github.com/DeaDBeeF-Player/deadbeef";
191     license = licenses.gpl2;
192     platforms = [
193       "x86_64-linux"
194       "i686-linux"
195     ];
196     maintainers = [ maintainers.abbradar ];
197   };