aboutsummaryrefslogtreecommitdiff
path: root/pkgs/mpd_0_21
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-08-25 23:49:34 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-09-30 00:40:56 +0200
commit56cfbfb0d8534122d1eaf45ef945d8010f831133 (patch)
tree2707ea14d154a2d6e20e23b73a5462a7448779d3 /pkgs/mpd_0_21
parent660cb973260f62551294f73e0811b37fc10fd467 (diff)
downloadNix-56cfbfb0d8534122d1eaf45ef945d8010f831133.tar.gz
Nix-56cfbfb0d8534122d1eaf45ef945d8010f831133.tar.zst
Nix-56cfbfb0d8534122d1eaf45ef945d8010f831133.zip
Move packages to flakes
Diffstat (limited to 'pkgs/mpd_0_21')
-rw-r--r--pkgs/mpd_0_21/default.nix162
-rw-r--r--pkgs/mpd_0_21/default_old.nix156
2 files changed, 0 insertions, 318 deletions
diff --git a/pkgs/mpd_0_21/default.nix b/pkgs/mpd_0_21/default.nix
deleted file mode 100644
index 4f97e3f..0000000
--- a/pkgs/mpd_0_21/default.nix
+++ /dev/null
@@ -1,162 +0,0 @@
1{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, systemd, boost, darwin
2# Inputs
3, curl, libmms, libnfs, samba
4# Archive support
5, bzip2, zziplib
6# Codecs
7, audiofile, faad2, ffmpeg, flac, fluidsynth, game-music-emu
8, libmad, libmikmod, mpg123, libopus, libvorbis, lame
9# Filters
10, libsamplerate
11# Outputs
12, alsaLib, libjack2, libpulseaudio, libshout
13# Misc
14, icu, sqlite, avahi, dbus, pcre, libgcrypt, expat
15# Services
16, yajl
17# Client support
18, mpd_clientlib
19# Tag support
20, libid3tag
21}:
22
23let
24 lib = stdenv.lib;
25
26 featureDependencies = {
27 # Storage plugins
28 udisks = [ dbus ];
29 webdav = [ curl expat ];
30 # Input plugins
31 curl = [ curl ];
32 mms = [ libmms ];
33 nfs = [ libnfs ];
34 smbclient = [ samba ];
35 # Archive support
36 bzip2 = [ bzip2 ];
37 zzip = [ zziplib ];
38 # Decoder plugins
39 audiofile = [ audiofile ];
40 faad = [ faad2 ];
41 ffmpeg = [ ffmpeg ];
42 flac = [ flac ];
43 fluidsynth = [ fluidsynth ];
44 gme = [ game-music-emu ];
45 mad = [ libmad ];
46 mikmod = [ libmikmod ];
47 mpg123 = [ mpg123 ];
48 opus = [ libopus ];
49 vorbis = [ libvorbis ];
50 # Encoder plugins
51 vorbisenc = [ libvorbis ];
52 lame = [ lame ];
53 # Filter plugins
54 libsamplerate = [ libsamplerate ];
55 # Output plugins
56 alsa = [ alsaLib ];
57 jack = [ libjack2 ];
58 pulse = [ libpulseaudio ];
59 shout = [ libshout ];
60 # Commercial services
61 qobuz = [ curl libgcrypt yajl ];
62 soundcloud = [ curl yajl ];
63 tidal = [ curl yajl ];
64 # Client support
65 libmpdclient = [ mpd_clientlib ];
66 # Tag support
67 id3tag = [ libid3tag ];
68 # Misc
69 dbus = [ dbus ];
70 expat = [ expat ];
71 icu = [ icu ];
72 pcre = [ pcre ];
73 sqlite = [ sqlite ];
74 syslog = [ ];
75 systemd = [ systemd ];
76 yajl = [ yajl ];
77 zeroconf = [ avahi dbus ];
78 };
79
80 run = { features ? null }:
81 let
82 # Disable platform specific features if needed
83 # using libmad to decode mp3 files on darwin is causing a segfault -- there
84 # is probably a solution, but I'm disabling it for now
85 platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smbclient" ]
86 ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" "syslog" ];
87
88 knownFeatures = builtins.attrNames featureDependencies;
89 platformFeatures = lib.subtractLists platformMask knownFeatures;
90
91 features_ = if (features == null )
92 then platformFeatures
93 else
94 let unknown = lib.subtractLists knownFeatures features; in
95 if (unknown != [])
96 then throw "Unknown feature(s): ${lib.concatStringsSep " " unknown}"
97 else
98 let unsupported = lib.subtractLists platformFeatures features; in
99 if (unsupported != [])
100 then throw "Feature(s) ${lib.concatStringsSep " " unsupported} are not supported on ${stdenv.hostPlatform.system}"
101 else features;
102
103 in stdenv.mkDerivation rec {
104 pname = "mpd";
105 version = "0.21.21";
106
107 src = fetchFromGitHub {
108 owner = "MusicPlayerDaemon";
109 repo = "MPD";
110 rev = "v${version}";
111 sha256 = "0ysyjlmmfm1y5jqyv83bs9p7zqr9pgj1hmdq2b7kx9kridclbnng";
112 };
113
114 buildInputs = [ glib boost ]
115 ++ (lib.concatLists (lib.attrVals features_ featureDependencies))
116 ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.AudioUnit ];
117
118 nativeBuildInputs = [ meson ninja pkgconfig ];
119
120 enableParallelBuilding = true;
121
122 mesonAutoFeatures = "disabled";
123 mesonFlags =
124 map (x: "-D${x}=enabled") features_
125 ++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures)
126 ++ lib.optional (builtins.elem "zeroconf" features_)
127 "-Dzeroconf=avahi"
128 ++ lib.optional (builtins.elem "systemd" features_)
129 "-Dsystemd_system_unit_dir=etc/systemd/system";
130
131 meta = with stdenv.lib; {
132 description = "A flexible, powerful daemon for playing music";
133 homepage = "https://www.musicpd.org/";
134 license = licenses.gpl2;
135 maintainers = with maintainers; [ astsmtl ehmry fpletz tobim ];
136 platforms = platforms.unix;
137
138 longDescription = ''
139 Music Player Daemon (MPD) is a flexible, powerful daemon for playing
140 music. Through plugins and libraries it can play a variety of sound
141 files while being controlled by its network protocol.
142 '';
143 };
144 };
145in
146{
147 mpd = run { };
148 mpd-small = run { features = [
149 "webdav" "curl" "mms" "bzip2" "zzip"
150 "audiofile" "faad" "flac" "gme" "mad"
151 "mpg123" "opus" "vorbis" "vorbisenc"
152 "lame" "libsamplerate" "shout"
153 "libmpdclient" "id3tag" "expat" "pcre"
154 "yajl" "sqlite"
155 "soundcloud" "qobuz" "tidal"
156 ] ++ lib.optionals stdenv.isLinux [
157 "alsa" "systemd" "syslog"
158 ] ++ lib.optionals (!stdenv.isDarwin) [
159 "mad" "jack" "nfs"
160 ]; };
161 mpdWithFeatures = run;
162}
diff --git a/pkgs/mpd_0_21/default_old.nix b/pkgs/mpd_0_21/default_old.nix
deleted file mode 100644
index 129894d..0000000
--- a/pkgs/mpd_0_21/default_old.nix
+++ /dev/null
@@ -1,156 +0,0 @@
1{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, systemd, boost168, darwin
2, cmake, libupnp, sndio, chromaprint, soxr, libcdio, libcdio-paranoia, ao, libao
3, openal
4# Inputs
5, curl, libmms, libnfs, samba
6# Archive support
7, bzip2, zziplib
8# Codecs
9, audiofile, faad2, ffmpeg, flac, fluidsynth, game-music-emu
10, libmad, libmikmod, mpg123, libopus, libvorbis, lame
11# Filters
12, libsamplerate
13# Outputs
14, alsaLib, libjack2, libpulseaudio, libshout
15# Misc
16, icu, sqlite, avahi, dbus, pcre, libgcrypt, expat
17# Services
18, yajl
19# Client support
20, mpd_clientlib
21# Tag support
22, libid3tag
23}:
24
25let
26 major = "0.21";
27 minor = "7";
28
29 lib = stdenv.lib;
30 mkDisable = f: "-D${f}=disabled";
31 mkEnable = f: "-D${f}=enabled";
32 keys = lib.mapAttrsToList (k: v: k);
33
34 featureDependencies = {
35 # Storage plugins
36 udisks = [ dbus ];
37 webdav = [ curl expat ];
38 # Input plugins
39 curl = [ curl ];
40 mms = [ libmms ];
41 nfs = [ libnfs ];
42 smbclient = [ samba ];
43 # Archive support
44 bzip2 = [ bzip2 ];
45 zzip = [ zziplib ];
46 # Decoder plugins
47 audiofile = [ audiofile ];
48 faad = [ faad2 ];
49 ffmpeg = [ ffmpeg ];
50 flac = [ flac ];
51 fluidsynth = [ fluidsynth ];
52 gme = [ game-music-emu ];
53 mad = [ libmad ];
54 mikmod = [ libmikmod ];
55 mpg123 = [ mpg123 ];
56 opus = [ libopus ];
57 vorbis = [ libvorbis ];
58 # Encoder plugins
59 vorbisenc = [ libvorbis ];
60 lame = [ lame ];
61 # Filter plugins
62 libsamplerate = [ libsamplerate ];
63 # Output plugins
64 alsa = [ alsaLib ];
65 jack = [ libjack2 ];
66 pulse = [ libpulseaudio ];
67 shout = [ libshout ];
68 # Commercial services
69 qobuz = [ curl libgcrypt yajl ];
70 soundcloud = [ curl yajl ];
71 tidal = [ curl yajl ];
72 # Client support
73 libmpdclient = [ mpd_clientlib ];
74 # Tag support
75 id3tag = [ libid3tag ];
76 # Misc
77 dbus = [ dbus ];
78 expat = [ expat ];
79 icu = [ icu ];
80 pcre = [ pcre ];
81 sqlite = [ sqlite ];
82 systemd = [ systemd ];
83 yajl = [ yajl ];
84 zeroconf = [ avahi dbus ];
85 };
86
87 run = { features ? null }:
88 let
89 fl = if (features == null )
90 then keys featureDependencies
91 else features;
92
93 # Disable platform specific features if needed
94 # using libmad to decode mp3 files on darwin is causing a segfault -- there
95 # is probably a solution, but I'm disabling it for now
96 platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smb" ]
97 ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" ];
98 features_ = lib.subtractLists platformMask fl;
99
100 in stdenv.mkDerivation rec {
101 name = "mpd-${version}";
102 version = "${major}${if minor == "" then "" else "." + minor}";
103
104 src = fetchFromGitHub {
105 owner = "MusicPlayerDaemon";
106 repo = "MPD";
107 rev = "v${version}";
108 sha256 = "11zi8hmlj63ngzl06vzx05669k20j4cdsp0caz4p4ayn46fd4m17";
109 };
110
111 buildInputs = [ cmake glib boost168 sndio libupnp chromaprint soxr
112 libcdio libcdio-paranoia ao libao openal libvorbis
113 ]
114 ++ (lib.concatLists (lib.attrVals features_ featureDependencies))
115 ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AudioToolbox;
116
117 nativeBuildInputs = [ meson ninja pkgconfig ];
118
119 enableParallelBuilding = true;
120
121 mesonFlags =
122 map mkEnable features_ ++ map mkDisable (lib.subtractLists features_ (keys featureDependencies))
123 ++ [ "-Dsyslog=enabled" ]
124 ++ lib.optional (lib.any (x: x == "zeroconf") features_)
125 "-Dzeroconf=avahi"
126 ++ lib.optional stdenv.isLinux
127 "-Dsystemd_system_unit_dir=etc/systemd/system";
128
129 meta = with stdenv.lib; {
130 description = "A flexible, powerful daemon for playing music";
131 homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
132 license = licenses.gpl2;
133 maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ];
134 platforms = platforms.unix;
135
136 longDescription = ''
137 Music Player Daemon (MPD) is a flexible, powerful daemon for playing
138 music. Through plugins and libraries it can play a variety of sound
139 files while being controlled by its network protocol.
140 '';
141 };
142 };
143in
144{
145 mpd = run { };
146 mpd-small = run { features = [
147 "webdav" "curl" "mms" "nfs" "bzip2" "zzip"
148 "audiofile" "faad" "flac" "gme" "mad"
149 "mpg123" "opus" "vorbis"
150 "vorbisenc" "lame" "libsamplerate"
151 "alsa" "shout" "libmpdclient"
152 "id3tag" "expat" "pcre" "yajl" "sqlite"
153 "soundcloud" "qobuz" "tidal"
154 "systemd"
155 ]; };
156}