mpd: Backport PipeWire output fixes
[AGL/meta-agl-demo.git] / recipes-multimedia / musicpd / mpd_agldemo.inc
1 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
2
3 # Remove curl dependency to disable WebDAV support.
4 # Ideally this should be addressed by adding a PACKAGECONFIG option
5 # in the upstream recipe.
6 DEPENDS:remove = "curl"
7
8 SRC_URI += "file://0001-output-PipeWire-activate-stream-in-Drain.patch \
9             file://0002-output-PipeWire-skip-Cancel-if-already-drained.patch \
10             file://0003-output-PipeWire-call-pw_stream_flush-in-Cancel.patch \
11             file://0004-output-PipeWire-after-Cancel-refill-buffer-before-re.patch \
12             file://mpd-volatiles.conf \
13 "
14
15 # The older meson in poky dunfell complains about the use of the
16 # build.{c_std,cpp_std} options even though they work, so we need to
17 # flag them to be ignored in the unknown configure option QA test.
18 # This can be removed after upgrading to Yocto Project 3.5.
19 UNKNOWN_CONFIGURE_OPT_IGNORE = "build.c_std build.cpp_std"
20
21 # This also needs to be pushed upstream.
22 PACKAGECONFIG[pipewire] = "-Dpipewire=enabled,-Dpipewire=disabled,pipewire"
23
24 # Prune the default configuration a bit to remove various streaming/server
25 # options that are not required.
26 PACKAGECONFIG = " \
27     ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "aac", "", d)} \
28     bzip2 \
29     daemon \
30     ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "ffmpeg aac", "", d)} \
31     flac \
32     libsamplerate \
33     mpg123 \
34     sndfile \
35     opus \
36     vorbis \
37     wavpack \
38     zlib \
39     pipewire \
40     id3tag \
41 "
42
43 SYSTEMD_AUTO_ENABLE = "enable"
44
45 # Override default as AGL's PipeWire configuration does not make use of audio
46 # group.  As opposed to using the group setting in mpd.conf, this keeps the
47 # files created in /var/lib/mpd as mpd.mpd, which seems safer.
48 USERADD_PARAM:${PN} = " \
49     --system --no-create-home \
50     --home ${localstatedir}/lib/mpd \
51     --groups pipewire \
52     --user-group mpd"
53
54 # Install volatile redirect for /var/lib/mpd to avoid any chance of metadata
55 # corruption on reboot.  This matches what as previously done with the
56 # lightmediascanner configuration.
57 do_install:append() {
58     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
59         install -D -m 0644 ${WORKDIR}/mpd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/mpd.conf
60     fi
61 }