blob: 0c309ded0088e864342e55f817706aee3603c13c [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "Music Player Daemon"
2LICENSE = "GPL-2.0-only"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4
5HOMEPAGE ="http://www.musicpd.org"
6
7inherit meson useradd systemd pkgconfig
8
9DEPENDS += " \
10 curl \
11 sqlite3 \
12 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
13 yajl \
14 boost \
15 icu \
16 dbus \
17 expat \
18 fmt \
19"
20
Patrick Williamse760df82023-05-26 11:10:49 -050021SRC_URI = "git://github.com/MusicPlayerDaemon/MPD;branch=master;protocol=https \
Patrick Williams92b42cb2022-09-03 06:53:57 -050022 file://mpd.conf.in \
Patrick Williamse760df82023-05-26 11:10:49 -050023 file://minor-fixup-for-libfmt10.patch \
24 file://fix-build-error-when-fmt-updated.patch \
25 file://0001-SndfileDecoderPlugin-Fix-type-mismatch-for-std-span.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050026 "
Patrick Williamse760df82023-05-26 11:10:49 -050027SRCREV = "b1422fbda40a1831d397fb161e7a555443c2a072"
Patrick Williams92b42cb2022-09-03 06:53:57 -050028S = "${WORKDIR}/git"
29
30EXTRA_OEMESON += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-Dsystemd=enabled -Dsystemd_system_unit_dir=${systemd_system_unitdir} -Dsystemd_user_unit_dir=${systemd_system_unitdir}', '-Dsystemd=disabled', d)}"
31
32PACKAGECONFIG ??= "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "aac", "", d)} \
33 alsa ao bzip2 daemon \
34 ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "ffmpeg aac", "", d)} \
35 fifo flac fluidsynth iso9660 \
36 jack libsamplerate httpd \
37 mms mpg123 modplug sndfile \
38 upnp openal opus oss recorder \
39 vorbis wavpack zlib"
40
41PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2"
42PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
43PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao"
44PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile"
45PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2"
46PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia"
47PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false"
48PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
49PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false"
50PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac"
51PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth"
52PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false"
53PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag"
54PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio"
55PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
56PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame"
57PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0"
58PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad"
59PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms"
60PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug"
61PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
62PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft"
63PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg"
64PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled,"
65PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false"
66PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba"
67PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
68PACKAGECONFIG[upnp] = "-Dupnp=pupnp,-Dupnp=disabled,libupnp"
69PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg"
70PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack"
71PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib"
72
73do_install:append() {
74 install -o mpd -d \
75 ${D}/${localstatedir}/lib/mpd \
76 ${D}/${localstatedir}/lib/mpd/playlists
77 install -m775 -o mpd -g mpd -d \
78 ${D}/${localstatedir}/lib/mpd/music
79
80 install -d ${D}/${sysconfdir}
81 install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
82 sed -i \
83 -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
84 -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
85 -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
86 -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
87 -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
88 ${D}/${sysconfdir}/mpd.conf
89
90 # we don't need the icon
91 rm -rf ${D}${datadir}/icons
92}
93
94RPROVIDES:${PN} += "${PN}-systemd"
95RREPLACES:${PN} += "${PN}-systemd"
96RCONFLICTS:${PN} += "${PN}-systemd"
97SYSTEMD_SERVICE:${PN} = "mpd.socket"
98
99USERADD_PACKAGES = "${PN}"
100USERADD_PARAM:${PN} = " \
101 --system --no-create-home \
102 --home ${localstatedir}/lib/mpd \
103 --groups audio \
104 --user-group mpd"