From 0a28a9ef22cbb9d532be97340d5668e8687cca87 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sun, 15 Sep 2024 20:51:50 +0800 Subject: netplan: upgrade 1.0.1 -> 1.1 ChangeLog: https://github.com/canonical/netplan/releases/tag/1.1 * Drop the following patches as the issues have been fixed upstream: 0001-meson.build-drop-unnecessary-build-dependencies.patch 0001-networkd.c-define-scope-specific-to-case-statement.patch * Set build option -Dtesting=false to skip testing. Signed-off-by: Yi Zhao Signed-off-by: Khem Raj --- .../0001-meson.build-do-not-use-Werror.patch | 29 +++++++++++ ...build-drop-unnecessary-build-dependencies.patch | 58 ---------------------- ...c-define-scope-specific-to-case-statement.patch | 47 ------------------ .../0002-meson.build-do-not-use-Werror.patch | 29 ----------- .../recipes-connectivity/netplan/netplan_1.0.1.bb | 53 -------------------- .../recipes-connectivity/netplan/netplan_1.1.bb | 51 +++++++++++++++++++ 6 files changed, 80 insertions(+), 187 deletions(-) create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-do-not-use-Werror.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-drop-unnecessary-build-dependencies.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0002-meson.build-do-not-use-Werror.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.0.1.bb create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.1.bb diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-do-not-use-Werror.patch b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-do-not-use-Werror.patch new file mode 100644 index 0000000000..663a80ecde --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-do-not-use-Werror.patch @@ -0,0 +1,29 @@ +From 668ee79f39614ad758edd44c42b8b0eff57877cf Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Sun, 3 Oct 2021 21:52:16 +0200 +Subject: [PATCH] meson.build: do not use -Werror + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Alexander Kanavin +Signed-off-by: Yi Zhao +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 30f33fe2..0b214795 100644 +--- a/meson.build ++++ b/meson.build +@@ -4,7 +4,7 @@ project('netplan', 'c', + default_options: [ + 'c_std=c99', + 'warning_level=2', +- 'werror=true', ++ 'werror=false', + ], + meson_version: '>= 0.61.0', + ) +-- +2.25.1 + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-drop-unnecessary-build-dependencies.patch b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-drop-unnecessary-build-dependencies.patch deleted file mode 100644 index 860451d972..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-meson.build-drop-unnecessary-build-dependencies.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 6a1a24eb0f30002a4b0049d6cf38d3f2bc3c0209 Mon Sep 17 00:00:00 2001 -From: Yi Zhao -Date: Wed, 6 Mar 2024 19:27:15 +0800 -Subject: [PATCH] meson.build: drop unnecessary build dependencies - -The pytest and pycoverage are required by meson test but not for -building. Mark them as 'required: false' to get rid of unnecessary -build dependencies. - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Yi Zhao ---- - meson.build | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index b29174de..09421d99 100644 ---- a/meson.build -+++ b/meson.build -@@ -25,8 +25,8 @@ bash_completions_dir = completions.get_variable(pkgconfig: 'completionsdir', def - # Order: Fedora/Mageia/openSUSE || Debian/Ubuntu - pyflakes = find_program('pyflakes-3', 'pyflakes3', required: false) - pycodestyle = find_program('pycodestyle-3', 'pycodestyle', 'pep8', required: false) --pytest = find_program('pytest-3', 'pytest3') # also requires the pytest-cov plugin --pycoverage = find_program('coverage-3', 'python3-coverage') -+pytest = find_program('pytest-3', 'pytest3', required: false) # also requires the pytest-cov plugin -+pycoverage = find_program('coverage-3', 'python3-coverage', required: false) - pandoc = find_program('pandoc', required: false) - find = find_program('find') - -@@ -75,6 +75,7 @@ if get_option('unit_testing') - endif - - #FIXME: exclude doc/env/ -+if pyflakes.found() and pycodestyle.found() - test('linting', - pyflakes, - timeout: 100, -@@ -91,7 +92,9 @@ test('legacy-tests', - find_program('tests/cli_legacy.py'), - timeout: 900, - env: test_env) -+endif - #TODO: split out dbus tests into own test() instance, to run in parallel -+if pycoverage.found() - test('unit-tests', - pycoverage, - args: ['run', '-a', '-m', 'pytest', '-s', '-v', '--cov-append', meson.current_source_dir()], -@@ -143,4 +146,5 @@ if get_option('b_coverage') - priority: -99, # run last - is_parallel: false) - endif -+endif - --- -2.25.1 - diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch deleted file mode 100644 index 9f01108a20..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 6e3dd61bf90a7ca8c36c5b95943cbff7c1ad3c2d Mon Sep 17 00:00:00 2001 -From: Yi Zhao -Date: Wed, 6 Mar 2024 16:12:31 +0800 -Subject: [PATCH] networkd.c: define scope specific to case statement - -Per [1], define a scope specific to case statement to fix build with -clang. - -Fixes: -../git/src/networkd.c:544:13: error: expected expression - 544 | gchar* first = g_strcmp0(def->id, def->veth_peer_link->id) < 0 ? def->id : def->veth_peer_link->id; - | ^ -../git/src/networkd.c:545:17: error: use of undeclared identifier 'first' - 545 | if (first != def->id) { - | ^ - -[1] https://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement - -Upstream-Status: Pending - -Signed-off-by: Yi Zhao ---- - src/networkd.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/networkd.c b/src/networkd.c -index 25121c48..5eb9c0fe 100644 ---- a/src/networkd.c -+++ b/src/networkd.c -@@ -541,12 +541,14 @@ write_netdev_file(const NetplanNetDefinition* def, const char* rootdir, const ch - * and, if the selected name is the name of the netdef being written, we generate - * the .netdev file. Otherwise we skip the netdef. - */ -+ { - gchar* first = g_strcmp0(def->id, def->veth_peer_link->id) < 0 ? def->id : def->veth_peer_link->id; - if (first != def->id) { - g_string_free(s, TRUE); - return; - } - g_string_append_printf(s, "Kind=veth\n\n[Peer]\nName=%s\n", def->veth_peer_link->id); -+ } - break; - - case NETPLAN_DEF_TYPE_TUNNEL: --- -2.25.1 - diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0002-meson.build-do-not-use-Werror.patch b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0002-meson.build-do-not-use-Werror.patch deleted file mode 100644 index 663a80ecde..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0002-meson.build-do-not-use-Werror.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 668ee79f39614ad758edd44c42b8b0eff57877cf Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Sun, 3 Oct 2021 21:52:16 +0200 -Subject: [PATCH] meson.build: do not use -Werror - -Upstream-Status: Inappropriate [oe specific] - -Signed-off-by: Alexander Kanavin -Signed-off-by: Yi Zhao ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 30f33fe2..0b214795 100644 ---- a/meson.build -+++ b/meson.build -@@ -4,7 +4,7 @@ project('netplan', 'c', - default_options: [ - 'c_std=c99', - 'warning_level=2', -- 'werror=true', -+ 'werror=false', - ], - meson_version: '>= 0.61.0', - ) --- -2.25.1 - diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.0.1.bb b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.0.1.bb deleted file mode 100644 index 2b1a4ffdab..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.0.1.bb +++ /dev/null @@ -1,53 +0,0 @@ -SUMMARY = "The network configuration abstraction renderer" -DESCRIPTION = "Netplan is a utility for easily configuring networking on a \ -linux system. You simply create a YAML description of the required network \ -interfaces and what each should be configured to do. From this description \ -Netplan will generate all the necessary configuration for your chosen renderer \ -tool." -HOMEPAGE = "https://netplan.io" -SECTION = "net/misc" - -LICENSE = "GPL-3.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" - -inherit meson pkgconfig systemd python3targetconfig features_check - -REQUIRED_DISTRO_FEATURES = "systemd" - -SRC_URI = "git://github.com/CanonicalLtd/netplan.git;branch=stable/1.0;protocol=https \ - file://0001-meson.build-drop-unnecessary-build-dependencies.patch \ - file://0002-meson.build-do-not-use-Werror.patch \ - " - -SRC_URI:append:libc-musl = " file://0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch" -SRC_URI:append:toolchain-clang = " file://0001-networkd.c-define-scope-specific-to-case-statement.patch" - -SRCREV = "3a7516aadaf864ee9d04727977d3d9fd1bccbbda" - -S = "${WORKDIR}/git" - -DEPENDS = "glib-2.0 libyaml util-linux-libuuid \ - systemd python3-cffi-native \ - " - -EXTRA_OEMESON = "-Dunit_testing=false" - -RDEPENDS:${PN} = "python3-core python3-netifaces python3-pyyaml \ - python3-dbus python3-rich python3-cffi \ - python3-json python3-fcntl \ - util-linux-libuuid libnetplan \ - " - -do_install:append() { - install -d -m 755 ${D}${sysconfdir}/netplan -} - -PACKAGES += "${PN}-dbus libnetplan" - -FILES:libnetplan = "${libdir}/libnetplan.so.*" -FILES:${PN} = "${sbindir} ${libexecdir}/netplan/generate \ - ${datadir}/netplan ${datadir}/bash-completion \ - ${systemd_unitdir} ${PYTHON_SITEPACKAGES_DIR} \ - ${sysconfdir}/netplan \ - " -FILES:${PN}-dbus = "${libexecdir}/netplan/netplan-dbus ${datadir}/dbus-1" diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.1.bb b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.1.bb new file mode 100644 index 0000000000..40d72caa0e --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan_1.1.bb @@ -0,0 +1,51 @@ +SUMMARY = "The network configuration abstraction renderer" +DESCRIPTION = "Netplan is a utility for easily configuring networking on a \ +linux system. You simply create a YAML description of the required network \ +interfaces and what each should be configured to do. From this description \ +Netplan will generate all the necessary configuration for your chosen renderer \ +tool." +HOMEPAGE = "https://netplan.io" +SECTION = "net/misc" + +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +inherit meson pkgconfig systemd python3targetconfig features_check + +REQUIRED_DISTRO_FEATURES = "systemd" + +SRC_URI = "git://github.com/CanonicalLtd/netplan.git;branch=main;protocol=https \ + file://0001-meson.build-do-not-use-Werror.patch \ + " + +SRC_URI:append:libc-musl = " file://0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch" + +SRCREV = "d27f32305f7f06de449b32239a89969e6ff2be31" + +S = "${WORKDIR}/git" + +DEPENDS = "glib-2.0 libyaml util-linux-libuuid \ + systemd python3-cffi-native \ + " + +EXTRA_OEMESON = "-Dtesting=false -Dunit_testing=false" + +RDEPENDS:${PN} = "python3-core python3-netifaces python3-pyyaml \ + python3-dbus python3-rich python3-cffi \ + python3-json python3-fcntl \ + util-linux-libuuid libnetplan \ + " + +do_install:append() { + install -d -m 755 ${D}${sysconfdir}/netplan +} + +PACKAGES += "${PN}-dbus libnetplan" + +FILES:libnetplan = "${libdir}/libnetplan.so.*" +FILES:${PN} = "${sbindir} ${libexecdir}/netplan/generate \ + ${datadir}/netplan ${datadir}/bash-completion \ + ${systemd_unitdir} ${PYTHON_SITEPACKAGES_DIR} \ + ${sysconfdir}/netplan \ + " +FILES:${PN}-dbus = "${libexecdir}/netplan/netplan-dbus ${datadir}/dbus-1" -- cgit v1.2.3-54-g00ecf