diff mbox series

[1/1] gawk: Append AGPL-3.0-or-later to LICENSE when pma is enabled

Message ID d619772b36cee9470e7ea8bcb245e98cd8033556.1758264088.git.liezhi.yang@windriver.com
State New
Headers show
Series [1/1] gawk: Append AGPL-3.0-or-later to LICENSE when pma is enabled | expand

Commit Message

Robert Yang Sept. 19, 2025, 6:48 a.m. UTC
From: Robert Yang <liezhi.yang@windriver.com>

The support/pma.c and support/pma.h's license is AGPL-3.0-or-later, this patch
disables pma by default, and append AGPL-3.0-or-later to LICENSE when pma is
enabled, and print a warning for that.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-extended/gawk/gawk_5.3.2.bb | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Alexander Kanavin Sept. 19, 2025, 10:25 a.m. UTC | #1
On Fri, 19 Sept 2025 at 08:48, Robert Yang via lists.openembedded.org
<liezhi.yang=windriver.com@lists.openembedded.org> wrote:
>  PACKAGECONFIG ??= "readline mpfr"
>  PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
>  PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
> +PACKAGECONFIG[pma] = ",--disable-pma"

This needs --enable-pma too, to avoid a floating feature enablement/disablement.

> +python() {
> +    packageconfig = (d.getVar('PACKAGECONFIG') or '').split()
> +    # The support/pma.c and support/pma.h's license is AGPL-3.0-or-later
> +    if 'pma' in packageconfig:
> +        bb.warn("Appending AGPL-3.0-or-later to LICENSE since pma is enabled")
> +        d.appendVar('LICENSE', ' & AGPL-3.0-or-later')
> +        d.appendVar('LIC_FILES_CHKSUM', ' file://support/pma.h;endline=21;md5=32bd750ee5aa5cbcf7978c1be6462b8a \
> +                    file://support/pma.c;endline=28;md5=a3f33ec236ab96537cdfd1dcda270c75')

This should be set unconditionally, as it is specifying source code
licenses that apply regardless of build time choices. Then you can set
licenses for a particular package(s) to include AGPL or not depending
on packageconfig, but I believe that too can be done without resorting
to anonymous python.

Alex
Peter Kjellerstedt Sept. 19, 2025, 2:04 p.m. UTC | #2
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Alexander Kanavin via lists.openembedded.org
> Sent: den 19 september 2025 12:25
> To: liezhi.yang@windriver.com
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 1/1] gawk: Append AGPL-3.0-or-later to LICENSE when pma is enabled
> 
> On Fri, 19 Sept 2025 at 08:48, Robert Yang via lists.openembedded.org <liezhi.yang=windriver.com@lists.openembedded.org> wrote:
> >  PACKAGECONFIG ??= "readline mpfr"
> >  PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
> >  PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
> > +PACKAGECONFIG[pma] = ",--disable-pma"
> 
> This needs --enable-pma too, to avoid a floating feature
> enablement/disablement.
> 
> > +python() {
> > +    packageconfig = (d.getVar('PACKAGECONFIG') or '').split()
> > +    # The support/pma.c and support/pma.h's license is AGPL-3.0-or-later
> > +    if 'pma' in packageconfig:
> > +        bb.warn("Appending AGPL-3.0-or-later to LICENSE since pma is enabled")
> > +        d.appendVar('LICENSE', ' & AGPL-3.0-or-later')
> > +        d.appendVar('LIC_FILES_CHKSUM', ' file://support/pma.h;endline=21;md5=32bd750ee5aa5cbcf7978c1be6462b8a \
> > +                    file://support/pma.c;endline=28;md5=a3f33ec236ab96537cdfd1dcda270c75')
> 
> This should be set unconditionally, as it is specifying source code
> licenses that apply regardless of build time choices. Then you can set
> licenses for a particular package(s) to include AGPL or not depending
> on packageconfig, but I believe that too can be done without resorting
> to anonymous python.
> 
> Alex

You can find an example of this being done in the cairo recipe.

//Peter
Robert Yang Sept. 21, 2025, 3:11 p.m. UTC | #3
On 9/19/25 22:04, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Alexander Kanavin via lists.openembedded.org
>> Sent: den 19 september 2025 12:25
>> To: liezhi.yang@windriver.com
>> Cc: openembedded-core@lists.openembedded.org
>> Subject: Re: [OE-core] [PATCH 1/1] gawk: Append AGPL-3.0-or-later to LICENSE when pma is enabled
>>
>> On Fri, 19 Sept 2025 at 08:48, Robert Yang via lists.openembedded.org <liezhi.yang=windriver.com@lists.openembedded.org> wrote:
>>>   PACKAGECONFIG ??= "readline mpfr"
>>>   PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
>>>   PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
>>> +PACKAGECONFIG[pma] = ",--disable-pma"
>>
>> This needs --enable-pma too, to avoid a floating feature
>> enablement/disablement.
>>
>>> +python() {
>>> +    packageconfig = (d.getVar('PACKAGECONFIG') or '').split()
>>> +    # The support/pma.c and support/pma.h's license is AGPL-3.0-or-later
>>> +    if 'pma' in packageconfig:
>>> +        bb.warn("Appending AGPL-3.0-or-later to LICENSE since pma is enabled")
>>> +        d.appendVar('LICENSE', ' & AGPL-3.0-or-later')
>>> +        d.appendVar('LIC_FILES_CHKSUM', ' file://support/pma.h;endline=21;md5=32bd750ee5aa5cbcf7978c1be6462b8a \
>>> +                    file://support/pma.c;endline=28;md5=a3f33ec236ab96537cdfd1dcda270c75')
>>
>> This should be set unconditionally, as it is specifying source code
>> licenses that apply regardless of build time choices. Then you can set
>> licenses for a particular package(s) to include AGPL or not depending
>> on packageconfig, but I believe that too can be done without resorting
>> to anonymous python.
>>
>> Alex
> 
> You can find an example of this being done in the cairo recipe.

Thanks Alex and Peter, I will send a V2 for it.

// Robert

> 
> //Peter
>
diff mbox series

Patch

diff --git a/meta/recipes-extended/gawk/gawk_5.3.2.bb b/meta/recipes-extended/gawk/gawk_5.3.2.bb
index 833fe78bf9a..75fce0c08a6 100644
--- a/meta/recipes-extended/gawk/gawk_5.3.2.bb
+++ b/meta/recipes-extended/gawk/gawk_5.3.2.bb
@@ -6,14 +6,14 @@  HOMEPAGE = "https://www.gnu.org/software/gawk/"
 BUGTRACKER  = "bug-gawk@gnu.org"
 SECTION = "console/utils"
 
-# gawk <= 3.1.5: GPL-2.0-only
-# gawk >= 3.1.6: GPL-3.0-only
+# The LICENSE will be "GPL-3.0-only & AGPL-3.0-or-later" when pma is enabled.
 LICENSE = "GPL-3.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 PACKAGECONFIG ??= "readline mpfr"
 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
+PACKAGECONFIG[pma] = ",--disable-pma"
 
 SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
            file://run-ptest \
@@ -34,6 +34,16 @@  ALTERNATIVE:${PN} = "awk"
 ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
 ALTERNATIVE_PRIORITY = "100"
 
+python() {
+    packageconfig = (d.getVar('PACKAGECONFIG') or '').split()
+    # The support/pma.c and support/pma.h's license is AGPL-3.0-or-later
+    if 'pma' in packageconfig:
+        bb.warn("Appending AGPL-3.0-or-later to LICENSE since pma is enabled")
+        d.appendVar('LICENSE', ' & AGPL-3.0-or-later')
+        d.appendVar('LIC_FILES_CHKSUM', ' file://support/pma.h;endline=21;md5=32bd750ee5aa5cbcf7978c1be6462b8a \
+                    file://support/pma.c;endline=28;md5=a3f33ec236ab96537cdfd1dcda270c75')
+}
+
 do_install:append() {
 	# remove the link since we don't package it
 	rm ${D}${bindir}/awk