9504a567106841314726b6c1791a01a99e59355c
[AGL/meta-agl.git] / meta-pipewire / recipes-multimedia / wireplumber / wireplumber_git.bb
1 SUMMARY     = "Session / Policy Manager for PipeWire"
2 HOMEPAGE    = "https://gitlab.freedesktop.org/pipewire/wireplumber"
3 BUGTRACKER  = "https://gitlab.freedesktop.org/pipewire/wireplumber/issues"
4 AUTHOR      = "George Kiagiadakis <george.kiagiadakis@collabora.com>"
5 SECTION     = "multimedia"
6
7 LICENSE = "MIT"
8 LIC_FILES_CHKSUM = "file://LICENSE;beginline=3;md5=e8ad01a5182f2c1b3a2640e9ea268264"
9
10 inherit meson pkgconfig systemd
11
12 DEPENDS = "glib-2.0 glib-2.0-native pipewire lua"
13
14 SRC_URI = "\
15     git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \
16 "
17 # v0.4.8
18 SRCREV = "e14bb72dcc85e2130d0ea96768e5ae3b375a041e"
19
20 # patches to be able to compile with lower version of meson that is available in AGL.
21 SRC_URI += "\
22     file://0001-Revert-tests-add-pipewire-env-variables-when-running.patch \
23     file://0002-Revert-wp-uninstalled-build-this-script-with-the-mes.patch \
24     file://0003-spa-json-fix-va_list-APIs-for-different-architecture.patch \
25     file://0004-policy-endpoint-device-Fix-endpoints-not-connected-w.patch \
26 "
27
28 PV = "0.4.8"
29 S  = "${WORKDIR}/git"
30
31 WPAPI="0.4"
32
33 # use shared lua from the system instead of the static bundled one
34 EXTRA_OEMESON += "-Dsystem-lua=true"
35
36 # introspection in practice is only used for generating API docs
37 # API docs are available on the website and we don't need to build them
38 # (plus they depend on hotdoc which is not available here)
39 EXTRA_OEMESON += "-Dintrospection=disabled -Ddoc=disabled"
40
41 PACKAGECONFIG = "\
42     ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
43 "
44
45 PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=true -Dsystemd-user-service=false,-Dsystemd=disabled -Dsystemd-system-service=false -Dsystemd-user-service=false,systemd"
46
47 do_configure:prepend() {
48     # relax meson version requirement
49     # we only need 0.54 when building with -Dsystem-lua=false
50     sed "s/meson_version : '>= 0.56.0'/meson_version : '>= 0.53.2'/" ${S}/meson.build > ${S}/tmp.build
51     mv -f ${S}/tmp.build ${S}/meson.build
52 }
53
54 PACKAGES =+ "\
55     lib${PN}-${WPAPI} \
56     ${PN}-config \
57 "
58
59 SYSTEMD_SERVICE:${PN} = "wireplumber.service"
60 FILES:${PN} = "\
61     ${bindir}/wireplumber \
62     ${bindir}/wpctl \
63     ${bindir}/wpexec \
64     ${libdir}/wireplumber-${WPAPI}/* \
65     ${datadir}/wireplumber/scripts/* \
66     ${systemd_system_unitdir}/* \
67 "
68 RPROVIDES:${PN} += "virtual/pipewire-sessionmanager"
69
70 FILES:lib${PN}-${WPAPI} = "\
71     ${libdir}/libwireplumber-${WPAPI}.so.* \
72 "
73
74 FILES:${PN}-config += "\
75     ${sysconfdir}/wireplumber/* \
76     ${datadir}/wireplumber/*conf \
77     ${datadir}/wireplumber/common/* \
78     ${datadir}/wireplumber/main.lua.d/* \
79     ${datadir}/wireplumber/bluetooth.lua.d/* \
80     ${datadir}/wireplumber/policy.lua.d/* \
81 "
82 do_install:append() {
83     rm -rf ${D}${sysconfdir}/wireplumber/
84     rm -f ${D}${datadir}/wireplumber/*conf
85     rm -rf ${D}${datadir}/wireplumber/common
86     rm -rf ${D}${datadir}/wireplumber/main.lua.d
87     rm -rf ${D}${datadir}/wireplumber/bluetooth.lua.d
88     rm -rf ${D}${datadir}/wireplumber/policy.lua.d
89 }