From ab3c458cb39c87efc456762f6dff7c376c52bbce Mon Sep 17 00:00:00 2001 From: Jan-Simon Moeller Date: Wed, 23 Jun 2021 21:33:43 +0200 Subject: Update license handling for pipewire recipe We need to set LICENSE to multiple (MIT & GPL-2.0-only & LGPL-2.1-or-later) to satisfy the current scheme required by bitbake. But the licenses of the output packages are not all 3, but mostly MIT and a few LGPL-2.1-or-later and one GPL-2.0-only. To map the dynamically created output packages with the proper MIT license, we need to call setVar after all dynamic packages are created. Bug-AGL: SPEC-3844 Signed-off-by: Jan-Simon Moeller [manual cherry-pick of 340e5d4c from master/lamprey] Signed-off-by: Scott Murray Change-Id: Ie27a929a35e713c7478cde8b097ea1da51428047 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26571 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account --- .../recipes-multimedia/pipewire/pipewire_0.3.30.bb | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'meta-pipewire/recipes-multimedia') diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.30.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.30.bb index e52745a7d..b1a1aebc0 100644 --- a/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.30.bb +++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_0.3.30.bb @@ -10,10 +10,7 @@ SUMMARY = "Multimedia processing server for Linux" DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" HOMEPAGE = "https://pipewire.org/" BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" -LICENSE = "MIT" -LICENSE_${PN}-jack = "GPL-2.0-only" -LICENSE_${PN}-alsa-card-profile = "LGPL-2.1-or-later" -LICENSE_${PN}-spa-plugins-alsa = "LGPL-2.1-or-later" +LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-or-later" LIC_FILES_CHKSUM = " \ file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ @@ -94,6 +91,7 @@ PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir} PACKAGESPLITFUNCS_prepend = " split_dynamic_packages " PACKAGESPLITFUNCS_append = " set_dynamic_metapkg_rdepends " +PACKAGESPLITFUNCS_append = " fixup_dynamic_pkg_licenses " SPA_SUBDIR = "spa-0.2" PW_MODULE_SUBDIR = "pipewire-0.3" @@ -109,6 +107,26 @@ remove_unused_installed_files() { do_install[postfuncs] += "remove_unused_installed_files" +python fixup_dynamic_pkg_licenses () { + #dynamic packages inherit currently whatever is specified in LICENSE (thus multiple) + packages = (d.getVar('PACKAGES') or "").split() + + for pkg in packages: + # we manually assign the LICENSES here to cover all packages (even dynamically created ones) + d.setVar("LICENSE_" + pkg ,"MIT") + + # next handle special cases + # ==> LICENSE_${PN}-spa-plugins-alsa = "LGPL-2.1-or-later" + if "pipewire-spa-plugins-alsa" in pkg: + d.setVar("LICENSE_pipewire-spa-plugins-alsa", "LGPL-2.1-or-later") + # ==> LICENSE_${PN}-alsa-card-profile = "LGPL-2.1-or-later" + if "pipewire-alsa-card-profile" in pkg: + d.setVar("LICENSE_pipewire-alsa-card-profile", "LGPL-2.1-or-later") + # ==> LICENSE_${PN}-jack = "GPL-2.0-only" + if "pipewire-jack" in pkg: + d.setVar("LICENSE_pipewire-jack", "GPL-2.0-only") +} + python split_dynamic_packages () { # Create packages for each SPA plugin. These plugins are located # in individual subdirectories, so a recursive search is needed. -- cgit 1.2.3-korg