Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glib/2.78.x: Add patch to support Python 3.12 #21535

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions recipes/glib/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.79.2":
url: "https://download.gnome.org/sources/glib/2.79/glib-2.79.2.tar.xz"
sha256: "a47f7ecf7bba0346e6cd562887b93ee4ee37a57d8dcae0755f0de8dc75ca5e8c"
"2.78.3":
url: "https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz"
sha256: "609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21"
Expand Down Expand Up @@ -27,6 +30,21 @@ sources:
url: "https://download.gnome.org/sources/glib/2.75/glib-2.75.3.tar.xz"
sha256: "7c517d0aff456c35a039bce8a8df7a08ce95a8285b09d1849f8865f633f7f871"
patches:
"2.78.3":
- patch_file: "patches/0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch"
patch_type: "portability"
patch_description: "Replace the distutils module to support Python 3.12"
patch_source: "https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3740"
"2.78.1":
- patch_file: "patches/0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch"
patch_type: "portability"
patch_description: "Replace the distutils module to support Python 3.12"
patch_source: "https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3740"
"2.78.0":
- patch_file: "patches/0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch"
patch_type: "portability"
patch_description: "Replace the distutils module to support Python 3.12"
patch_source: "https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3740"
"2.76.3":
- patch_file: "patches/libintl-discovery.patch"
patch_type: bugfix
Expand Down
4 changes: 2 additions & 2 deletions recipes/glib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def requirements(self):
self.requires("libiconv/1.17")

def build_requirements(self):
self.tool_requires("meson/1.2.2")
self.tool_requires("meson/1.3.2")
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/2.1.0")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 45edf065cb7d02b466761083a6860f3ef2b149fe Mon Sep 17 00:00:00 2001
From: Jordan Williams <jordan@jwillikers.com>
Date: Fri, 1 Dec 2023 09:55:02 -0600
Subject: [PATCH] Switch from the deprecated distutils module to the packaging
module

The distutils module was removed in Python 3.12.
---
gio/gdbus-2.0/codegen/utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
index 02046108d..08f1ba973 100644
--- a/gio/gdbus-2.0/codegen/utils.py
+++ b/gio/gdbus-2.0/codegen/utils.py
@@ -19,7 +19,7 @@
#
# Author: David Zeuthen <davidz@redhat.com>

-import distutils.version
+import packaging.version
import os
import sys

@@ -166,4 +166,4 @@ def version_cmp_key(key):
v = str(key[0])
else:
v = "0"
- return (distutils.version.LooseVersion(v), key[1])
+ return (packaging.version.Version(v), key[1])
--
2.43.0

2 changes: 1 addition & 1 deletion recipes/glib/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def requirements(self):

def build_requirements(self):
if self.settings.os != "Windows" and not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/2.1.0")

def generate(self):
tc = CMakeToolchain(self)
Expand Down
2 changes: 1 addition & 1 deletion recipes/glib/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestPackageConan(ConanFile):

def build_requirements(self):
if self.settings.os != "Windows":
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/2.1.0")

def build(self):
if self.settings.os != "Windows":
Expand Down
2 changes: 2 additions & 0 deletions recipes/glib/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"2.79.2":
folder: all
"2.78.3":
folder: all
"2.78.1":
Expand Down
Loading