mpd: Upgrade to 0.22 series

Drop the gcc10 patches the problem is fixed in newer versions
Migrate to use meson build system
Drop libwrap packageconfig, its dropped upstream too
Use systemd_user_unit_dir to match OE

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Max Kellermann <max.kellermann@gmail.com>
Cc: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Khem Raj
2021-03-01 19:24:05 -08:00
parent b93ec079f9
commit d21322a667
4 changed files with 96 additions and 168 deletions
@@ -1,27 +0,0 @@
From c14877071f14b218835f7fb034dea11bd1ba56f5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 25 Dec 2019 09:40:16 -0800
Subject: [PATCH] StringBuffer: Include cstddef for size_t
Fixes
a.cpp:3:1: error: 'size_t' does not name a type
3 | size_t s;
| ^~~~~~
a.cpp:2:1: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
Upstream-Status: Submitted [https://github.com/MusicPlayerDaemon/MPD/pull/697]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/util/StringBuffer.hxx | 1 +
1 file changed, 1 insertion(+)
--- a/src/util/StringBuffer.hxx
+++ b/src/util/StringBuffer.hxx
@@ -31,6 +31,7 @@
#define STRING_BUFFER_HPP
#include <array>
+#include <cstddef>
/**
* A statically allocated string buffer.
@@ -1,38 +0,0 @@
From 06f78ced45f6622a2e02cd09e6a2c0c22a98b89e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 25 Dec 2019 09:41:55 -0800
Subject: [PATCH 2/2] Include <stdexcept> for runtime_error
Fixes
../git/src/LocateUri.cxx:65:14: error: 'runtime_error' is not a member of 'std'
65 | throw std::runtime_error("Unsupported URI scheme");
| ^~~~~~~~~~~~~
Upstream-Status: Inappropriate [ Fixed differently upstream ]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/LocateUri.cxx | 1 +
src/pcm/PcmConvert.cxx | 1 +
2 files changed, 2 insertions(+)
--- a/src/LocateUri.cxx
+++ b/src/LocateUri.cxx
@@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <stdexcept>
#include "config.h"
#include "LocateUri.hxx"
#include "client/Client.hxx"
--- a/src/pcm/PcmConvert.cxx
+++ b/src/pcm/PcmConvert.cxx
@@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <stdexcept>
#include "config.h"
#include "PcmConvert.hxx"
#include "ConfiguredResampler.hxx"
@@ -1,103 +0,0 @@
SUMMARY = "Music Player Daemon"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
LICENSE_FLAGS = "${@bb.utils.contains_any('PACKAGECONFIG', ['ffmpeg', 'aac'], 'commercial', '', d)}"
HOMEPAGE ="http://www.musicpd.org"
inherit autotools useradd systemd pkgconfig
DEPENDS += " \
curl \
sqlite3 \
${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
yajl \
boost \
icu \
dbus \
expat \
"
SRC_URI = " \
git://github.com/MusicPlayerDaemon/MPD;branch=v0.20.x \
file://mpd.conf.in \
file://0001-StringBuffer-Include-cstddef-for-size_t.patch \
file://0002-Include-stdexcept-for-runtime_error.patch \
"
SRCREV = "9274bc15bc41bbe490fde847f8422468cc20375d"
S = "${WORKDIR}/git"
EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
PACKAGECONFIG ??= "aac alsa ao bzip2 daemon ffmpeg fifo flac fluidsynth iso9660 jack libsamplerate libwrap httpd mms mpg123 modplug sndfile upnp openal opus oss recorder vorbis wavpack zlib"
PACKAGECONFIG[aac] = "--enable-aac,--disable-aac,faad2"
PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
PACKAGECONFIG[ao] = "--enable-ao,--disable-ao,libao"
PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile"
PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia"
PACKAGECONFIG[daemon] = "--enable-daemon,--disable-daemon"
PACKAGECONFIG[ffmpeg] = "--enable-ffmpeg,--disable-ffmpeg,ffmpeg"
PACKAGECONFIG[fifo] = "--enable-fifo,--disable-fifo"
PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac"
PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
PACKAGECONFIG[httpd] = "--enable-httpd-output,--disable-httpd-output"
PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
PACKAGECONFIG[iso9660] = "--enable-iso9660,--disable-iso9660,libcdio"
PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
PACKAGECONFIG[libsamplerate] = "--enable-lsr,--disable-lsr,libsamplerate0"
PACKAGECONFIG[libwrap] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
PACKAGECONFIG[mms] = "--enable-mms,--disable-mms,libmms"
PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus libogg"
PACKAGECONFIG[oss] = "--enable-oss,--disable-oss,"
PACKAGECONFIG[recorder] = "--enable-recorder-output,--disable-recorder-output"
PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba"
PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
PACKAGECONFIG[upnp] = "--enable-upnp,--disable-upnp,libupnp"
PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis libogg"
PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
do_configure_prepend() {
sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac
}
do_install_append() {
install -o mpd -d \
${D}/${localstatedir}/lib/mpd \
${D}/${localstatedir}/lib/mpd/playlists
install -m775 -o mpd -g mpd -d \
${D}/${localstatedir}/lib/mpd/music
install -d ${D}/${sysconfdir}
install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
sed -i \
-e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
-e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
-e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
-e 's|%log_file%|${localstatedir}/log/mpd.log|' \
-e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
${D}/${sysconfdir}/mpd.conf
# we don't need the icon
rm -rf ${D}${datadir}/icons
}
RPROVIDES_${PN} += "${PN}-systemd"
RREPLACES_${PN} += "${PN}-systemd"
RCONFLICTS_${PN} += "${PN}-systemd"
SYSTEMD_SERVICE_${PN} = "mpd.socket"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = " \
--system --no-create-home \
--home ${localstatedir}/lib/mpd \
--groups audio \
--user-group mpd"
@@ -0,0 +1,96 @@
SUMMARY = "Music Player Daemon"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
LICENSE_FLAGS = "${@bb.utils.contains_any('PACKAGECONFIG', ['ffmpeg', 'aac'], 'commercial', '', d)}"
HOMEPAGE ="http://www.musicpd.org"
inherit meson useradd systemd pkgconfig
DEPENDS += " \
curl \
sqlite3 \
${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
yajl \
boost \
icu \
dbus \
expat \
"
SRC_URI = " \
git://github.com/MusicPlayerDaemon/MPD;branch=v0.22.x \
file://mpd.conf.in \
"
SRCREV = "938728820b11d4544a071994fe3c63c6ab710e8e"
S = "${WORKDIR}/git"
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)}"
PACKAGECONFIG ??= "aac alsa ao bzip2 daemon ffmpeg fifo flac fluidsynth iso9660 jack libsamplerate httpd mms mpg123 modplug sndfile upnp openal opus oss recorder vorbis wavpack zlib"
PACKAGECONFIG[aac] = "-Dfaad=enabled,-Dfaad=disabled,faad2"
PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
PACKAGECONFIG[ao] = "-Dao=enabled,-Dao=disabled,libao"
PACKAGECONFIG[audiofile] = "-Daudiofile=enabled,-Daudiofile=disabled,audiofile"
PACKAGECONFIG[bzip2] = "-Dbzip2=enabled,-Dbzip2=disabled,bzip2"
PACKAGECONFIG[cdioparanoia] = "-Dcdio_paranoia=enabled,-Dcdio_paranoia=disabled,libcdio-paranoia"
PACKAGECONFIG[daemon] = "-Ddaemon=true,-Ddaemon=false"
PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
PACKAGECONFIG[fifo] = "-Dfifo=true,-Dfifo=false"
PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac"
PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth"
PACKAGECONFIG[httpd] = "-Dhttpd=true,-Dhttpd=false"
PACKAGECONFIG[id3tag] = "-Did3tag=enabled,-Did3tag=disabled,libid3tag"
PACKAGECONFIG[iso9660] = "-Diso9660=enabled,-Diso9660=disabled,libcdio"
PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame"
PACKAGECONFIG[libsamplerate] = "-Dlibsamplerate=enabled,-Dlibsamplerate=disabled,libsamplerate0"
PACKAGECONFIG[mad] = "-Dmad=enabled,-Dmad=disabled,libmad"
PACKAGECONFIG[mms] = "-Dmms=enabled,-Dmms=disabled,libmms"
PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug"
PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft"
PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus libogg"
PACKAGECONFIG[oss] = "-Doss=enabled,-Doss=disabled,"
PACKAGECONFIG[recorder] = "-Drecorder=true,-Drecorder=false"
PACKAGECONFIG[smb] = "-Dsmbclient=enabled,-Dsmbclient=disabled,samba"
PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
PACKAGECONFIG[upnp] = "-Dupnp=enabled,-Dupnp=disabled,libupnp"
PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis libogg"
PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack"
PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib"
do_install_append() {
install -o mpd -d \
${D}/${localstatedir}/lib/mpd \
${D}/${localstatedir}/lib/mpd/playlists
install -m775 -o mpd -g mpd -d \
${D}/${localstatedir}/lib/mpd/music
install -d ${D}/${sysconfdir}
install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
sed -i \
-e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
-e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
-e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
-e 's|%log_file%|${localstatedir}/log/mpd.log|' \
-e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
${D}/${sysconfdir}/mpd.conf
# we don't need the icon
rm -rf ${D}${datadir}/icons
}
RPROVIDES_${PN} += "${PN}-systemd"
RREPLACES_${PN} += "${PN}-systemd"
RCONFLICTS_${PN} += "${PN}-systemd"
SYSTEMD_SERVICE_${PN} = "mpd.socket"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = " \
--system --no-create-home \
--home ${localstatedir}/lib/mpd \
--groups audio \
--user-group mpd"