gstreamer1.0-plugins-bad/ugly: use the GPL-2.0-or-later only when it is in use
PATCH v4 1/1 gstreamer1.0-plugins-bad/ugly: use the GPL-2.0-or-later only when it is in use
Since all gstreamer modules uses LGPLv2.1 with exceptions for some plugins in bad and ugly modules that has GPLv2+.
For the GPLv2+ this patch set the license only for each plugin that is affected by this license. The commercial LICENSE_FLAGS is enabled if any of the previous plugins is builded.
--- .../gstreamer1.0-plugins-bad_1.20.0.bb | 5 ++-- .../gstreamer1.0-plugins-license.inc | 26 +++++++++++++++++++ .../gstreamer1.0-plugins-ugly_1.20.0.bb | 8 +++--- 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-license.inc
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.20.0.bb +3 -2
@@ -1,4 +1,5 @@ require gstreamer1.0-plugins-common.inc +require gstreamer1.0-plugins-license.inc DESCRIPTION = "'Bad' GStreamer plugins and helper libraries " HOMEPAGE = "https://gstreamer.freedesktop.org/"
@@ -92,8 +93,8 @@ PACKAGECONFIG[webrtcdsp] = "-Dwebrtcdsp=enabled,-Dwebrtcdsp=disabled,webrt PACKAGECONFIG[zbar] = "-Dzbar=enabled,-Dzbar=disabled,zbar" PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,libxcb libxkbcommon" -# GPL - only built if gpl option is also enabled! -PACKAGECONFIG[gpl] = "-Dgpl=enabled,-Dgpl=disabled" +GSTREAMER_GPL = "${@bb.utils.filter('PACKAGECONFIG', 'faad resindvd x265', d)}" + PACKAGECONFIG[faad] = "-Dfaad=enabled,-Dfaad=disabled,faad2" PACKAGECONFIG[resindvd] = "-Dresindvd=enabled,-Dresindvd=disabled,libdvdread libdvdnav" PACKAGECONFIG[x265] = "-Dx265=enabled,-Dx265=disabled,x265"
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-license.inc new file +26 -0
@@ -0,0 +1,26 @@ +# This .inc file contains functionality for automatically setting +# the common license of all plugins so we can overwride some of them +# +# This is mainly used by the gstreamer1.0-plugins-* plugin set recipes, +# but can be used in any recipe that produces GStreamer plugins. + +PACKAGESPLITFUNCS:append = " set_gstreamer_license " + +python set_gstreamer_license () { + import oe.utils + pn = d.getVar('PN') + '-' + gpl_plugins_names = [pn+plugin for plugin in d.getVar('GSTREAMER_GPL').split()] + for pkg in oe.utils.packages_filter_out_system(d): + if pkg in gpl_plugins_names: + d.setVar('LICENSE:' + pkg, 'GPL-2.0-or-later') + else: + d.setVar('LICENSE:' + pkg, 'LGPL-2.1-or-later') +} + +EXTRA_OEMESON += " \ + ${@bb.utils.contains_any('PACKAGECONFIG', "${GSTREAMER_GPL}", '-Dgpl=enabled', '-Dgpl=disabled', d)} \ + " + +LICENSE_FLAGS = " \ + ${@bb.utils.contains_any('PACKAGECONFIG', "${GSTREAMER_GPL}", 'commercial', '', d)} \ + "
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb +4 -4
@@ -1,4 +1,5 @@ require gstreamer1.0-plugins-common.inc +require gstreamer1.0-plugins-license.inc DESCRIPTION = "'Ugly GStreamer plugins" HOMEPAGE = "https://gstreamer.freedesktop.org/"
@@ -8,7 +9,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068" LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later" -LICENSE_FLAGS = "commercial" SRC_URI = " \ https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
@@ -23,14 +23,14 @@ GST_PLUGIN_SET_HAS_EXAMPLES = "0" PACKAGECONFIG ??= " \ ${GSTREAMER_ORC} \ - gpl a52dec mpeg2dec \ + a52dec mpeg2dec \ " PACKAGECONFIG[amrnb] = "-Damrnb=enabled,-Damrnb=disabled,opencore-amr" PACKAGECONFIG[amrwb] = "-Damrwbdec=enabled,-Damrwbdec=disabled,opencore-amr" -# GPL - only built if gpl option is also enabled! -PACKAGECONFIG[gpl] = "-Dgpl=enabled,-Dgpl=disabled" +GSTREAMER_GPL = "${@bb.utils.filter('PACKAGECONFIG', 'cdio a52dec dvdread mpeg2dec x264', d)}" + PACKAGECONFIG[cdio] = "-Dcdio=enabled,-Dcdio=disabled,libcdio" PACKAGECONFIG[a52dec] = "-Da52dec=enabled,-Da52dec=disabled,liba52" PACKAGECONFIG[dvdread] = "-Ddvdread=enabled,-Ddvdread=disabled,libdvdread"
Signature · 1 line
2.35.1
Quoted 34 lines
-----Original Message-----
From: Jose Quaresma <[email protected]>
Sent: den 7 mars 2022 09:59
To: [email protected]
Cc: Jose Quaresma <[email protected]>; Peter Kjellerstedt <[email protected]>
Subject: [PATCH v4] gstreamer1.0-plugins-bad/ugly: use the GPL-2.0-or-later only when it is in useSince all gstreamer modules uses LGPLv2.1 with exceptions for some plugins in bad and ugly modules that has GPLv2+.
For the GPLv2+ this patch set the license only for each plugin that is affected by this license. The commercial
LICENSE_FLAGSis enabled if any of the previous plugins is builded.CC Peter Kjellerstedt <[email protected]>Signed-off-by Jose Quaresma <[email protected]>--- .../gstreamer1.0-plugins-bad_1.20.0.bb | 5 ++-- .../gstreamer1.0-plugins-license.inc | 26 +++++++++++++++++++ .../gstreamer1.0-plugins-ugly_1.20.0.bb | 8 +++--- 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-license.incmeta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.20.0.bb +1
-0@@ -1,4 +1,5 @@ require gstreamer1.0-plugins-common.inc +require gstreamer1.0-plugins-license.inc DESCRIPTION = "'Bad' GStreamer plugins and helper libraries " HOMEPAGE = "https://gstreamer.freedesktop.org/"
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.20.0.bb PACKAGECONFIG[webrtcdsp] = "-Dwebrtcdsp=enabled,-Dwebrtcdsp=disabled,webrt · line 96
Quoted 6 lines
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.20.0.bb +1
-2@@ -92,8 +93,8 @@ PACKAGECONFIG[webrtcdsp] = "-Dwebrtcdsp=enabled,-Dwebrtcdsp=disabled,webrt PACKAGECONFIG[zbar] = "-Dzbar=enabled,-Dzbar=disabled,zbar" PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,libxcb libxkbcommon" -# GPL - only built if gpl option is also enabled! -PACKAGECONFIG[gpl] = "-Dgpl=enabled,-Dgpl=disabled" +GSTREAMER_GPL = "${@bb.utils.filter('PACKAGECONFIG', 'faad resindvd x265', d)}"
Seems a bit odd to have this variable in the middle of the PACKAGECONFIGs.
Quoted 50 lines
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.20.0.bb +1
-0+ PACKAGECONFIG[faad] = "-Dfaad=enabled,-Dfaad=disabled,faad2" PACKAGECONFIG[resindvd] = "-Dresindvd=enabled,-Dresindvd=disabled,libdvdread libdvdnav" PACKAGECONFIG[x265] = "-Dx265=enabled,-Dx265=disabled,x265"meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-license.inc new file +26
-0@@ -0,0 +1,26 @@ +# This .inc file contains functionality for automatically setting +# the common license of all plugins so we can overwride some of them +# +# This is mainly used by the gstreamer1.0-plugins-* plugin set recipes, +# but can be used in any recipe that produces GStreamer plugins. + +PACKAGESPLITFUNCS:append = " set_gstreamer_license " + +python set_gstreamer_license () { + import oe.utils + pn = d.getVar('PN') + '-' + gpl_plugins_names = [pn+plugin for plugin in d.getVar('GSTREAMER_GPL').split()] + for pkg in oe.utils.packages_filter_out_system(d): + if pkg in gpl_plugins_names: + d.setVar('LICENSE:' + pkg, 'GPL-2.0-or-later') + else: + d.setVar('LICENSE:' + pkg, 'LGPL-2.1-or-later') +} + +EXTRA_OEMESON += " \ + ${@bb.utils.contains_any('PACKAGECONFIG', "${GSTREAMER_GPL}", '-Dgpl=enabled', '-Dgpl=disabled', d)} \ + " + +LICENSE_FLAGS = " \ + ${@bb.utils.contains_any('PACKAGECONFIG', "${GSTREAMER_GPL}", 'commercial', '', d)} \ + "meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb +1
-0@@ -1,4 +1,5 @@ require gstreamer1.0-plugins-common.inc +require gstreamer1.0-plugins-license.inc DESCRIPTION = "'Ugly GStreamer plugins" HOMEPAGE = "https://gstreamer.freedesktop.org/"@@ -8,7 +9,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
Quoted 2 lines
LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later"
-LICENSE_FLAGS = "commercial"
I still think this is wrong. I.e., the commercial flag is not related to a plugin using GPL or not, but rather the fact that it is in ugly. E.g., the reason may be patent considerations and can apply to any of the plugins regardless of license.
Quoted 22 lines
SRC_URI = " \ https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb +3
-4@@ -23,14 +23,14 @@ GST_PLUGIN_SET_HAS_EXAMPLES = "0" PACKAGECONFIG ??= " \ ${GSTREAMER_ORC} \ - gpl a52dec mpeg2dec \ + a52dec mpeg2dec \ " PACKAGECONFIG[amrnb] = "-Damrnb=enabled,-Damrnb=disabled,opencore-amr" PACKAGECONFIG[amrwb] = "-Damrwbdec=enabled,-Damrwbdec=disabled,opencore-amr" -# GPL - only built if gpl option is also enabled! -PACKAGECONFIG[gpl] = "-Dgpl=enabled,-Dgpl=disabled" +GSTREAMER_GPL = "${@bb.utils.filter('PACKAGECONFIG', 'cdio a52dec dvdread mpeg2dec x264', d)}" + PACKAGECONFIG[cdio] = "-Dcdio=enabled,-Dcdio=disabled,libcdio" PACKAGECONFIG[a52dec] = "-Da52dec=enabled,-Da52dec=disabled,liba52" PACKAGECONFIG[dvdread] = "-Ddvdread=enabled,-Ddvdread=disabled,libdvdread" --
Quoted 1 line
2.35.1
//Peter
Quoted 15 lines · Peter Kjellerstedt
Quoted 15 lines
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb +0
-0@@ -1,4 +1,5 @@require gstreamer1.0-plugins-common.inc
+require gstreamer1.0-plugins-license.incDESCRIPTION = "'Ugly GStreamer plugins"
HOMEPAGE = "https://gstreamer.freedesktop.org/"meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb +0
-0@@ -8,7 +9,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
Quoted 9 lines
Quoted 2 lines
LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later"
-LICENSE_FLAGS = "commercial"I still think this is wrong. I.e., the commercial flag is not related to a plugin using GPL or not, but rather the fact that it is in ugly. E.g., the reason may be patent considerations and can apply to any of the plugins regardless of license.
Agreed, that flag should be independent of whether GPL is there or not.
Cheers,
Richard
Richard Purdie <[email protected]> escreveu no dia segunda, 7/03/2022 à(s) 15:50:
Quoted 14 lines · Peter Kjellerstedt
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +0
-0gstreamer1.0-plugins-ugly_1.20.0.bb b/meta/recipes-multimedia/gstreamer/ gstreamer1.0-plugins-ugly_1.20.0.bb
Quoted 2 lines
Quoted 2 lines
index
9b6f80aa89..577ba16af7100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb
Quoted 1 line
Quoted 1 line
+++ b/meta/recipes-multimedia/gstreamer/
gstreamer1.0-plugins-ugly_1.20.0.bb
Quoted 4 lines
Quoted 4 lines
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.20.0.bb +1
-0@@ -1,4 +1,5 @@ require gstreamer1.0-plugins-common.inc +require gstreamer1.0-plugins-license.inc
Quoted 16 lines
Quoted 3 lines
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb LIC_FILES_CHKSUM =
Quoted 3 lines
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.20.0.bb +0
-0DESCRIPTION = "'Ugly GStreamer plugins" HOMEPAGE = "https://gstreamer.freedesktop.org/"@@ -8,7 +9,6 @@ LIC_FILES_CHKSUM ="file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
Quoted 2 lines
Quoted 2 lines
file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
Quoted 8 lines
Quoted 3 lines
LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later"
-LICENSE_FLAGS = "commercial"I still think this is wrong. I.e., the commercial flag is not related to a plugin using GPL or not, but rather the fact that it is in ugly. E.g., the reason may be patent considerations and can apply to any of the plugins regardless of license.
yes i'm making some confusion here with the commercial flag and the GPL license, the reason is:
faad have commercial flag
https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-multimedia/faad2/faad2_2.8.8.bb?id=c0a4a0355d1f37849f47d9f29c5c5dbd59806a3a
resindvd don't have commercial flag
https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-multimedia/libdvdread/libdvdread_6.1.2.bb?id=1dc583540355ab6af483b20b945cbd7c42984ccf
https://git.openembedded.org/meta-openembedded/tree/meta-multimedia/recipes-multimedia/libdvdnav/libdvdnav_6.1.1.bb?id=51f61a7899f40e9910baea12217ed8a27ac09f62
x265 have commercial flag
https://git.openembedded.org/meta-openembedded/tree/meta-multimedia/recipes-multimedia/x265/x265_3.2.1.bb?id=90683147fa6840b16816a75154dba89725ddb0a3
I will drop the LICENSE_FLAGS change from my patch and will send a v5.
jose
Quoted 11 lines
Quoted 2 lines
Agreed, that flag should be independent of whether GPL is there or not.
Cheers,
Richard
Signature · 3 lines
Best regards, José Quaresma