1################################################################################
2#
3# mpd
4#
5################################################################################
6
7MPD_VERSION_MAJOR = 0.23
8MPD_VERSION = $(MPD_VERSION_MAJOR).15
9MPD_SOURCE = mpd-$(MPD_VERSION).tar.xz
10MPD_SITE = https://www.musicpd.org/download/mpd/$(MPD_VERSION_MAJOR)
11MPD_DEPENDENCIES = host-pkgconf boost fmt
12MPD_LICENSE = GPL-2.0+
13MPD_LICENSE_FILES = COPYING
14# these refer to the FreeBSD PPP daemon
15MPD_IGNORE_CVES = CVE-2020-7465 CVE-2020-7466
16MPD_SELINUX_MODULES = mpd
17MPD_CONF_OPTS = \
18	-Daudiofile=disabled \
19	-Ddocumentation=disabled \
20	-Dopenmpt=disabled \
21	-Dpipewire=disabled \
22	-Dsnapcast=false
23
24# Zeroconf support depends on libdns_sd from avahi.
25ifeq ($(BR2_PACKAGE_MPD_AVAHI_SUPPORT),y)
26MPD_DEPENDENCIES += avahi
27MPD_CONF_OPTS += -Dzeroconf=avahi
28else
29MPD_CONF_OPTS += -Dzeroconf=disabled
30endif
31
32ifeq ($(BR2_PACKAGE_EXPAT),y)
33MPD_DEPENDENCIES += expat
34MPD_CONF_OPTS += -Dexpat=enabled
35else
36MPD_CONF_OPTS += -Dexpat=disabled
37endif
38
39# MPD prefers libicu for utf8 collation instead of libglib2.
40ifeq ($(BR2_PACKAGE_ICU),y)
41MPD_DEPENDENCIES += icu
42MPD_CONF_OPTS += -Dicu=enabled
43else
44MPD_CONF_OPTS += -Dicu=disabled
45endif
46
47ifeq ($(BR2_PACKAGE_YAJL),y)
48MPD_DEPENDENCIES += yajl
49MPD_CONF_OPTS += -Dyajl=enabled
50else
51MPD_CONF_OPTS += -Dyajl=disabled
52endif
53
54ifeq ($(BR2_PACKAGE_MPD_ALSA),y)
55MPD_DEPENDENCIES += alsa-lib
56MPD_CONF_OPTS += -Dalsa=enabled
57else
58MPD_CONF_OPTS += -Dalsa=disabled
59endif
60
61ifeq ($(BR2_PACKAGE_MPD_AO),y)
62MPD_DEPENDENCIES += libao
63MPD_CONF_OPTS += -Dao=enabled
64else
65MPD_CONF_OPTS += -Dao=disabled
66endif
67
68ifeq ($(BR2_PACKAGE_MPD_BZIP2),y)
69MPD_DEPENDENCIES += bzip2
70MPD_CONF_OPTS += -Dbzip2=enabled
71else
72MPD_CONF_OPTS += -Dbzip2=disabled
73endif
74
75ifeq ($(BR2_PACKAGE_MPD_CDIO_PARANOIA),y)
76MPD_DEPENDENCIES += libcdio-paranoia
77MPD_CONF_OPTS += -Dcdio_paranoia=enabled
78else
79MPD_CONF_OPTS += -Dcdio_paranoia=disabled
80endif
81
82ifeq ($(BR2_PACKAGE_MPD_CURL),y)
83MPD_DEPENDENCIES += libcurl
84MPD_CONF_OPTS += -Dcurl=enabled
85else
86MPD_CONF_OPTS += -Dcurl=disabled
87endif
88
89ifeq ($(BR2_PACKAGE_MPD_DSD),y)
90MPD_CONF_OPTS += -Ddsd=true
91else
92MPD_CONF_OPTS += -Ddsd=false
93endif
94
95ifeq ($(BR2_PACKAGE_MPD_FAAD2),y)
96MPD_DEPENDENCIES += faad2
97MPD_CONF_OPTS += -Dfaad=enabled
98else
99MPD_CONF_OPTS += -Dfaad=disabled
100endif
101
102ifeq ($(BR2_PACKAGE_MPD_FFMPEG),y)
103MPD_DEPENDENCIES += ffmpeg
104MPD_CONF_OPTS += -Dffmpeg=enabled
105else
106MPD_CONF_OPTS += -Dffmpeg=disabled
107endif
108
109ifeq ($(BR2_PACKAGE_MPD_FLAC),y)
110MPD_DEPENDENCIES += flac
111MPD_CONF_OPTS += -Dflac=enabled
112else
113MPD_CONF_OPTS += -Dflac=disabled
114endif
115
116ifeq ($(BR2_PACKAGE_MPD_FLUIDSYNTH),y)
117MPD_DEPENDENCIES += fluidsynth
118MPD_CONF_OPTS += -Dfluidsynth=enabled
119else
120MPD_CONF_OPTS += -Dfluidsynth=disabled
121endif
122
123ifeq ($(BR2_PACKAGE_MPD_HTTPD_OUTPUT),y)
124MPD_CONF_OPTS += -Dhttpd=true
125else
126MPD_CONF_OPTS += -Dhttpd=false
127endif
128
129ifeq ($(BR2_PACKAGE_MPD_ID3TAG),y)
130MPD_DEPENDENCIES += libid3tag
131MPD_CONF_OPTS += -Did3tag=enabled
132else
133MPD_CONF_OPTS += -Did3tag=disabled
134endif
135
136ifeq ($(BR2_PACKAGE_MPD_IO_URING),y)
137MPD_DEPENDENCIES += liburing
138MPD_CONF_OPTS += -Dio_uring=enabled
139else
140MPD_CONF_OPTS += -Dio_uring=disabled
141endif
142
143ifeq ($(BR2_PACKAGE_MPD_JACK2),y)
144MPD_DEPENDENCIES += jack2
145MPD_CONF_OPTS += -Djack=enabled
146else
147MPD_CONF_OPTS += -Djack=disabled
148endif
149
150ifeq ($(BR2_PACKAGE_MPD_LAME),y)
151MPD_DEPENDENCIES += lame
152MPD_CONF_OPTS += -Dlame=enabled
153else
154MPD_CONF_OPTS += -Dlame=disabled
155endif
156
157ifeq ($(BR2_PACKAGE_MPD_LIBMPDCLIENT),y)
158MPD_DEPENDENCIES += libmpdclient
159MPD_CONF_OPTS += -Dlibmpdclient=enabled
160else
161MPD_CONF_OPTS += -Dlibmpdclient=disabled
162endif
163
164ifeq ($(BR2_PACKAGE_MPD_LIBMMS),y)
165MPD_DEPENDENCIES += libmms
166MPD_CONF_OPTS += -Dmms=enabled
167else
168MPD_CONF_OPTS += -Dmms=disabled
169endif
170
171ifeq ($(BR2_PACKAGE_MPD_LIBNFS),y)
172MPD_DEPENDENCIES += libnfs
173MPD_CONF_OPTS += -Dnfs=enabled
174else
175MPD_CONF_OPTS += -Dnfs=disabled
176endif
177
178ifeq ($(BR2_PACKAGE_MPD_LIBSMBCLIENT),y)
179MPD_DEPENDENCIES += samba4
180MPD_CONF_OPTS += -Dsmbclient=enabled
181else
182MPD_CONF_OPTS += -Dsmbclient=disabled
183endif
184
185ifeq ($(BR2_PACKAGE_MPD_LIBSAMPLERATE),y)
186MPD_DEPENDENCIES += libsamplerate
187MPD_CONF_OPTS += -Dlibsamplerate=enabled
188else
189MPD_CONF_OPTS += -Dlibsamplerate=disabled
190endif
191
192ifeq ($(BR2_PACKAGE_MPD_LIBSNDFILE),y)
193MPD_DEPENDENCIES += libsndfile
194MPD_CONF_OPTS += -Dsndfile=enabled
195else
196MPD_CONF_OPTS += -Dsndfile=disabled
197endif
198
199ifeq ($(BR2_PACKAGE_MPD_LIBSOXR),y)
200MPD_DEPENDENCIES += libsoxr
201MPD_CONF_OPTS += -Dsoxr=enabled
202else
203MPD_CONF_OPTS += -Dsoxr=disabled
204endif
205
206ifeq ($(BR2_PACKAGE_MPD_MAD),y)
207MPD_DEPENDENCIES += libmad
208MPD_CONF_OPTS += -Dmad=enabled
209else
210MPD_CONF_OPTS += -Dmad=disabled
211endif
212
213ifeq ($(BR2_PACKAGE_MPD_MODPLUG),y)
214MPD_DEPENDENCIES += libmodplug
215MPD_CONF_OPTS += -Dmodplug=enabled
216else
217MPD_CONF_OPTS += -Dmodplug=disabled
218endif
219
220ifeq ($(BR2_PACKAGE_MPD_MPG123),y)
221MPD_DEPENDENCIES += mpg123
222MPD_CONF_OPTS += -Dmpg123=enabled
223else
224MPD_CONF_OPTS += -Dmpg123=disabled
225endif
226
227ifeq ($(BR2_PACKAGE_MPD_MUSEPACK),y)
228MPD_DEPENDENCIES += musepack
229MPD_CONF_OPTS += -Dmpcdec=enabled
230else
231MPD_CONF_OPTS += -Dmpcdec=disabled
232endif
233
234ifeq ($(BR2_PACKAGE_MPD_NEIGHBOR_DISCOVERY_SUPPORT),y)
235MPD_CONF_OPTS += -Dneighbor=true
236else
237MPD_CONF_OPTS += -Dneighbor=false
238endif
239
240ifeq ($(BR2_PACKAGE_MPD_OPENAL),y)
241MPD_DEPENDENCIES += openal
242MPD_CONF_OPTS += -Dopenal=enabled
243else
244MPD_CONF_OPTS += -Dopenal=disabled
245endif
246
247ifeq ($(BR2_PACKAGE_MPD_OPUS),y)
248MPD_DEPENDENCIES += opus libogg
249MPD_CONF_OPTS += -Dopus=enabled
250else
251MPD_CONF_OPTS += -Dopus=disabled
252endif
253
254ifeq ($(BR2_PACKAGE_MPD_OSS),y)
255MPD_CONF_OPTS += -Doss=enabled
256else
257MPD_CONF_OPTS += -Doss=disabled
258endif
259
260ifeq ($(BR2_PACKAGE_MPD_PULSEAUDIO),y)
261MPD_DEPENDENCIES += pulseaudio
262MPD_CONF_OPTS += -Dpulse=enabled
263else
264MPD_CONF_OPTS += -Dpulse=disabled
265endif
266
267ifeq ($(BR2_PACKAGE_MPD_QOBUZ),y)
268MPD_DEPENDENCIES += libgcrypt
269MPD_CONF_OPTS += -Dqobuz=enabled
270else
271MPD_CONF_OPTS += -Dqobuz=disabled
272endif
273
274ifeq ($(BR2_PACKAGE_MPD_SHOUTCAST),y)
275MPD_DEPENDENCIES += libshout
276MPD_CONF_OPTS += -Dshout=enabled
277else
278MPD_CONF_OPTS += -Dshout=disabled
279endif
280
281ifeq ($(BR2_PACKAGE_MPD_SIDPLAY),y)
282MPD_DEPENDENCIES += libsidplay2
283MPD_CONF_OPTS += -Dsidplay=enabled
284else
285MPD_CONF_OPTS += -Dsidplay=disabled
286endif
287
288ifeq ($(BR2_PACKAGE_MPD_SOUNDCLOUD),y)
289MPD_CONF_OPTS += -Dsoundcloud=enabled
290else
291MPD_CONF_OPTS += -Dsoundcloud=disabled
292endif
293
294ifeq ($(BR2_PACKAGE_MPD_SQLITE),y)
295MPD_DEPENDENCIES += sqlite
296MPD_CONF_OPTS += -Dsqlite=enabled
297else
298MPD_CONF_OPTS += -Dsqlite=disabled
299endif
300
301ifeq ($(BR2_PACKAGE_MPD_TCP),y)
302MPD_CONF_OPTS += -Dtcp=true
303else
304MPD_CONF_OPTS += -Dtcp=false
305endif
306
307ifeq ($(BR2_PACKAGE_MPD_TREMOR),y)
308MPD_DEPENDENCIES += tremor
309MPD_CONF_OPTS += -Dtremor=enabled
310else
311MPD_CONF_OPTS += -Dtremor=disabled
312endif
313
314ifeq ($(BR2_PACKAGE_MPD_TWOLAME),y)
315MPD_DEPENDENCIES += twolame
316MPD_CONF_OPTS += -Dtwolame=enabled
317else
318MPD_CONF_OPTS += -Dtwolame=disabled
319endif
320
321ifeq ($(BR2_PACKAGE_MPD_UPNP_PUPNP),y)
322MPD_DEPENDENCIES += \
323	libupnp
324MPD_CONF_OPTS += -Dupnp=pupnp
325else ifeq ($(BR2_PACKAGE_MPD_UPNP_NPUPNP),y)
326MPD_DEPENDENCIES += \
327	libnpupnp
328MPD_CONF_OPTS += -Dupnp=npupnp
329else ifeq ($(BR2_PACKAGE_MPD_UPNP_DISABLED),y)
330MPD_CONF_OPTS += -Dupnp=disabled
331endif
332
333ifeq ($(BR2_PACKAGE_MPD_VORBIS),y)
334MPD_DEPENDENCIES += libvorbis
335MPD_CONF_OPTS += -Dvorbis=enabled -Dvorbisenc=enabled
336else
337MPD_CONF_OPTS += -Dvorbis=disabled -Dvorbisenc=disabled
338endif
339
340ifeq ($(BR2_PACKAGE_MPD_WAVPACK),y)
341MPD_DEPENDENCIES += wavpack
342MPD_CONF_OPTS += -Dwavpack=enabled
343else
344MPD_CONF_OPTS += -Dwavpack=disabled
345endif
346
347ifeq ($(BR2_PACKAGE_MPD_ZZIP),y)
348MPD_DEPENDENCIES += zziplib
349MPD_CONF_OPTS += -Dzzip=enabled
350else
351MPD_CONF_OPTS += -Dzzip=disabled
352endif
353
354define MPD_INSTALL_EXTRA_FILES
355	$(INSTALL) -m 0644 -D package/mpd/mpd.conf $(TARGET_DIR)/etc/mpd.conf
356	mkdir -p $(TARGET_DIR)/var/lib/mpd/music
357	mkdir -p $(TARGET_DIR)/var/lib/mpd/playlists
358endef
359
360MPD_POST_INSTALL_TARGET_HOOKS += MPD_INSTALL_EXTRA_FILES
361
362define MPD_INSTALL_INIT_SYSV
363	$(INSTALL) -m 0755 -D package/mpd/S95mpd \
364		$(TARGET_DIR)/etc/init.d/S95mpd
365endef
366
367$(eval $(meson-package))
368