blob: 9daa19c2d69a34df2ae988cc08f30ad8c5a46565 [file] [log] [blame]
Andrew Geissler97771a32021-03-05 15:23:11 -06001SUMMARY = "Music Player Daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4
Andrew Geissler97771a32021-03-05 15:23:11 -06005HOMEPAGE ="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"
19
20SRC_URI = " \
21 git://github.com/MusicPlayerDaemon/MPD;branch=v0.22.x \
Andrew Geissler69721092021-07-23 12:57:00 -040022 file://0001-include-utility-for-std-forward.patch \
Andrew Geissler97771a32021-03-05 15:23:11 -060023 file://mpd.conf.in \
24"
Andrew Geissler69721092021-07-23 12:57:00 -040025SRCREV = "18628bf89ebfa5a806971479a71cf9b5764e500e"
Andrew Geissler97771a32021-03-05 15:23:11 -060026S = "${WORKDIR}/git"
27
28EXTRA_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)}"
29
Andrew Geissler32b11992021-03-31 13:37:05 -050030PACKAGECONFIG ??= "${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "aac", "", d)} \
31 alsa ao bzip2 daemon \
32 ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "ffmpeg aac", "", d)} \
33 fifo flac fluidsynth iso9660 \
34 jack libsamplerate httpd \
35 mms mpg123 modplug sndfile \
36 upnp openal opus oss recorder \
37 vorbis wavpack zlib"
Andrew Geissler97771a32021-03-05 15:23:11 -060038
39PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2"
40PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
41PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao"
42PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile"
43PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2"
44PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia"
45PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false"
46PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
47PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false"
48PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac"
49PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth"
50PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false"
51PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag"
52PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio"
53PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
54PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame"
55PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0"
56PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad"
57PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms"
58PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug"
59PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
60PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft"
61PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg"
62PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled,"
63PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false"
64PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba"
65PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
66PACKAGECONFIG[upnp] = "-Dupnp=enabled,-Dupnp=disabled,libupnp"
67PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg"
68PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack"
69PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib"
70
Patrick Williams213cb262021-08-07 19:21:33 -050071do_install:append() {
Andrew Geissler97771a32021-03-05 15:23:11 -060072 install -o mpd -d \
73 ${D}/${localstatedir}/lib/mpd \
74 ${D}/${localstatedir}/lib/mpd/playlists
75 install -m775 -o mpd -g mpd -d \
76 ${D}/${localstatedir}/lib/mpd/music
77
78 install -d ${D}/${sysconfdir}
79 install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
80 sed -i \
81 -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
82 -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
83 -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
84 -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
85 -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
86 ${D}/${sysconfdir}/mpd.conf
87
88 # we don't need the icon
89 rm -rf ${D}${datadir}/icons
90}
91
Patrick Williams213cb262021-08-07 19:21:33 -050092RPROVIDES:${PN} += "${PN}-systemd"
93RREPLACES:${PN} += "${PN}-systemd"
94RCONFLICTS:${PN} += "${PN}-systemd"
95SYSTEMD_SERVICE:${PN} = "mpd.socket"
Andrew Geissler97771a32021-03-05 15:23:11 -060096
97USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050098USERADD_PARAM:${PN} = " \
Andrew Geissler97771a32021-03-05 15:23:11 -060099 --system --no-create-home \
100 --home ${localstatedir}/lib/mpd \
101 --groups audio \
102 --user-group mpd"