nftables: fix pep517-backend warning

nftables has a pyproject.toml file since v1.0.9, c.f.
https://git.netfilter.org/nftables/commit/?id=8e603e0f7eec7c0000344a004228a30fbf0ece5c

Styhead has started to complain when a recipe inherits setuptools3 and a
proper pyproject.toml is provided in sources.

This uses python_pep517 functions instead of the setuptools3 ones,
inherits the proper class (still using setuptools3 but through pep517
process).

Notably, the python PACKAGECONFIG has its build dependency on
python3-setuptools-native removed as it's brought in by
python_setuptools_build_meta inherit, which is performed whenever the
python PACKAGECONFIG is selected. This avoids a "duplicate" but no
change in behavior is expected.

This was only build tested.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Quentin Schulz 2024-08-21 18:33:09 +02:00 committed by Khem Raj
parent 990955ba09
commit 21a87a422c
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -24,16 +24,16 @@ PACKAGECONFIG[json] = "--with-json, --without-json, jansson"
PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline"
PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native"
PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp"
PACKAGECONFIG[python] = ",, python3-setuptools-native"
PACKAGECONFIG[python] = ""
PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise"
PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables"
EXTRA_OECONF = " \
${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}"
SETUPTOOLS_SETUP_PATH = "${S}/py"
PEP517_SOURCE_PATH = "${S}/py"
inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3', '', d)}
inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python_setuptools_build_meta', '', d)}
PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)}"
FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
@ -44,21 +44,21 @@ RDEPENDS:${PN}-python = "python3-core python3-json ${PN}"
do_configure() {
autotools_do_configure
if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
setuptools3_do_configure
python_pep517_do_configure
fi
}
do_compile() {
autotools_do_compile
if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
setuptools3_do_compile
python_pep517_do_compile
fi
}
do_install() {
autotools_do_install
if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
setuptools3_do_install
python_pep517_do_install
fi
}