Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "Music Player Daemon" |
| 2 | LICENSE = "GPL-2.0-only" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 4 | |
| 5 | HOMEPAGE ="http://www.musicpd.org" |
| 6 | |
| 7 | inherit meson useradd systemd pkgconfig |
| 8 | |
| 9 | DEPENDS += " \ |
| 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 Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 21 | SRC_URI = "git://github.com/MusicPlayerDaemon/MPD;branch=master;protocol=https \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 22 | file://mpd.conf.in \ |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 23 | 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 Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 26 | " |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 27 | SRCREV = "b1422fbda40a1831d397fb161e7a555443c2a072" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 28 | S = "${WORKDIR}/git" |
| 29 | |
| 30 | EXTRA_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 | |
| 32 | PACKAGECONFIG ??= "${@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 | |
| 41 | PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2" |
| 42 | PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib" |
| 43 | PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao" |
| 44 | PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile" |
| 45 | PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2" |
| 46 | PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia" |
| 47 | PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false" |
| 48 | PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg" |
| 49 | PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false" |
| 50 | PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac" |
| 51 | PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth" |
| 52 | PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false" |
| 53 | PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag" |
| 54 | PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio" |
| 55 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" |
| 56 | PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame" |
| 57 | PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0" |
| 58 | PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad" |
| 59 | PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms" |
| 60 | PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug" |
| 61 | PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123" |
| 62 | PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft" |
| 63 | PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg" |
| 64 | PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled," |
| 65 | PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false" |
| 66 | PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba" |
| 67 | PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" |
| 68 | PACKAGECONFIG[upnp] = "-Dupnp=pupnp,-Dupnp=disabled,libupnp" |
| 69 | PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg" |
| 70 | PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack" |
| 71 | PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib" |
| 72 | |
| 73 | do_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 | |
| 94 | RPROVIDES:${PN} += "${PN}-systemd" |
| 95 | RREPLACES:${PN} += "${PN}-systemd" |
| 96 | RCONFLICTS:${PN} += "${PN}-systemd" |
| 97 | SYSTEMD_SERVICE:${PN} = "mpd.socket" |
| 98 | |
| 99 | USERADD_PACKAGES = "${PN}" |
| 100 | USERADD_PARAM:${PN} = " \ |
| 101 | --system --no-create-home \ |
| 102 | --home ${localstatedir}/lib/mpd \ |
| 103 | --groups audio \ |
| 104 | --user-group mpd" |