| 7 |
7 |
|
| 8 |
8 |
DESCRIPTION="The Music Player Daemon (mpd)"
|
| 9 |
9 |
HOMEPAGE="https://www.musicpd.org https://github.com/MusicPlayerDaemon/MPD"
|
| 10 |
|
SRC_URI="https://www.musicpd.org/download/${PN}/${PV%.*}/${P}.tar.xz"
|
| 11 |
|
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/mpd-0.23.15.16-fix-libfmt-11.1.0.patch.xz"
|
|
10 |
SRC_URI="https://www.musicpd.org/download/${PN}/$(ver_cut 1-2)/${P}.tar.xz"
|
| 12 |
11 |
|
| 13 |
12 |
LICENSE="GPL-2"
|
| 14 |
13 |
SLOT="0"
|
| 15 |
14 |
KEYWORDS="amd64 ~arm ~arm64 ppc ppc64 ~riscv x86"
|
| 16 |
|
IUSE="+alsa ao +audiofile bzip2 cdio chromaprint +cue +curl doc +dbus
|
| 17 |
|
+eventfd expat faad +ffmpeg +fifo flac fluidsynth gme +icu +id3tag +inotify +io-uring
|
| 18 |
|
jack lame libmpdclient libsamplerate libsoxr +mad mikmod mms
|
| 19 |
|
modplug mpg123 musepack +network nfs openal openmpt opus oss pipe pipewire pulseaudio qobuz
|
| 20 |
|
recorder samba selinux sid signalfd snapcast sndfile sndio soundcloud sqlite systemd
|
| 21 |
|
test twolame udisks vorbis wavpack webdav wildmidi upnp
|
| 22 |
|
yajl zeroconf zip zlib"
|
|
15 |
IUSE="+alsa ao +audiofile bzip2 cdio chromaprint +curl doc +dbus
|
|
16 |
+eventfd expat faad +ffmpeg flac fluidsynth gme httpd +icu +id3tag +inotify
|
|
17 |
+io-uring jack lame libmpdclient libsamplerate libsoxr +mad mikmod mms
|
|
18 |
modplug +mpg123 musepack nfs openal openmpt opus oss pipewire pulseaudio qobuz
|
|
19 |
recorder samba selinux shout sid signalfd snapcast sndfile sndio sqlite
|
|
20 |
systemd test tremor twolame upnp vorbis wavpack webdav wildmidi
|
|
21 |
zeroconf zip zlib"
|
| 23 |
22 |
|
| 24 |
|
OUTPUT_PLUGINS="alsa ao fifo jack network openal oss pipe pipewire pulseaudio snapcast sndio recorder"
|
|
23 |
OUTPUT_PLUGINS="alsa ao jack httpd openal oss pipewire pulseaudio shout snapcast sndio recorder"
|
| 25 |
24 |
DECODER_PLUGINS="audiofile faad ffmpeg flac fluidsynth mad mikmod
|
| 26 |
|
modplug mpg123 musepack opus openmpt flac sid vorbis wavpack wildmidi"
|
|
25 |
modplug mpg123 musepack opus openmpt flac sid tremor vorbis wavpack wildmidi"
|
| 27 |
26 |
ENCODER_PLUGINS="audiofile flac lame twolame vorbis"
|
| 28 |
27 |
|
| 29 |
28 |
REQUIRED_USE="
|
| 30 |
29 |
|| ( ${OUTPUT_PLUGINS} )
|
| 31 |
30 |
|| ( ${DECODER_PLUGINS} )
|
| 32 |
|
network? ( || ( ${ENCODER_PLUGINS} ) )
|
|
31 |
?? ( tremor vorbis )
|
|
32 |
httpd? ( || ( ${ENCODER_PLUGINS} ) )
|
| 33 |
33 |
recorder? ( || ( ${ENCODER_PLUGINS} ) )
|
| 34 |
|
qobuz? ( curl soundcloud )
|
| 35 |
|
snapcast? ( yajl )
|
| 36 |
|
soundcloud? ( curl qobuz yajl )
|
| 37 |
|
udisks? ( dbus )
|
|
34 |
shout? ( || ( ${ENCODER_PLUGINS} ) )
|
|
35 |
qobuz? ( curl )
|
| 38 |
36 |
upnp? ( curl expat )
|
| 39 |
37 |
webdav? ( curl expat )
|
| 40 |
38 |
"
|
| 41 |
39 |
|
| 42 |
40 |
RESTRICT="!test? ( test )"
|
| 43 |
41 |
|
|
42 |
COMMON_ENCODERS="
|
|
43 |
lame? ( media-sound/lame )
|
|
44 |
twolame? ( media-sound/twolame )
|
|
45 |
"
|
| 44 |
46 |
RDEPEND="
|
| 45 |
47 |
acct-user/mpd
|
| 46 |
48 |
dev-libs/libfmt:=
|
| 47 |
49 |
dev-libs/libpcre2:=
|
| 48 |
|
media-libs/libogg
|
| 49 |
50 |
alsa? (
|
| 50 |
51 |
media-libs/alsa-lib
|
| 51 |
52 |
media-sound/alsa-utils
|
| ... | ... | |
| 60 |
61 |
chromaprint? ( media-libs/chromaprint:= )
|
| 61 |
62 |
curl? ( net-misc/curl )
|
| 62 |
63 |
dbus? ( sys-apps/dbus )
|
| 63 |
|
doc? ( dev-python/sphinx )
|
|
64 |
doc? (
|
|
65 |
dev-python/sphinx
|
|
66 |
dev-python/sphinx-rtd-theme
|
|
67 |
)
|
| 64 |
68 |
expat? ( dev-libs/expat )
|
| 65 |
69 |
faad? ( media-libs/faad2 )
|
| 66 |
70 |
ffmpeg? ( media-video/ffmpeg:= )
|
| 67 |
71 |
flac? ( media-libs/flac:= )
|
| 68 |
72 |
fluidsynth? ( media-sound/fluidsynth:= )
|
| 69 |
|
gme? ( >=media-libs/game-music-emu-0.6.0_pre20120802 )
|
|
73 |
gme? ( media-libs/game-music-emu )
|
|
74 |
httpd? ( ${COMMON_ENCODERS} )
|
| 70 |
75 |
icu? (
|
| 71 |
|
>=dev-libs/icu-50:=
|
|
76 |
dev-libs/icu:=
|
| 72 |
77 |
virtual/libiconv
|
| 73 |
78 |
)
|
| 74 |
79 |
id3tag? ( media-libs/libid3tag:= )
|
| 75 |
80 |
io-uring? ( sys-libs/liburing:= )
|
| 76 |
81 |
jack? ( virtual/jack )
|
| 77 |
|
lame? ( network? ( media-sound/lame ) )
|
| 78 |
82 |
libmpdclient? ( media-libs/libmpdclient )
|
| 79 |
83 |
libsamplerate? ( media-libs/libsamplerate )
|
| 80 |
84 |
libsoxr? ( media-libs/soxr )
|
| ... | ... | |
| 84 |
88 |
modplug? ( media-libs/libmodplug )
|
| 85 |
89 |
mpg123? ( media-sound/mpg123-base )
|
| 86 |
90 |
musepack? ( media-sound/musepack-tools )
|
| 87 |
|
network? ( >=media-libs/libshout-2.4.0 )
|
| 88 |
91 |
nfs? ( net-fs/libnfs:= )
|
| 89 |
92 |
openal? ( media-libs/openal )
|
| 90 |
93 |
openmpt? ( media-libs/libopenmpt )
|
| 91 |
|
opus? ( media-libs/opus )
|
|
94 |
opus? (
|
|
95 |
media-libs/libogg
|
|
96 |
media-libs/opus
|
|
97 |
)
|
| 92 |
98 |
pulseaudio? ( media-libs/libpulse )
|
| 93 |
99 |
pipewire? ( media-video/pipewire:= )
|
| 94 |
100 |
qobuz? (
|
| 95 |
|
|| (
|
| 96 |
|
dev-libs/libgcrypt
|
| 97 |
|
media-video/ffmpeg
|
| 98 |
|
)
|
|
101 |
!ffmpeg? ( dev-libs/libgcrypt:= )
|
|
102 |
ffmpeg? ( media-video/ffmpeg )
|
| 99 |
103 |
)
|
|
104 |
recorder? ( ${COMMON_ENCODERS} )
|
| 100 |
105 |
samba? ( net-fs/samba:= )
|
| 101 |
106 |
selinux? ( sec-policy/selinux-mpd )
|
| 102 |
|
sid? ( || (
|
| 103 |
|
media-libs/libsidplay:2
|
| 104 |
|
media-libs/libsidplayfp
|
| 105 |
|
) )
|
| 106 |
|
snapcast? ( media-sound/snapcast )
|
|
107 |
shout? (
|
|
108 |
${COMMON_ENCODERS}
|
|
109 |
media-libs/libshout
|
|
110 |
)
|
|
111 |
sid? ( media-libs/libsidplayfp:= )
|
| 107 |
112 |
sndfile? ( media-libs/libsndfile )
|
| 108 |
113 |
sndio? ( media-sound/sndio:= )
|
| 109 |
114 |
sqlite? ( dev-db/sqlite:3 )
|
| 110 |
115 |
systemd? ( sys-apps/systemd:= )
|
| 111 |
|
twolame? ( media-sound/twolame )
|
| 112 |
|
udisks? ( sys-fs/udisks:2 )
|
|
116 |
tremor? (
|
|
117 |
media-libs/libogg
|
|
118 |
media-libs/tremor
|
|
119 |
)
|
| 113 |
120 |
upnp? ( net-libs/libupnp:= )
|
| 114 |
|
vorbis? ( media-libs/libvorbis )
|
|
121 |
vorbis? (
|
|
122 |
media-libs/libogg
|
|
123 |
media-libs/libvorbis
|
|
124 |
)
|
| 115 |
125 |
wavpack? ( media-sound/wavpack )
|
| 116 |
126 |
wildmidi? ( media-sound/wildmidi )
|
| 117 |
|
yajl? ( >=dev-libs/yajl-2:= )
|
| 118 |
127 |
zeroconf? ( net-dns/avahi[dbus] )
|
| 119 |
128 |
zip? ( dev-libs/zziplib:= )
|
| 120 |
129 |
zlib? ( virtual/zlib:= )
|
| 121 |
130 |
"
|
| 122 |
|
|
| 123 |
131 |
DEPEND="
|
| 124 |
132 |
${RDEPEND}
|
| 125 |
|
dev-libs/boost:=
|
|
133 |
qobuz? ( >=dev-cpp/nlohmann_json-3.11.3 )
|
|
134 |
snapcast? ( >=dev-cpp/nlohmann_json-3.11.3 )
|
| 126 |
135 |
test? ( dev-cpp/gtest )
|
| 127 |
136 |
"
|
| 128 |
|
|
| 129 |
137 |
BDEPEND="virtual/pkgconfig"
|
| 130 |
138 |
|
| 131 |
|
PATCHES=(
|
| 132 |
|
"${WORKDIR}"/mpd-0.23.15.16-fix-libfmt-11.1.0.patch
|
| 133 |
|
)
|
| 134 |
|
|
| 135 |
139 |
pkg_setup() {
|
| 136 |
140 |
if use eventfd; then
|
| 137 |
141 |
CONFIG_CHECK+=" ~EVENTFD"
|
| ... | ... | |
| 168 |
172 |
$(meson_feature bzip2)
|
| 169 |
173 |
$(meson_feature cdio cdio_paranoia)
|
| 170 |
174 |
$(meson_feature chromaprint)
|
| 171 |
|
$(meson_use cue)
|
|
175 |
-Dcue=true
|
| 172 |
176 |
$(meson_feature curl)
|
| 173 |
177 |
$(meson_feature dbus)
|
| 174 |
178 |
$(meson_use eventfd)
|
| 175 |
179 |
$(meson_feature expat)
|
| 176 |
180 |
$(meson_feature faad)
|
| 177 |
181 |
$(meson_feature ffmpeg)
|
| 178 |
|
$(meson_use fifo)
|
|
182 |
-Dfifo=true
|
| 179 |
183 |
$(meson_feature flac)
|
| 180 |
184 |
$(meson_feature fluidsynth)
|
| 181 |
185 |
$(meson_feature gme)
|
|
186 |
$(meson_use httpd )
|
| 182 |
187 |
$(meson_feature icu)
|
| 183 |
188 |
$(meson_feature id3tag)
|
| 184 |
189 |
$(meson_use inotify)
|
| ... | ... | |
| 199 |
204 |
$(meson_feature openmpt)
|
| 200 |
205 |
$(meson_feature opus)
|
| 201 |
206 |
$(meson_feature oss)
|
| 202 |
|
$(meson_use pipe)
|
|
207 |
-Dpipe=true
|
| 203 |
208 |
$(meson_feature pipewire)
|
| 204 |
209 |
$(meson_feature pulseaudio pulse)
|
| 205 |
210 |
$(meson_feature qobuz)
|
| 206 |
211 |
$(meson_use recorder)
|
|
212 |
$(meson_feature shout)
|
| 207 |
213 |
$(meson_use signalfd)
|
| 208 |
214 |
$(meson_feature samba smbclient)
|
| 209 |
215 |
$(meson_use snapcast)
|
| 210 |
216 |
$(meson_feature sid sidplay)
|
| 211 |
217 |
$(meson_feature sndfile)
|
| 212 |
218 |
$(meson_feature sndio)
|
| 213 |
|
$(meson_feature soundcloud)
|
| 214 |
219 |
$(meson_feature libsoxr soxr)
|
| 215 |
220 |
$(meson_feature sqlite)
|
| 216 |
221 |
$(meson_feature systemd)
|
| 217 |
222 |
$(meson_use test)
|
| 218 |
|
$(meson_feature udisks)
|
|
223 |
$(meson_feature dbus udisks)
|
| 219 |
224 |
-Dupnp=$(usex upnp pupnp disabled)
|
|
225 |
$(meson_feature tremor)
|
| 220 |
226 |
$(meson_feature vorbis)
|
| 221 |
227 |
$(meson_feature wavpack)
|
| 222 |
228 |
$(meson_feature wildmidi)
|
| 223 |
229 |
$(meson_feature webdav)
|
| 224 |
|
$(meson_feature yajl)
|
| 225 |
230 |
-Dzeroconf=$(usex zeroconf avahi disabled)
|
| 226 |
231 |
$(meson_feature zlib)
|
| 227 |
232 |
$(meson_feature zip zzip)
|
| ... | ... | |
| 246 |
251 |
fi
|
| 247 |
252 |
|
| 248 |
253 |
append-lfs-flags
|
| 249 |
|
append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/sidplay/builders"
|
| 250 |
254 |
|
| 251 |
|
if use network; then
|
|
255 |
# set useflag for encoders
|
|
256 |
if use httpd || use shout || use recorder; then
|
| 252 |
257 |
emesonargs+=(
|
|
258 |
# not in tree
|
| 253 |
259 |
-Dshine=disabled
|
| 254 |
|
-Dshout=enabled
|
| 255 |
|
$(meson_feature vorbis vorbisenc)
|
| 256 |
|
-Dhttpd=true
|
| 257 |
260 |
$(meson_feature lame)
|
| 258 |
261 |
$(meson_feature twolame)
|
|
262 |
$(meson_feature vorbis vorbisenc)
|
| 259 |
263 |
$(meson_use audiofile wave_encoder)
|
| 260 |
264 |
)
|
|
265 |
else
|
|
266 |
# avoid links even w/o encoder
|
|
267 |
emesonargs+=(
|
|
268 |
-Dlame=disabled
|
|
269 |
-Dtwolame=disabled
|
|
270 |
)
|
|
271 |
fi
|
|
272 |
|
|
273 |
# nlohmann_json is only required with these plugins enabled
|
|
274 |
if use qobuz || use snapcast; then
|
|
275 |
emesonargs+=(
|
|
276 |
-Dnlohmann_json=enabled
|
|
277 |
)
|
| 261 |
278 |
fi
|
| 262 |
279 |
|
| 263 |
280 |
meson_src_configure
|
| 264 |
281 |
}
|
| 265 |
282 |
|
| 266 |
283 |
src_install() {
|
|
284 |
if use doc; then
|
|
285 |
local HTML_DOCS=( "${BUILD_DIR}"/doc/html/. )
|
|
286 |
else
|
|
287 |
newman "${FILESDIR}"/${PN}.1-0.24.2 ${PN}.1
|
|
288 |
newman "${FILESDIR}"/${PN}.conf.5-0.24.2 ${PN}.conf.5
|
|
289 |
fi
|
|
290 |
|
| 267 |
291 |
meson_src_install
|
| 268 |
292 |
|
| 269 |
293 |
insinto /etc
|
| ... | ... | |
| 279 |
303 |
# Extra options for running MPD under OpenRC
|
| 280 |
304 |
# (options that should not be set when using systemd)
|
| 281 |
305 |
sed -i \
|
| 282 |
|
-e 's:^#log_file.*$:log_file "/var/log/mpd/mpd.log":' \
|
| 283 |
|
-e 's:^#pid_file.*$:pid_file "/run/mpd/mpd.pid":' \
|
|
306 |
-e '0,/^#log_file.*$/s::log_file "/var/log/mpd/mpd.log"\n&:' \
|
|
307 |
-e '0,/^#pid_file.*$/s::pid_file "/run/mpd/mpd.pid"\n&:' \
|
| 284 |
308 |
"${ED}/etc/mpd.conf" || die
|
| 285 |
309 |
fi
|
| 286 |
310 |
|
| 287 |
311 |
insinto /etc/logrotate.d
|
| 288 |
312 |
newins "${FILESDIR}/${PN}-0.23.15.logrotate" "${PN}"
|
| 289 |
313 |
|
| 290 |
|
newinitd "${FILESDIR}/${PN}-0.23.15.init-r1" "${PN}"
|
|
314 |
newinitd "${FILESDIR}/${PN}-0.24.2.init" "${PN}"
|
| 291 |
315 |
|
| 292 |
316 |
keepdir /var/lib/mpd
|
| 293 |
317 |
keepdir /var/lib/mpd/music
|