Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 1 | SUMMARY = "Multimedia processing server for Linux" |
| 2 | DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" |
| 3 | HOMEPAGE = "https://pipewire.org/" |
| 4 | BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" |
| 5 | LICENSE = "MIT" |
| 6 | LIC_FILES_CHKSUM = " \ |
| 7 | file://LICENSE;md5=e2c0b7d86d04e716a3c4c9ab34260e69 \ |
| 8 | file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ |
| 9 | " |
| 10 | SECTION = "multimedia" |
| 11 | |
| 12 | DEPENDS = "dbus" |
| 13 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 14 | SRCREV = "c81d44e8a9497899d01bcc3054b6aa845e7a066e" |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 15 | SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https" |
| 16 | |
| 17 | S = "${WORKDIR}/git" |
| 18 | |
| 19 | inherit meson pkgconfig systemd manpages gettext useradd |
| 20 | |
| 21 | USERADD_PACKAGES = "${PN}" |
| 22 | |
| 23 | GROUPADD_PARAM_${PN} = "--system pipewire" |
| 24 | |
| 25 | USERADD_PARAM_${PN} = "--system --home / --no-create-home \ |
| 26 | --comment 'PipeWire multimedia daemon' \ |
| 27 | --gid pipewire --groups audio,video \ |
| 28 | pipewire" |
| 29 | |
| 30 | # For "EVL", look up https://evlproject.org/ . It involves |
| 31 | # a specially prepared kernel, and is currently unavailable |
| 32 | # in Yocto. |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 33 | # |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 34 | # FFmpeg and Vulkan aren't really supported - at the current |
| 35 | # stage (version 0.3.22), these are just experiments, not |
| 36 | # actual features. |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 37 | # |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 38 | # libcamera support currently does not build successfully. |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 39 | # |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 40 | # systemd user service files are disabled because per-user |
| 41 | # PipeWire instances aren't really something that makes |
| 42 | # much sense in an embedded environment. A system-wide |
| 43 | # instance does. |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 44 | # |
| 45 | # manpage generation requires xmltoman, which is not available. |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 46 | EXTRA_OEMESON += " \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 47 | -Daudiotestsrc=enabled \ |
| 48 | -Devl=disabled \ |
| 49 | -Dsystemd-user-service=disabled \ |
| 50 | -Dtests=disabled \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 51 | -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 52 | -Dvideotestsrc=enabled \ |
| 53 | -Dffmpeg=disabled \ |
| 54 | -Dvulkan=disabled \ |
| 55 | -Dlibcamera=disabled \ |
| 56 | -Dman=disabled \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 57 | " |
| 58 | |
| 59 | PACKAGECONFIG ??= "\ |
| 60 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ |
| 61 | ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \ |
| 62 | gstreamer jack v4l2 \ |
| 63 | " |
| 64 | |
| 65 | # "jack" and "pipewire-jack" packageconfigs cannot be both enabled, |
| 66 | # since "jack" imports libjack, and "pipewire-jack" generates |
| 67 | # libjack.so* files, thus colliding with the libpack package. This |
| 68 | # is why these two are marked in their respective packageconfigs |
| 69 | # as being in conflict. |
| 70 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 71 | PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" |
| 72 | PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" |
| 73 | PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native" |
| 74 | PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" |
| 75 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 76 | PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" |
| 77 | PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 78 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=enabled ,-Dsystemd=disabled -Dsystemd-system-service=disabled,systemd" |
| 79 | PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" |
| 80 | PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" |
| 81 | PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 82 | |
| 83 | PACKAGESPLITFUNCS_prepend = " split_dynamic_packages " |
| 84 | PACKAGESPLITFUNCS_append = " set_dynamic_metapkg_rdepends " |
| 85 | |
| 86 | SPA_SUBDIR = "spa-0.2" |
| 87 | PW_MODULE_SUBDIR = "pipewire-0.3" |
| 88 | |
| 89 | remove_unused_installed_files() { |
| 90 | # jack.conf is used by pipewire-jack (not the JACK SPA plugin). |
| 91 | # Remove it if pipewire-jack is not built to avoid creating the |
| 92 | # pipewire-jack package. |
| 93 | if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then |
| 94 | rm -f "${D}${sysconfdir}/pipewire/jack.conf" |
| 95 | fi |
| 96 | } |
| 97 | |
| 98 | do_install[postfuncs] += "remove_unused_installed_files" |
| 99 | |
| 100 | python split_dynamic_packages () { |
| 101 | # Create packages for each SPA plugin. These plugins are located |
| 102 | # in individual subdirectories, so a recursive search is needed. |
| 103 | spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') |
| 104 | do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) |
| 105 | |
| 106 | # Create packages for each PipeWire module. |
| 107 | pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') |
| 108 | do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) |
| 109 | } |
| 110 | |
| 111 | python set_dynamic_metapkg_rdepends () { |
| 112 | import os |
| 113 | import oe.utils |
| 114 | |
| 115 | # Go through all generated SPA plugin and PipeWire module packages |
| 116 | # (excluding the main package and the -meta package itself) and |
| 117 | # add them to the -meta package as RDEPENDS. |
| 118 | |
| 119 | base_pn = d.getVar('PN') |
| 120 | |
| 121 | spa_pn = base_pn + '-spa-plugins' |
| 122 | spa_metapkg = spa_pn + '-meta' |
| 123 | |
| 124 | pw_module_pn = base_pn + '-modules' |
| 125 | pw_module_metapkg = pw_module_pn + '-meta' |
| 126 | |
| 127 | d.setVar('ALLOW_EMPTY_' + spa_metapkg, "1") |
| 128 | d.setVar('FILES_' + spa_metapkg, "") |
| 129 | |
| 130 | d.setVar('ALLOW_EMPTY_' + pw_module_metapkg, "1") |
| 131 | d.setVar('FILES_' + pw_module_metapkg, "") |
| 132 | |
| 133 | blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] |
| 134 | spa_metapkg_rdepends = [] |
| 135 | pw_module_metapkg_rdepends = [] |
| 136 | pkgdest = d.getVar('PKGDEST') |
| 137 | |
| 138 | for pkg in oe.utils.packages_filter_out_system(d): |
| 139 | if pkg in blacklist: |
| 140 | continue |
| 141 | |
| 142 | is_spa_pkg = pkg.startswith(spa_pn) |
| 143 | is_pw_module_pkg = pkg.startswith(pw_module_pn) |
| 144 | if not is_spa_pkg and not is_pw_module_pkg: |
| 145 | continue |
| 146 | |
| 147 | if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: |
| 148 | continue |
| 149 | |
| 150 | # See if the package is empty by looking at the contents of its |
| 151 | # PKGDEST subdirectory. If this subdirectory is empty, then then |
| 152 | # package is empty as well. Empty packages do not get added to |
| 153 | # the meta package's RDEPENDS. |
| 154 | pkgdir = os.path.join(pkgdest, pkg) |
| 155 | if os.path.exists(pkgdir): |
| 156 | dir_contents = os.listdir(pkgdir) or [] |
| 157 | else: |
| 158 | dir_contents = [] |
| 159 | is_empty = len(dir_contents) == 0 |
| 160 | if not is_empty: |
| 161 | if is_spa_pkg: |
| 162 | spa_metapkg_rdepends.append(pkg) |
| 163 | if is_pw_module_pkg: |
| 164 | pw_module_metapkg_rdepends.append(pkg) |
| 165 | |
| 166 | d.setVar('RDEPENDS_' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) |
| 167 | d.setVar('DESCRIPTION_' + spa_metapkg, spa_pn + ' meta package') |
| 168 | |
| 169 | d.setVar('RDEPENDS_' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) |
| 170 | d.setVar('DESCRIPTION_' + pw_module_metapkg, pw_module_pn + ' meta package') |
| 171 | } |
| 172 | |
| 173 | PACKAGES =+ "\ |
| 174 | libpipewire \ |
| 175 | ${PN}-tools \ |
| 176 | ${PN}-pulse \ |
| 177 | ${PN}-alsa \ |
| 178 | ${PN}-jack \ |
| 179 | ${PN}-media-session \ |
| 180 | ${PN}-spa-plugins \ |
| 181 | ${PN}-spa-plugins-meta \ |
| 182 | ${PN}-spa-tools \ |
| 183 | ${PN}-modules \ |
| 184 | ${PN}-modules-meta \ |
| 185 | ${PN}-alsa-card-profile \ |
| 186 | gstreamer1.0-pipewire \ |
| 187 | " |
| 188 | |
| 189 | PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" |
| 190 | |
| 191 | SYSTEMD_SERVICE_${PN} = "pipewire.service" |
| 192 | CONFFILES_${PN} += "${sysconfdir}/pipewire/pipewire.conf" |
| 193 | FILES_${PN} = " \ |
| 194 | ${sysconfdir}/pipewire/pipewire.conf \ |
| 195 | ${systemd_user_unitdir}/pipewire.* \ |
| 196 | ${bindir}/pipewire \ |
| 197 | " |
| 198 | |
| 199 | FILES_${PN}-dev += " \ |
| 200 | ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ |
| 201 | " |
| 202 | |
| 203 | CONFFILES_libpipewire += "${sysconfdir}/pipewire/client.conf" |
| 204 | FILES_libpipewire = " \ |
| 205 | ${sysconfdir}/pipewire/client.conf \ |
| 206 | ${libdir}/libpipewire-*.so.* \ |
| 207 | " |
| 208 | # Add the bare minimum modules and plugins required to be able |
| 209 | # to use libpipewire. Without these, it is essentially unusable. |
| 210 | RDEPENDS_libpipewire += " \ |
| 211 | ${PN}-modules-client-node \ |
| 212 | ${PN}-modules-protocol-native \ |
| 213 | ${PN}-spa-plugins-support \ |
| 214 | " |
| 215 | |
| 216 | FILES_${PN}-tools = " \ |
| 217 | ${bindir}/pw-* \ |
| 218 | " |
| 219 | |
| 220 | # This is a shim daemon that is intended to be used as a |
| 221 | # drop-in PulseAudio replacement, providing a pulseaudio-compatible |
| 222 | # socket that can be used by applications that use libpulse. |
| 223 | CONFFILES_${PN}-pulse += "${sysconfdir}/pipewire/pipewire-pulse.conf" |
| 224 | FILES_${PN}-pulse = " \ |
| 225 | ${sysconfdir}/pipewire/pipewire-pulse.conf \ |
| 226 | ${systemd_user_unitdir}/pipewire-pulse.* \ |
| 227 | ${bindir}/pipewire-pulse \ |
| 228 | " |
| 229 | RDEPENDS_${PN}-pulse += " \ |
| 230 | ${PN}-modules-protocol-pulse \ |
| 231 | " |
| 232 | |
| 233 | # alsa plugin to redirect audio to pipewire |
| 234 | FILES_${PN}-alsa = "\ |
| 235 | ${libdir}/alsa-lib/* \ |
| 236 | ${datadir}/alsa/alsa.conf.d/* \ |
| 237 | " |
| 238 | |
| 239 | # jack drop-in libraries to redirect audio to pipewire |
| 240 | CONFFILES_${PN}-jack = "${sysconfdir}/pipewire/jack.conf" |
| 241 | FILES_${PN}-jack = "\ |
| 242 | ${sysconfdir}/pipewire/jack.conf \ |
| 243 | ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ |
| 244 | " |
| 245 | |
| 246 | # Example session manager. Not intended for use in production. |
| 247 | CONFFILES_${PN}-media-session = "${sysconfdir}/pipewire/media-session.d/*" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 248 | SYSTEMD_SERVICE_${PN}-media-session = "pipewire-media-session.service" |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 249 | FILES_${PN}-media-session = " \ |
| 250 | ${bindir}/pipewire-media-session \ |
| 251 | ${sysconfdir}/pipewire/media-session.d/* \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 252 | ${systemd_system_unitdir}/pipewire-media-session.service \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 253 | " |
| 254 | RPROVIDES_${PN}-media-session = "virtual/pipewire-sessionmanager" |
| 255 | |
| 256 | # Dynamic packages (see set_dynamic_metapkg_rdepends). |
| 257 | FILES_${PN}-spa-plugins = "" |
| 258 | RRECOMMENDS_${PN}-spa-plugins += "${PN}-spa-plugins-meta" |
| 259 | |
| 260 | FILES_${PN}-spa-tools = " \ |
| 261 | ${bindir}/spa-* \ |
| 262 | " |
| 263 | |
| 264 | # Dynamic packages (see set_dynamic_metapkg_rdepends). |
| 265 | FILES_${PN}-modules = "" |
| 266 | RRECOMMENDS_${PN}-modules += "${PN}-modules-meta" |
| 267 | |
| 268 | CONFFILES_${PN}-modules-rtkit = "${sysconfdir}/pipewire/client-rt.conf" |
| 269 | FILES_${PN}-modules-rtkit += " \ |
| 270 | ${sysconfdir}/pipewire/client-rt.conf \ |
| 271 | " |
| 272 | |
| 273 | FILES_${PN}-alsa-card-profile = " \ |
| 274 | ${datadir}/alsa-card-profile/* \ |
| 275 | ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ |
| 276 | " |
| 277 | |
| 278 | FILES_gstreamer1.0-pipewire = " \ |
| 279 | ${libdir}/gstreamer-1.0/* \ |
| 280 | " |