diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-03-25 11:57:48 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-03 16:25:07 +0200 |
commit | 5400b9b6f65451d41a9106fae6fc00f97d83f4ef (patch) | |
tree | 6ed072da7b1f17ac3994ffea052aa0c0822f8446 /pkgs/mpd_0_21 | |
parent | 441da8aac378f401625e82caf281fa0e26128310 (diff) | |
download | Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.tar.gz Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.tar.zst Nix-5400b9b6f65451d41a9106fae6fc00f97d83f4ef.zip |
Upgrade nixos
Diffstat (limited to 'pkgs/mpd_0_21')
-rw-r--r-- | pkgs/mpd_0_21/default.nix | 68 | ||||
-rw-r--r-- | pkgs/mpd_0_21/default_old.nix | 156 |
2 files changed, 195 insertions, 29 deletions
diff --git a/pkgs/mpd_0_21/default.nix b/pkgs/mpd_0_21/default.nix index f19a76f..4f97e3f 100644 --- a/pkgs/mpd_0_21/default.nix +++ b/pkgs/mpd_0_21/default.nix | |||
@@ -21,13 +21,7 @@ | |||
21 | }: | 21 | }: |
22 | 22 | ||
23 | let | 23 | let |
24 | major = "0.21"; | ||
25 | minor = "7"; | ||
26 | |||
27 | lib = stdenv.lib; | 24 | lib = stdenv.lib; |
28 | mkDisable = f: "-D${f}=disabled"; | ||
29 | mkEnable = f: "-D${f}=enabled"; | ||
30 | keys = lib.mapAttrsToList (k: v: k); | ||
31 | 25 | ||
32 | featureDependencies = { | 26 | featureDependencies = { |
33 | # Storage plugins | 27 | # Storage plugins |
@@ -77,6 +71,7 @@ let | |||
77 | icu = [ icu ]; | 71 | icu = [ icu ]; |
78 | pcre = [ pcre ]; | 72 | pcre = [ pcre ]; |
79 | sqlite = [ sqlite ]; | 73 | sqlite = [ sqlite ]; |
74 | syslog = [ ]; | ||
80 | systemd = [ systemd ]; | 75 | systemd = [ systemd ]; |
81 | yajl = [ yajl ]; | 76 | yajl = [ yajl ]; |
82 | zeroconf = [ avahi dbus ]; | 77 | zeroconf = [ avahi dbus ]; |
@@ -84,49 +79,60 @@ let | |||
84 | 79 | ||
85 | run = { features ? null }: | 80 | run = { features ? null }: |
86 | let | 81 | let |
87 | fl = if (features == null ) | ||
88 | then keys featureDependencies | ||
89 | else features; | ||
90 | |||
91 | # Disable platform specific features if needed | 82 | # Disable platform specific features if needed |
92 | # using libmad to decode mp3 files on darwin is causing a segfault -- there | 83 | # using libmad to decode mp3 files on darwin is causing a segfault -- there |
93 | # is probably a solution, but I'm disabling it for now | 84 | # is probably a solution, but I'm disabling it for now |
94 | platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smb" ] | 85 | platformMask = lib.optionals stdenv.isDarwin [ "mad" "pulse" "jack" "nfs" "smbclient" ] |
95 | ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" ]; | 86 | ++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" "syslog" ]; |
96 | features_ = lib.subtractLists platformMask fl; | 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; | ||
97 | 102 | ||
98 | in stdenv.mkDerivation rec { | 103 | in stdenv.mkDerivation rec { |
99 | name = "mpd-${version}"; | 104 | pname = "mpd"; |
100 | version = "${major}${if minor == "" then "" else "." + minor}"; | 105 | version = "0.21.21"; |
101 | 106 | ||
102 | src = fetchFromGitHub { | 107 | src = fetchFromGitHub { |
103 | owner = "MusicPlayerDaemon"; | 108 | owner = "MusicPlayerDaemon"; |
104 | repo = "MPD"; | 109 | repo = "MPD"; |
105 | rev = "v${version}"; | 110 | rev = "v${version}"; |
106 | sha256 = "11zi8hmlj63ngzl06vzx05669k20j4cdsp0caz4p4ayn46fd4m17"; | 111 | sha256 = "0ysyjlmmfm1y5jqyv83bs9p7zqr9pgj1hmdq2b7kx9kridclbnng"; |
107 | }; | 112 | }; |
108 | 113 | ||
109 | buildInputs = [ glib boost ] | 114 | buildInputs = [ glib boost ] |
110 | ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) | 115 | ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) |
111 | ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AudioToolbox; | 116 | ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.AudioUnit ]; |
112 | 117 | ||
113 | nativeBuildInputs = [ meson ninja pkgconfig ]; | 118 | nativeBuildInputs = [ meson ninja pkgconfig ]; |
114 | 119 | ||
115 | enableParallelBuilding = true; | 120 | enableParallelBuilding = true; |
116 | 121 | ||
122 | mesonAutoFeatures = "disabled"; | ||
117 | mesonFlags = | 123 | mesonFlags = |
118 | map mkEnable features_ ++ map mkDisable (lib.subtractLists features_ (keys featureDependencies)) | 124 | map (x: "-D${x}=enabled") features_ |
119 | ++ [ "-Dsyslog=enabled" ] | 125 | ++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures) |
120 | ++ lib.optional (lib.any (x: x == "zeroconf") features_) | 126 | ++ lib.optional (builtins.elem "zeroconf" features_) |
121 | "-Dzeroconf=avahi" | 127 | "-Dzeroconf=avahi" |
122 | ++ lib.optional stdenv.isLinux | 128 | ++ lib.optional (builtins.elem "systemd" features_) |
123 | "-Dsystemd_system_unit_dir=etc/systemd/system"; | 129 | "-Dsystemd_system_unit_dir=etc/systemd/system"; |
124 | 130 | ||
125 | meta = with stdenv.lib; { | 131 | meta = with stdenv.lib; { |
126 | description = "A flexible, powerful daemon for playing music"; | 132 | description = "A flexible, powerful daemon for playing music"; |
127 | homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki; | 133 | homepage = "https://www.musicpd.org/"; |
128 | license = licenses.gpl2; | 134 | license = licenses.gpl2; |
129 | maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ]; | 135 | maintainers = with maintainers; [ astsmtl ehmry fpletz tobim ]; |
130 | platforms = platforms.unix; | 136 | platforms = platforms.unix; |
131 | 137 | ||
132 | longDescription = '' | 138 | longDescription = '' |
@@ -140,13 +146,17 @@ in | |||
140 | { | 146 | { |
141 | mpd = run { }; | 147 | mpd = run { }; |
142 | mpd-small = run { features = [ | 148 | mpd-small = run { features = [ |
143 | "webdav" "curl" "mms" "nfs" "bzip2" "zzip" | 149 | "webdav" "curl" "mms" "bzip2" "zzip" |
144 | "audiofile" "faad" "flac" "gme" "mad" | 150 | "audiofile" "faad" "flac" "gme" "mad" |
145 | "mpg123" "opus" "vorbis" | 151 | "mpg123" "opus" "vorbis" "vorbisenc" |
146 | "vorbisenc" "lame" "libsamplerate" | 152 | "lame" "libsamplerate" "shout" |
147 | "alsa" "shout" "libmpdclient" | 153 | "libmpdclient" "id3tag" "expat" "pcre" |
148 | "id3tag" "expat" "pcre" "yajl" "sqlite" | 154 | "yajl" "sqlite" |
149 | "soundcloud" "qobuz" "tidal" | 155 | "soundcloud" "qobuz" "tidal" |
150 | "systemd" | 156 | ] ++ lib.optionals stdenv.isLinux [ |
157 | "alsa" "systemd" "syslog" | ||
158 | ] ++ lib.optionals (!stdenv.isDarwin) [ | ||
159 | "mad" "jack" "nfs" | ||
151 | ]; }; | 160 | ]; }; |
161 | mpdWithFeatures = run; | ||
152 | } | 162 | } |
diff --git a/pkgs/mpd_0_21/default_old.nix b/pkgs/mpd_0_21/default_old.nix new file mode 100644 index 0000000..129894d --- /dev/null +++ b/pkgs/mpd_0_21/default_old.nix | |||
@@ -0,0 +1,156 @@ | |||
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 | |||
25 | let | ||
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 | }; | ||
143 | in | ||
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 | } | ||