summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2025-10-21 13:15:40 +0200
committerMathieu Othacehe <othacehe@gnu.org>2025-11-02 20:29:37 +0100
commite235b9574ab0b3f10638cd5cac367b9b484d0437 (patch)
treeeff6c73813121ee5bc0223afb2aa25f449698880 /gnu
parenta5e6ad127e816382dc73af600703895aa27833ee (diff)
gnu: 389-ds-base: Fix LegacyVersion issue.
LegacyVersion does not exist anymore in packaging.version 25.0 (https://github.com/pypa/packaging/pull/407). Add a stub to prevent runtime errors such as: Traceback (most recent call last): File "/gnu/store/jq8iknqq5niwx9vchccbnnw6jdb3x8nq-389-ds-base-2.2.2/sbin/.dscreate-real", line 18, in <module> from lib389 import DirSrv File "/gnu/store/jq8iknqq5niwx9vchccbnnw6jdb3x8nq-389-ds-base-2.2.2/lib/python3.11/site-packages/lib389/__init__.py", line 54, in <module> from lib389._entry import Entry File "/gnu/store/jq8iknqq5niwx9vchccbnnw6jdb3x8nq-389-ds-base-2.2.2/lib/python3.11/site-packages/lib389/_entry.py", line 20, in <module> from lib389.utils import (ensure_str, ensure_bytes, ensure_list_bytes, display_log_data) File "/gnu/store/jq8iknqq5niwx9vchccbnnw6jdb3x8nq-389-ds-base-2.2.2/lib/python3.11/site-packages/lib389/utils.py", line 49, in <module> from packaging.version import LegacyVersion ImportError: cannot import name 'LegacyVersion' from 'packaging.version' (/gnu/store/5ga1x27pz9wqwhq3sndcymfngdvcr4w9-python-packaging-bootstrap-25.0/lib/python3.11/site-packages/packaging/version.py) * gnu/packages/patches/389-ds-base-legacy-version.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/openldap.scm (389-ds-base): Use it. Change-Id: I34c12dce3092f9911383ae380af13ef74285ebc4
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/openldap.scm1
-rw-r--r--gnu/packages/patches/389-ds-base-legacy-version.patch40
3 files changed, 42 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 2342af80031..5f314bb063d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -956,6 +956,7 @@ MODULES_NOT_COMPILED += \
patchdir = $(guilemoduledir)/%D%/packages/patches
dist_patch_DATA = \
+ %D%/packages/patches/389-ds-base-legacy-version.patch \
%D%/packages/patches/8mq-enable-imx_hab_handler.patch \
%D%/packages/patches/8mq-move-stack-to-ocram_s.patch \
%D%/packages/patches/abcl-fix-build-xml.patch \
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index b2a3012db97..83b805e089e 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -236,6 +236,7 @@ servers from Python programs.")
(sha256
(base32
"1sdvfbjfg0091f47562gw3gdc2vgvvhyhdi21lrpwnw9lqc8xdxk"))
+ (patches (search-patches "389-ds-base-legacy-version.patch"))
(modules '((guix build utils)))
(snippet
;; Put '#define f_type' after '#include <sys/statvfs.h>' to
diff --git a/gnu/packages/patches/389-ds-base-legacy-version.patch b/gnu/packages/patches/389-ds-base-legacy-version.patch
new file mode 100644
index 00000000000..17729db720e
--- /dev/null
+++ b/gnu/packages/patches/389-ds-base-legacy-version.patch
@@ -0,0 +1,40 @@
+LegacyVersion does not exist anymore in packaging.version 25.0
+(https://github.com/pypa/packaging/pull/407). This patch is needed until
+389-ds-base is updated to a newer version.
+
+diff --git a/src/lib389/lib389/utils_orig.py b/src/lib389/lib389/utils.py
+index da966ed..30f127d 100644
+--- a/src/lib389/lib389/utils.py
++++ b/src/lib389/lib389/utils.py
+@@ -46,7 +46,12 @@ try:
+ from pkg_resources.extern.packaging.version import LegacyVersion
+ # Fallback to a normal 'packaging' module in case 'setuptools' is stripped
+ except:
+- from packaging.version import LegacyVersion
++ from packaging.version import Version
++
++ # Define a stub LegacyVersion for compatibility.
++ class LegacyVersion(Version):
++ def __init__(self, v):
++ super().__init__(v)
+ from socket import getfqdn
+ from ldapurl import LDAPUrl
+ from contextlib import closing
+diff --git a/src/lib389/lib389/nss_ssl_orig.py b/src/lib389/lib389/nss_ssl.py
+index 3561597..6622a46 100644
+--- a/src/lib389/lib389/nss_ssl_orig.py
++++ b/src/lib389/lib389/nss_ssl.py
+@@ -31,7 +31,12 @@ try:
+ from pkg_resources.extern.packaging.version import LegacyVersion
+ # Fallback to a normal 'packaging' module in case 'setuptools' is stripped
+ except:
+- from packaging.version import LegacyVersion
++ from packaging.version import Version
++
++ # Define a stub LegacyVersion for compatibility.
++ class LegacyVersion(Version):
++ def __init__(self, v):
++ super().__init__(v)
+
+ KEYBITS = 4096
+ CA_NAME = 'Self-Signed-CA'