about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/deadbeef/default.nix
blob: 2c08477d07a0e3fc749640b9ef420404d02cfd01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{ lib, config, clangStdenv, fetchFromGitHub
, autoconf
, automake
, libtool
, intltool
, pkg-config
, jansson
, swift-corelibs-libdispatch
# deadbeef can use either gtk2 or gtk3
, gtk2Support ? false, gtk2
, gtk3Support ? true, gtk3, gsettings-desktop-schemas, wrapGAppsHook
# input plugins
, vorbisSupport ? true, libvorbis
, mp123Support ? true, libmad
, flacSupport ? true, flac
, wavSupport ? true, libsndfile
, cdaSupport ? true, libcdio, libcddb
, aacSupport ? true, faad2
, opusSupport ? true, opusfile
, wavpackSupport ? false, wavpack
, ffmpegSupport ? false, ffmpeg
, apeSupport ? true, yasm
# misc plugins
, zipSupport ? true, libzip
, artworkSupport ? true, imlib2
, hotkeysSupport ? true, libX11
, osdSupport ? true, dbus
# output plugins
, alsaSupport ? true, alsa-lib
, pulseSupport ? config.pulseaudio or true, libpulseaudio
, pipewireSupport ? true, pipewire
# effect plugins
, resamplerSupport ? true, libsamplerate
, overloadSupport ? true, zlib
# transports
, remoteSupport ? true, curl
}:

assert gtk2Support || gtk3Support;

let
  inherit (lib) optionals;

  version = "1.9.6";
in clangStdenv.mkDerivation {
  pname = "deadbeef";
  inherit version;

  src = fetchFromGitHub {
    owner = "DeaDBeeF-Player";
    repo = "deadbeef";
    fetchSubmodules = true;
    rev = version;
    hash = "sha256-Q6hL4fOFPHn26ZqvrebgTMTgQZrhbXCEhM4ZFzNeyJE=";
  };

  buildInputs = [
    jansson
    swift-corelibs-libdispatch
  ] ++ optionals gtk2Support [
    gtk2
  ] ++ optionals gtk3Support [
    gtk3
    gsettings-desktop-schemas
  ] ++ optionals vorbisSupport [
    libvorbis
  ] ++ optionals mp123Support [
    libmad
  ] ++ optionals flacSupport [
    flac
  ] ++ optionals wavSupport [
    libsndfile
  ] ++ optionals cdaSupport [
    libcdio
    libcddb
  ] ++ optionals aacSupport [
    faad2
  ] ++ optionals opusSupport [
    opusfile
  ] ++ optionals zipSupport [
    libzip
  ] ++ optionals ffmpegSupport [
    ffmpeg
  ] ++ optionals apeSupport [
    yasm
  ] ++ optionals artworkSupport [
    imlib2
  ] ++ optionals hotkeysSupport [
    libX11
  ] ++ optionals osdSupport [
    dbus
  ] ++ optionals alsaSupport [
    alsa-lib
  ] ++ optionals pulseSupport [
    libpulseaudio
  ] ++ optionals pipewireSupport [
    pipewire
  ] ++ optionals resamplerSupport [
    libsamplerate
  ] ++ optionals overloadSupport [
    zlib
  ] ++ optionals wavpackSupport [
    wavpack
  ] ++ optionals remoteSupport [
    curl
  ];

  nativeBuildInputs = [
    autoconf
    automake
    intltool
    libtool
    pkg-config
  ] ++ optionals gtk3Support [
    wrapGAppsHook
  ];

  enableParallelBuilding = true;

  preConfigure = ''
    ./autogen.sh
  '';

  postPatch = ''
    # Fix the build on c++17 compiler:
    #   https://github.com/DeaDBeeF-Player/deadbeef/issues/3012
    # TODO: remove after 1.9.5 release.
    substituteInPlace plugins/adplug/Makefile.am --replace 'adplug_la_CXXFLAGS = ' 'adplug_la_CXXFLAGS = -std=c++11 '
  '';

  meta = with lib; {
    description = "Ultimate Music Player for GNU/Linux";
    homepage = "http://deadbeef.sourceforge.net/";
    downloadPage = "https://github.com/DeaDBeeF-Player/deadbeef";
    license = licenses.gpl2;
    platforms = [ "x86_64-linux" "i686-linux" ];
    maintainers = [ maintainers.abbradar ];
  };
}