diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2024-02-25 10:37:26 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-27 14:31:35 +0000 |
| commit | bb4abe0e6468f8be3fdd6012a109ddd1db7b20a8 (patch) | |
| tree | 13142caef70cad90c563526d35b3cdf7ced8408a | |
| parent | ea5a74cc675d104afedc4428c710091a56817e10 (diff) | |
| download | poky-bb4abe0e6468f8be3fdd6012a109ddd1db7b20a8.tar.gz | |
glib-2.0: backport a switch from distutils to packaging in codegen
* to fix build on hosts with python-3.12, now it fails with:
Traceback (most recent call last):
File "recipe-sysroot-native/usr/bin/gdbus-codegen", line 53, in <module>
from codegen import codegen_main
File "recipe-sysroot-native/usr/share/glib-2.0/codegen/codegen_main.py", line 29, in <module>
from . import dbustypes
File "recipe-sysroot-native/usr/share/glib-2.0/codegen/dbustypes.py", line 22, in <module>
from . import utils
File "recipe-sysroot-native/usr/share/glib-2.0/codegen/utils.py", line 22, in <module>
import distutils.version
ModuleNotFoundError: No module named 'distutils'
CMake Error at CMakeLists.txt:90 (message):
Error in generating code for connman interface using gdbus-codegen
(From OE-Core rev: 258cb46f93af3249fb554a679af6222174bd2e95)
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 36 insertions, 3 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch new file mode 100644 index 0000000000..50368ed22c --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 05f0674c93d94fe6b29c1b707980aac469ddcd72 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jordan Williams <jordan@jwillikers.com> | ||
| 3 | Date: Fri, 1 Dec 2023 09:53:50 -0600 | ||
| 4 | Subject: [PATCH] Switch from the deprecated distutils module to the packaging | ||
| 5 | module | ||
| 6 | |||
| 7 | The distutils module was removed in Python 3.12. | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/6ef967a0f930ce37a8c9b5aff969693b34714291] | ||
| 10 | |||
| 11 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
| 12 | --- | ||
| 13 | gio/gdbus-2.0/codegen/utils.py | 4 ++-- | ||
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py | ||
| 17 | index 0204610..08f1ba9 100644 | ||
| 18 | --- a/gio/gdbus-2.0/codegen/utils.py | ||
| 19 | +++ b/gio/gdbus-2.0/codegen/utils.py | ||
| 20 | @@ -19,7 +19,7 @@ | ||
| 21 | # | ||
| 22 | # Author: David Zeuthen <davidz@redhat.com> | ||
| 23 | |||
| 24 | -import distutils.version | ||
| 25 | +import packaging.version | ||
| 26 | import os | ||
| 27 | import sys | ||
| 28 | |||
| 29 | @@ -166,4 +166,4 @@ def version_cmp_key(key): | ||
| 30 | v = str(key[0]) | ||
| 31 | else: | ||
| 32 | v = "0" | ||
| 33 | - return (distutils.version.LooseVersion(v), key[1]) | ||
| 34 | + return (packaging.version.Version(v), key[1]) | ||
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb index 42814ba544..6c3e99c641 100644 --- a/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.78.3.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ | |||
| 14 | file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ | 14 | file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ |
| 15 | file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ | 15 | file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ |
| 16 | file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ | 16 | file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ |
| 17 | file://0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch \ | ||
| 17 | file://memory-monitor.patch \ | 18 | file://memory-monitor.patch \ |
| 18 | file://native-gtkdoc.patch \ | 19 | file://native-gtkdoc.patch \ |
| 19 | " | 20 | " |
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc index 5a57549d85..fac8875d84 100644 --- a/meta/recipes-core/glib-2.0/glib.inc +++ b/meta/recipes-core/glib-2.0/glib.inc | |||
| @@ -144,9 +144,7 @@ do_install:append:mingw32() { | |||
| 144 | rm -f ${D}${bindir}/gtester-report | 144 | rm -f ${D}${bindir}/gtester-report |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | # remove setuptools dependency when usage of distutils is dropped in | 147 | CODEGEN_PYTHON_RDEPENDS = "python3 python3-packaging python3-xml" |
| 148 | # https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/gdbus-2.0/codegen/utils.py | ||
| 149 | CODEGEN_PYTHON_RDEPENDS = "python3 python3-setuptools python3-xml" | ||
| 150 | CODEGEN_PYTHON_RDEPENDS:mingw32 = "" | 148 | CODEGEN_PYTHON_RDEPENDS:mingw32 = "" |
| 151 | 149 | ||
| 152 | RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}" | 150 | RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}" |
