-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0104b79
commit 4014351
Showing
5 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
ports/glib/0005-pr-4133-4143-avoid-package-packaging.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py | ||
index 08f1ba9..af803c0 100644 | ||
--- a/gio/gdbus-2.0/codegen/utils.py | ||
+++ b/gio/gdbus-2.0/codegen/utils.py | ||
@@ -19,10 +19,9 @@ | ||
# | ||
# Author: David Zeuthen <[email protected]> | ||
|
||
-import packaging.version | ||
import os | ||
import sys | ||
- | ||
+import re | ||
|
||
# pylint: disable=too-few-public-methods | ||
class Color: | ||
@@ -166,4 +165,28 @@ def version_cmp_key(key): | ||
v = str(key[0]) | ||
else: | ||
v = "0" | ||
- return (packaging.version.Version(v), key[1]) | ||
+ return (_parse_version(v), key[1]) | ||
+ | ||
+ | ||
+def _parse_version(version): | ||
+ """ | ||
+ Parse a version string into a list of integers and strings. | ||
+ | ||
+ This function takes a version string and breaks it down into its component parts. | ||
+ It separates numeric and non-numeric segments, converting numeric segments to integers. | ||
+ | ||
+ Args: | ||
+ version (str): The version string to parse. | ||
+ | ||
+ Returns: | ||
+ list: A list where each element is either an integer (for numeric parts) | ||
+ or a string (for non-numeric parts). | ||
+ | ||
+ Example: | ||
+ >>> parseversion("1.2.3a") | ||
+ [1, 2, 3, 'a'] | ||
+ >>> parseversion("2.0.0-rc1") | ||
+ [2, 0, 0, 'rc1'] | ||
+ """ | ||
+ blocks = re.findall(r"(\d+|\w+)", version) | ||
+ return [int(b) if b.isdigit() else b for b in blocks] | ||
diff --git a/meson.build b/meson.build | ||
index a400965..576a939 100644 | ||
--- a/meson.build | ||
+++ b/meson.build | ||
@@ -2420,7 +2420,7 @@ endif | ||
|
||
glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) | ||
|
||
-python = import('python').find_installation(modules: ['packaging']) | ||
+python = import('python').find_installation() | ||
# used for '#!/usr/bin/env <name>' | ||
python_name = 'python3' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters