diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-12-31 13:23:11 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-12-31 08:27:47 -0800 |
commit | aa031c8685a6a82e326af4b5cf39b4f1579d4833 (patch) | |
tree | 276bb5ab72f5724b90b64bc7142761d4eae91410 /meta-oe/recipes-extended | |
parent | 3dd8878b320d4d151119100e2dc3886c49fd91a0 (diff) | |
download | meta-openembedded-aa031c8685a6a82e326af4b5cf39b4f1579d4833.tar.gz |
libpwquality: backport a python 3.12 compatibility patch
This also allows dropping a previous patch.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
3 files changed, 81 insertions, 46 deletions
diff --git a/meta-oe/recipes-extended/libpwquality/files/0001-Use-setuptools-instead-of-distutils.patch b/meta-oe/recipes-extended/libpwquality/files/0001-Use-setuptools-instead-of-distutils.patch new file mode 100644 index 000000000..7eaca66b5 --- /dev/null +++ b/meta-oe/recipes-extended/libpwquality/files/0001-Use-setuptools-instead-of-distutils.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From ad95b7684365dea8335c34527d4c1463c1668af0 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz> | ||
3 | Date: Fri, 31 Mar 2023 14:52:19 +0200 | ||
4 | Subject: [PATCH] Use setuptools instead of distutils | ||
5 | |||
6 | distutils is removed from Python 3.12+: | ||
7 | https://peps.python.org/pep-0632/ | ||
8 | |||
9 | Upstream-Status: Backport [https://github.com/libpwquality/libpwquality/commit/7b5e0f0097faebdcc6a8b783237bbba7a983147a] | ||
10 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
11 | --- | ||
12 | libpwquality.spec.in | 11 ++--------- | ||
13 | python/Makefile.am | 2 +- | ||
14 | python/setup.py.in | 6 +++--- | ||
15 | 3 files changed, 6 insertions(+), 13 deletions(-) | ||
16 | |||
17 | diff --git a/libpwquality.spec.in b/libpwquality.spec.in | ||
18 | index 70a6f53..0809126 100644 | ||
19 | --- a/libpwquality.spec.in | ||
20 | +++ b/libpwquality.spec.in | ||
21 | @@ -33,9 +33,11 @@ BuildRequires: gettext | ||
22 | BuildRequires: pam-devel | ||
23 | %if %{with python2} | ||
24 | BuildRequires: python2-devel | ||
25 | +BuildRequires: python2-setuptools | ||
26 | %endif | ||
27 | %if %{with python3} | ||
28 | BuildRequires: python3-devel | ||
29 | +BuildRequires: python3-setuptools | ||
30 | %endif | ||
31 | |||
32 | URL: https://github.com/libpwquality/libpwquality/ | ||
33 | @@ -103,15 +105,6 @@ cp -a . %{py3dir} | ||
34 | pushd %{py3dir} | ||
35 | %endif | ||
36 | %if %{with python3} | ||
37 | -# setuptools >= 60 changes the environment to use its bundled copy of distutils | ||
38 | -# by default, not the Python-bundled one. To run the Python's standard library | ||
39 | -# distutils, the environment variable must be set. | ||
40 | -# Although technically setuptools is not needed for this package, if it's | ||
41 | -# pulled by another package, it changes the environment and consequently, | ||
42 | -# the build fails. This was reported in: | ||
43 | -# https://github.com/pypa/setuptools/issues/3143 | ||
44 | -export SETUPTOOLS_USE_DISTUTILS=stdlib | ||
45 | - | ||
46 | %configure \ | ||
47 | --with-securedir=%{_moduledir} \ | ||
48 | --with-pythonsitedir=%{python3_sitearch} \ | ||
49 | diff --git a/python/Makefile.am b/python/Makefile.am | ||
50 | index 1d00c0c..6e51744 100644 | ||
51 | --- a/python/Makefile.am | ||
52 | +++ b/python/Makefile.am | ||
53 | @@ -14,7 +14,7 @@ all-local: | ||
54 | CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) | ||
55 | |||
56 | install-exec-local: | ||
57 | - CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix} | ||
58 | + CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --root ${DESTDIR} --prefix=${prefix} | ||
59 | |||
60 | clean-local: | ||
61 | rm -rf py$(PYTHONREV) | ||
62 | diff --git a/python/setup.py.in b/python/setup.py.in | ||
63 | index a741b91..f934c50 100755 | ||
64 | --- a/python/setup.py.in | ||
65 | +++ b/python/setup.py.in | ||
66 | @@ -6,9 +6,9 @@ | ||
67 | |||
68 | import os | ||
69 | |||
70 | -from distutils.core import setup, Extension | ||
71 | -from distutils.command.build_ext import build_ext as _build_ext | ||
72 | -from distutils.command.sdist import sdist as _sdist | ||
73 | +from setuptools import setup, Extension | ||
74 | +from setuptools.command.build_ext import build_ext as _build_ext | ||
75 | +from setuptools.command.sdist import sdist as _sdist | ||
76 | |||
77 | def genconstants(headerfile, outputfile): | ||
78 | hf = open(headerfile, 'r') | ||
diff --git a/meta-oe/recipes-extended/libpwquality/files/add-missing-python-include-dir-for-cross.patch b/meta-oe/recipes-extended/libpwquality/files/add-missing-python-include-dir-for-cross.patch deleted file mode 100644 index 636b29407..000000000 --- a/meta-oe/recipes-extended/libpwquality/files/add-missing-python-include-dir-for-cross.patch +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | From 1ea09e09ab2387c326bb7170835361ece6e25477 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Mon, 3 Aug 2015 13:43:14 +0800 | ||
4 | Subject: [PATCH] setup.py.in: add missing python include dir for cross | ||
5 | compiling | ||
6 | |||
7 | Upstream-Status: Inappropriate [oe-core specific] | ||
8 | |||
9 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
10 | --- | ||
11 | python/Makefile.am | 2 +- | ||
12 | python/setup.py.in | 3 ++- | ||
13 | 2 files changed, 3 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/python/Makefile.am b/python/Makefile.am | ||
16 | index 1d00c0c..52816b2 100644 | ||
17 | --- a/python/Makefile.am | ||
18 | +++ b/python/Makefile.am | ||
19 | @@ -14,7 +14,7 @@ all-local: | ||
20 | CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) | ||
21 | |||
22 | install-exec-local: | ||
23 | - CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix} | ||
24 | + CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix} --install-lib=${DESTDIR}/${PYTHONSITEDIR} | ||
25 | |||
26 | clean-local: | ||
27 | rm -rf py$(PYTHONREV) | ||
28 | diff --git a/python/setup.py.in b/python/setup.py.in | ||
29 | index a741b91..6759a95 100755 | ||
30 | --- a/python/setup.py.in | ||
31 | +++ b/python/setup.py.in | ||
32 | @@ -33,7 +33,7 @@ class sdist(_sdist): | ||
33 | |||
34 | pwqmodule = Extension('pwquality', | ||
35 | sources = ['pwquality.c'], | ||
36 | - include_dirs = ['../src'], | ||
37 | + include_dirs = ['../src', os.path.join(os.environ['STAGING_INCDIR'], os.environ['PYTHON_DIR'])], | ||
38 | library_dirs = ['../src/.libs'], | ||
39 | libraries = ['pwquality']) | ||
40 | |||
41 | -- | ||
42 | 2.17.1 | ||
43 | |||
diff --git a/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb b/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb index 5287430c4..91afedcb6 100644 --- a/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb +++ b/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb | |||
@@ -5,11 +5,11 @@ SECTION = "devel/lib" | |||
5 | LICENSE = "GPL-2.0-or-later" | 5 | LICENSE = "GPL-2.0-or-later" |
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2" | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2" |
7 | 7 | ||
8 | DEPENDS = "cracklib" | 8 | DEPENDS = "cracklib python3-setuptools-native" |
9 | 9 | ||
10 | SRC_URI = "git://github.com/libpwquality/libpwquality;branch=master;protocol=https \ | 10 | SRC_URI = "git://github.com/libpwquality/libpwquality;branch=master;protocol=https \ |
11 | file://add-missing-python-include-dir-for-cross.patch \ | 11 | file://0001-Use-setuptools-instead-of-distutils.patch \ |
12 | " | 12 | " |
13 | SRCREV = "5490e96a3dd6ed7371435ca5b3ccef98bdb48b5a" | 13 | SRCREV = "5490e96a3dd6ed7371435ca5b3ccef98bdb48b5a" |
14 | 14 | ||
15 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |