anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / audio / deadbeef / default.nix
blobd141a61963659d71a4c8f269482279881eafbc47
1 { lib, config, clangStdenv, fetchFromGitHub
2 , autoconf
3 , automake
4 , libtool
5 , intltool
6 , pkg-config
7 , jansson
8 , swift-corelibs-libdispatch
9 # deadbeef can use either gtk2 or gtk3
10 , gtk2Support ? false, gtk2
11 , gtk3Support ? true, gtk3, gsettings-desktop-schemas, wrapGAppsHook3
12 # input plugins
13 , vorbisSupport ? true, libvorbis
14 , mp123Support ? true, libmad
15 , flacSupport ? true, flac
16 , wavSupport ? true, libsndfile
17 , cdaSupport ? true, libcdio, libcddb
18 , aacSupport ? true, faad2
19 , opusSupport ? true, opusfile
20 , wavpackSupport ? false, wavpack
21 , ffmpegSupport ? false, ffmpeg
22 , apeSupport ? true, yasm
23 # misc plugins
24 , zipSupport ? true, libzip
25 , artworkSupport ? true, imlib2
26 , hotkeysSupport ? true, libX11
27 , osdSupport ? true, dbus
28 # output plugins
29 , alsaSupport ? true, alsa-lib
30 , pulseSupport ? config.pulseaudio or true, libpulseaudio
31 , pipewireSupport ? true, pipewire
32 # effect plugins
33 , resamplerSupport ? true, libsamplerate
34 , overloadSupport ? true, zlib
35 # transports
36 , remoteSupport ? true, curl
39 assert gtk2Support || gtk3Support;
41 let
42   inherit (lib) optionals;
44   version = "1.9.6";
45 in clangStdenv.mkDerivation {
46   pname = "deadbeef";
47   inherit version;
49   src = fetchFromGitHub {
50     owner = "DeaDBeeF-Player";
51     repo = "deadbeef";
52     fetchSubmodules = true;
53     rev = version;
54     hash = "sha256-Q6hL4fOFPHn26ZqvrebgTMTgQZrhbXCEhM4ZFzNeyJE=";
55   };
57   buildInputs = [
58     jansson
59     swift-corelibs-libdispatch
60   ] ++ optionals gtk2Support [
61     gtk2
62   ] ++ optionals gtk3Support [
63     gtk3
64     gsettings-desktop-schemas
65   ] ++ optionals vorbisSupport [
66     libvorbis
67   ] ++ optionals mp123Support [
68     libmad
69   ] ++ optionals flacSupport [
70     flac
71   ] ++ optionals wavSupport [
72     libsndfile
73   ] ++ optionals cdaSupport [
74     libcdio
75     libcddb
76   ] ++ optionals aacSupport [
77     faad2
78   ] ++ optionals opusSupport [
79     opusfile
80   ] ++ optionals zipSupport [
81     libzip
82   ] ++ optionals ffmpegSupport [
83     ffmpeg
84   ] ++ optionals apeSupport [
85     yasm
86   ] ++ optionals artworkSupport [
87     imlib2
88   ] ++ optionals hotkeysSupport [
89     libX11
90   ] ++ optionals osdSupport [
91     dbus
92   ] ++ optionals alsaSupport [
93     alsa-lib
94   ] ++ optionals pulseSupport [
95     libpulseaudio
96   ] ++ optionals pipewireSupport [
97     pipewire
98   ] ++ optionals resamplerSupport [
99     libsamplerate
100   ] ++ optionals overloadSupport [
101     zlib
102   ] ++ optionals wavpackSupport [
103     wavpack
104   ] ++ optionals remoteSupport [
105     curl
106   ];
108   nativeBuildInputs = [
109     autoconf
110     automake
111     intltool
112     libtool
113     pkg-config
114   ] ++ optionals gtk3Support [
115     wrapGAppsHook3
116   ];
118   enableParallelBuilding = true;
120   preConfigure = ''
121     ./autogen.sh
122   '';
124   postPatch = ''
125     # Fix the build on c++17 compiler:
126     #   https://github.com/DeaDBeeF-Player/deadbeef/issues/3012
127     # TODO: remove after 1.9.5 release.
128     substituteInPlace plugins/adplug/Makefile.am --replace 'adplug_la_CXXFLAGS = ' 'adplug_la_CXXFLAGS = -std=c++11 '
129   '';
131   meta = with lib; {
132     description = "Ultimate Music Player for GNU/Linux";
133     mainProgram = "deadbeef";
134     homepage = "http://deadbeef.sourceforge.net/";
135     downloadPage = "https://github.com/DeaDBeeF-Player/deadbeef";
136     license = licenses.gpl2;
137     platforms = [ "x86_64-linux" "i686-linux" ];
138     maintainers = [ maintainers.abbradar ];
139   };