socat: turn hard readline dependency into an option
PATCH 1/10 socat: turn hard readline dependency into an option
--- meta/recipes-connectivity/socat/socat_1.7.3.3.bb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-connectivity/socat/socat_1.7.3.3.bb +4 -3
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.dest-unreach.org/socat/" SECTION = "console/network" -DEPENDS = "openssl readline" +DEPENDS = "openssl" LICENSE = "GPL-2.0-with-OpenSSL-exception" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
@@ -39,9 +39,10 @@ TERMBITS_SHIFTS_powerpc64 = "sc_cv_sys_crdly_shift=12 \ sc_cv_sys_tabdly_shift=10 \ sc_cv_sys_csize_shift=8" -PACKAGECONFIG_class-target ??= "tcp-wrappers" -PACKAGECONFIG ??= "" +PACKAGECONFIG_class-target ??= "tcp-wrappers readline" +PACKAGECONFIG ??= "readline" PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" +PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline" do_install_prepend () { mkdir -p ${D}${bindir}
Signature · 1 line
2.17.1
PATCH 2/10 perl: make gdbm optional
Recent versions of gdbm are gplv3, so in some scenarios it is beneficial to not depend on it.
(thanks Ross for leading the way with the db option :)
--- meta/recipes-devtools/perl/perl_5.30.0.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/perl/perl_5.30.0.bb +3 -2
@@ -35,12 +35,13 @@ S = "${WORKDIR}/perl-${PV}" inherit upstream-version-is-even -DEPENDS += "gdbm zlib virtual/crypt" +DEPENDS += "zlib virtual/crypt" PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0" -PACKAGECONFIG ??= "bdb" +PACKAGECONFIG ??= "bdb gdbm" PACKAGECONFIG[bdb] = ",-Ui_db,db" +PACKAGECONFIG[gdbm] = ",-Ui_gdbm,gdbm" # Don't generate comments in enc2xs output files. They are not reproducible export ENC2XS_NO_COMMENTS = "1"
Signature · 1 line
2.17.1
PATCH 3/10 python3: make gdbm optional
In reply to Alexander KanavinThe use case is building a gpl3-free image, without having to rely on outdated recipes from meta-gplv2 layer.
--- ...fig-append-STAGING_LIBDIR-python-sys.patch | 10 +++--- ...ON3HOME-is-set-use-instead-of-PYTHON.patch | 10 +++--- ...report-missing-dependencies-for-disa.patch | 31 +++++++++++++++++++ ...tutils-prefix-is-inside-staging-area.patch | 2 +- meta/recipes-devtools/python/python3_3.7.4.bb | 22 +++++++++---- 5 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch +5 -5
@@ -1,4 +1,4 @@ -From 17796e353acf08acd604610f34840a4a9d2f4b54 Mon Sep 17 00:00:00 2001 +From eff903c600f4c40f5753e95ab1557126fc6e0c9c Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Thu, 31 Jan 2019 16:46:30 +0100 Subject: [PATCH] distutils/sysconfig: append
@@ -15,10 +15,10 @@ Signed-off-by: Alexander Kanavin <[email protected]> 2 files changed, 4 insertions(+) diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index e07a6c8..6b8c129 100644 +index 0a034ee..3dfd0a3 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -421,6 +421,8 @@ def _init_posix(): +@@ -439,6 +439,8 @@ def _init_posix(): platform=sys.platform, multiarch=getattr(sys.implementation, '_multiarch', ''), ))
@@ -28,10 +28,10 @@ index e07a6c8..6b8c129 100644 build_time_vars = _temp.build_time_vars global _config_vars diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 9ee4d31..e586abd 100644 +index 87fa5e6..756a41c 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -412,6 +412,8 @@ def _init_posix(vars): +@@ -419,6 +419,8 @@ def _init_posix(vars): """Initialize the module as appropriate for POSIX systems.""" # _sysconfigdata is generated at build time, see _generate_posix_vars() name = _get_sysconfigdata_name()
meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch +4 -6
@@ -1,4 +1,4 @@ -From ffe7797637f08cd6ee4c82e2d67462c5e194d30a Mon Sep 17 00:00:00 2001 +From 5ce3ac59531828ff682646fbba59b2126b28a8aa Mon Sep 17 00:00:00 2001 From: Jaewon Lee <[email protected]> Date: Thu, 25 Apr 2019 15:34:26 -0700 Subject: [PATCH] main.c: if OEPYTHON3HOME is set use instead of PYTHONHOME
@@ -12,15 +12,16 @@ to set a different path for python3 Signed-off-by: Jaewon Lee <[email protected]> Upstream-Status: Inappropriate [OE specific configuration] + --- Modules/main.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Modules/main.c b/Modules/main.c -index a745381..b553e30 100644 +index acc59c6..407085a 100644 --- a/Modules/main.c +++ b/Modules/main.c -@@ -1855,10 +1855,19 @@ config_init_home(_PyCoreConfig *config) +@@ -1834,10 +1834,19 @@ config_init_home(_PyCoreConfig *config) } return _Py_INIT_OK(); }
@@ -44,6 +45,3 @@ index a745381..b553e30 100644 } config->home = home; return _Py_INIT_OK(); --- -2.7.4 -
meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch new file +31 -0
@@ -0,0 +1,31 @@ +From e3b59cb9658e1d3efa3535840939a0fa92a70a5a Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Mon, 7 Oct 2019 13:22:14 +0200 +Subject: [PATCH] setup.py: do not report missing dependencies for disabled + modules + +Reporting those missing dependencies is misleading as the modules would not +have been built anyway. This particularly matters in oe-core's automated +build completeness checker which relies on the report. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <[email protected]> +--- + setup.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/setup.py b/setup.py +index 4b53668..0097643 100644 +--- a/setup.py ++++ b/setup.py +@@ -365,6 +365,10 @@ class PyBuildExt(build_ext): + print("%-*s %-*s %-*s" % (longest, e, longest, f, + longest, g)) + ++ # There is no need to report missing module dependencies, ++ # if the modules have been disabled in the first place. ++ missing = list(set(missing) - set(sysconf_dis)) ++ + if missing: + print() + print("Python build finished successfully!")
meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch +1 -1
@@ -1,4 +1,4 @@ -From 6229502e5ae6cbb22240594f002638e9ef78f831 Mon Sep 17 00:00:00 2001 +From a274ba778838824efcacaba57c415b7262f779ec Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Tue, 14 May 2013 15:00:26 -0700 Subject: [PATCH] python3: Add target and native recipes
meta/recipes-devtools/python/python3_3.7.4.bb +16 -6
@@ -23,11 +23,12 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0003-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \ file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \ file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \ - file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \ - file://crosspythonpath.patch \ + file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \ + file://crosspythonpath.patch \ file://reformat_sysconfig.py \ file://0001-Use-FLAG_REF-always-for-interned-strings.patch \ file://0001-test_locale.py-correct-the-test-output-format.patch \ + file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \ " SRC_URI_append_class-native = " \
@@ -62,7 +63,7 @@ ALTERNATIVE_LINK_NAME[python-config] = "${bindir}/python${PYTHON_BINABI}-config" ALTERNATIVE_TARGET[python-config] = "${bindir}/python${PYTHON_BINABI}-config-${MULTILIB_SUFFIX}" -DEPENDS = "bzip2-replacement-native libffi bzip2 gdbm openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2" +DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2" DEPENDS_append_class-target = " python3-native" DEPENDS_append_class-nativesdk = " python3-native"
@@ -87,13 +88,22 @@ python() { d.setVar('PACKAGECONFIG_PGO', '') } -PACKAGECONFIG_class-target ??= "readline ${PACKAGECONFIG_PGO}" -PACKAGECONFIG_class-native ??= "readline" -PACKAGECONFIG_class-nativesdk ??= "readline" +PACKAGECONFIG_class-target ??= "readline ${PACKAGECONFIG_PGO} gdbm" +PACKAGECONFIG_class-native ??= "readline gdbm" +PACKAGECONFIG_class-nativesdk ??= "readline gdbm" PACKAGECONFIG[readline] = ",,readline" # Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native" PACKAGECONFIG[tk] = ",,tk" +PACKAGECONFIG[gdbm] = ",,gdbm" + +do_configure_prepend () { + mkdir -p ${B}/Modules + cat > ${B}/Modules/Setup.local << EOF +*disabled* +${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)} +EOF +} CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid"
Signature · 1 line
2.17.1
PATCH 4/10 python3: un-break disabling the readline PACKAGECONFIG
In reply to Alexander KanavinPreviously the readline module would have been built regardless of readline's presence in the sysroot, and the recipe would fail at package_qa.
--- meta/recipes-devtools/python/python3_3.7.4.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3_3.7.4.bb +1 -0
@@ -102,6 +102,7 @@ do_configure_prepend () { cat > ${B}/Modules/Setup.local << EOF *disabled* ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)} +${@bb.utils.contains('PACKAGECONFIG', 'readline', '', 'readline', d)} EOF }
Signature · 1 line
2.17.1
PATCH 5/10 libcheck: split /usr/bin/checkmk into its own package
In reply to Alexander KanavinThis allows not pulling in gawk, which is gplv3 licensed when only the libcheck library itself is needed. checkmk is a development tool that writes out a C boilerplate for tests.
--- meta/recipes-support/libcheck/libcheck_0.12.0.bb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
meta/recipes-support/libcheck/libcheck_0.12.0.bb +7 -2
@@ -18,7 +18,12 @@ inherit autotools pkgconfig texinfo CACHED_CONFIGUREVARS += "ac_cv_path_AWK_PATH=${bindir}/gawk" RREPLACES_${PN} = "check (<= 0.9.5)" -RDEPENDS_${PN} += "gawk" -RDEPENDS_${PN}_class-native = "" BBCLASSEXTEND = "native nativesdk" + +PACKAGES =+ "checkmk" + +FILES_checkmk = "${bindir}/checkmk" + +RDEPENDS_checkmk = "gawk" +
Signature · 1 line
2.17.1
PATCH 6/10 iproute2: make elfutils support optional
In reply to Alexander KanavinThe use case is as well allowing gpl3-free builds without pulling in outdated meta-gpl2 recipes.
--- meta/recipes-connectivity/iproute2/iproute2.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +3 -2
@@ -9,14 +9,15 @@ LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \ file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817" -DEPENDS = "flex-native bison-native iptables elfutils libcap" +DEPENDS = "flex-native bison-native iptables libcap" inherit update-alternatives bash-completion pkgconfig CLEANBROKEN = "1" -PACKAGECONFIG ??= "tipc" +PACKAGECONFIG ??= "tipc elf" PACKAGECONFIG[tipc] = ",,libmnl," +PACKAGECONFIG[elf] = ",,elfutils," EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \ ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
Signature · 1 line
2.17.1
PATCH 7/10 bind: do not RDEPEND on bash
In reply to Alexander KanavinNothing in the target installation actually needs it.
--- meta/recipes-connectivity/bind/bind_9.11.5-P4.bb | 2 -- 1 file changed, 2 deletions(-)
meta/recipes-connectivity/bind/bind_9.11.5-P4.bb +0 -2
@@ -133,7 +133,5 @@ PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3- FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" -RDEPENDS_${PN} = "bash" -RDEPENDS_${PN}-utils = "bash" RDEPENDS_${PN}-dev = "" RDEPENDS_python3-bind = "python3-core python3-ply"
Signature · 1 line
2.17.1
PATCH 8/10 elfutils: do not depend on target libtool
In reply to Alexander KanavinThis seems to be entirely unneeded.
--- meta/recipes-devtools/elfutils/elfutils_0.177.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/elfutils/elfutils_0.177.bb +1 -1
@@ -3,7 +3,7 @@ HOMEPAGE = "https://sourceware.org/elfutils" SECTION = "base" LICENSE = "GPLv2 & LGPLv3+ & GPLv3+" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" -DEPENDS = "libtool bzip2 zlib virtual/libintl" +DEPENDS = "bzip2 zlib virtual/libintl" DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " # The Debian patches below are from: # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz
Signature · 1 line
2.17.1
PATCH 9/10 license.bbclass: split incompatible license check into a helper function
In reply to Alexander KanavinThis would help with checking incompatible licenses at do_rootfs step in image creation, where it is beneficial to pass the license string directly to the function.
--- meta/classes/license.bbclass | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
meta/classes/license.bbclass +14 -11
@@ -287,17 +287,7 @@ def incompatible_license_contains(license, truevalue, falsevalue, d): bad_licenses = expand_wildcard_licenses(d, bad_licenses) return truevalue if license in bad_licenses else falsevalue -def incompatible_license(d, dont_want_licenses, package=None): - """ - This function checks if a recipe has only incompatible licenses. It also - take into consideration 'or' operand. dont_want_licenses should be passed - as canonical (SPDX) names. - """ - import oe.license - license = d.getVar("LICENSE_%s" % package) if package else None - if not license: - license = d.getVar('LICENSE') - +def incompatible_pkg_license(d, dont_want_licenses, license): # Handles an "or" or two license sets provided by # flattened_licenses(), pick one that works if possible. def choose_lic_set(a, b):
@@ -311,6 +301,19 @@ def incompatible_license(d, dont_want_licenses, package=None): return any(not oe.license.license_ok(canonical_license(d, l), \ dont_want_licenses) for l in licenses) +def incompatible_license(d, dont_want_licenses, package=None): + """ + This function checks if a recipe has only incompatible licenses. It also + take into consideration 'or' operand. dont_want_licenses should be passed + as canonical (SPDX) names. + """ + import oe.license + license = d.getVar("LICENSE_%s" % package) if package else None + if not license: + license = d.getVar('LICENSE') + + return incompatible_pkg_license(d, dont_want_licenses, license) + def check_license_flags(d): """ This function checks if a recipe has any LICENSE_FLAGS that
Signature · 1 line
2.17.1
PATCH 10/10 license_image.bbclass: check and reject packages which have incompatible licenses
In reply to Alexander KanavinThe use case is setting INCOMPATIBLE_LICENSE per image, rather than as an awkward, and too strict global setting.
This for example would allow building development images with gplv3 tools, but production images without them, and checking that nothing gpl3-licensed gets into the latter.
Examples are provided via the selftest: four scenarios are tested:
- bash is added to the image, with a default gpl3 license; this is rejected
- bash is added to the image, with a "gpl3 & other" license; this is also rejected
- bash is added to the image, with a "gpl3 | other" license; this is accepted, but only 'other' is added to the license manifest (this was already handled correctly previously).
- bash is added to the image with a default gpl3 license, and is additionally whitelisted for that image; this is accepted.
Eventually, this would allow deprecating the meta-gplv2 layer, while still enforcing the no-gpl3 rule where possible and needed.
--- meta/classes/license_image.bbclass | 10 +++++- .../oeqa/selftest/cases/incompatible_lic.py | 34 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-)
meta/classes/license_image.bbclass +9 -1
@@ -43,10 +43,16 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): bad_licenses = [canonical_license(d, l) for l in bad_licenses] bad_licenses = expand_wildcard_licenses(d, bad_licenses) + whitelist = [] + for lic in bad_licenses: + whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split()) + with open(license_manifest, "w") as license_file: for pkg in sorted(pkg_dic): - if bad_licenses: + if bad_licenses and pkg not in whitelist: try: + if incompatible_pkg_license(d, bad_licenses, pkg_dic[pkg]["LICENSE"]): + bb.fatal("Package %s has an incompatible license %s and cannot be installed into the image." %(pkg, pkg_dic[pkg]["LICENSE"])) (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \ oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"], bad_licenses, canonical_license, d)
@@ -56,6 +62,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): pkg_dic[pkg]["LICENSES"] = re.sub(r'[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() + if pkg in whitelist: + bb.warn("Including %s with an incompatible license %s into the image, because it has been whitelisted." %(pkg, pkg_dic[pkg]["LICENSE"])) if not "IMAGE_MANIFEST" in pkg_dic[pkg]: # Rootfs manifest
meta/lib/oeqa/selftest/cases/incompatible_lic.py +34 -0
@@ -39,3 +39,37 @@ class IncompatibleLicenseTests(OESelftestTestCase): # INCOMPATIBLE_LICENSE contains this license def test_incompatible_nonspdx_license(self): self.lic_test('incompatible-nonspdx-license', 'FooLicense', 'FooLicense') + +class IncompatibleLicensePerImageTests(OESelftestTestCase): + def default_config(self): + return """ +IMAGE_INSTALL_append = "bash" +INCOMPATIBLE_LICENSE_pn-core-image-minimal = "GPL-3.0 LGPL-3.0" +""" + + def test_bash_default(self): + self.write_config(self.default_config()) + error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash has an incompatible license GPLv3+ and cannot be installed into the image." + + result = bitbake('core-image-minimal', ignore_status=True) + if error_msg not in result.output: + raise AssertionError(result.output) + + def test_bash_and_license(self): + self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " & SomeLicense"') + error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash has an incompatible license GPLv3+ & SomeLicense and cannot be installed into the image." + + result = bitbake('core-image-minimal', ignore_status=True) + if error_msg not in result.output: + raise AssertionError(result.output) + + def test_bash_or_license(self): + self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " | SomeLicense"') + + bitbake('core-image-minimal') + + def test_bash_whitelist(self): + self.write_config(self.default_config() + '\nWHITELIST_GPL-3.0_pn-core-image-minimal = "bash"') + + bitbake('core-image-minimal') +
Signature · 1 line
2.17.1