[packages/python3] - up to 3.10.3, drop BLDLIBRARY and install_prefix patches

baggins baggins at pld-linux.org
Wed Mar 23 08:41:24 CET 2022


commit 91530447b7fec1998c74eae52331d5762509b2f0
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Mar 23 08:39:21 2022 +0100

    - up to 3.10.3, drop BLDLIBRARY and install_prefix patches
    
    BLDLIBRARY patch breaks build
    install_prefix is broken, breaks tests and why did we even had that hack?

 python3-BLDLIBRARY.patch     | 83 --------------------------------------------
 python3-install_prefix.patch | 48 -------------------------
 python3-multilib.patch       | 28 +++++++++++++++
 python3.spec                 | 26 ++++++--------
 4 files changed, 38 insertions(+), 147 deletions(-)
---
diff --git a/python3.spec b/python3.spec
index d168a00..c4420e2 100644
--- a/python3.spec
+++ b/python3.spec
@@ -47,13 +47,13 @@ Summary(ru.UTF-8):	Язык программирования очень высо
 Summary(tr.UTF-8):	X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
 Summary(uk.UTF-8):	Мова програмування дуже високого рівня з X-інтерфейсом
 Name:		python3
-Version:	%{py_ver}.0
+Version:	%{py_ver}.3
 Release:	0.1
 Epoch:		1
 License:	PSF
 Group:		Development/Languages/Python
 Source0:	https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
-# Source0-md5:	3e7035d272680f80e3ce4e8eb492d580
+# Source0-md5:	21e0b70d70fdd4756aafc4caa55cc17e
 Source1:	pyconfig.h.in
 Patch0:		%{name}-pythonpath.patch
 Patch1:		%{name}-ac_fixes.patch
@@ -61,9 +61,7 @@ Patch2:		%{name}-multilib.patch
 Patch3:		%{name}-no_cmdline_tests.patch
 
 Patch5:		%{name}-config.patch
-Patch6:		%{name}-BLDLIBRARY.patch
 Patch7:		%{name}-db.patch
-Patch8:		%{name}-install_prefix.patch
 Patch9:		%{name}-tests_with_pythonpath.patch
 Patch10:	%{name}-bdist_rpm.patch
 Patch11:	%{name}-installcompile.patch
@@ -488,9 +486,7 @@ Moduły testowe dla Pythona.
 %patch3 -p1
 
 %patch5 -p1
-%patch6 -p1
 %patch7 -p1
-%patch8 -p1
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
@@ -525,6 +521,9 @@ sed -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
 
 find . -name '*.py' | xargs -r grep -El '^#! */usr/bin/env python3?' | xargs %{__sed} -i -e '1s,^#! */usr/bin/env python3\?,#!/usr/bin/python3,'
 
+sed -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\1,' \
+	Tools/c-analyzer/must-resolve.sh
+
 %build
 if ! grep -q "tmpfs" /proc/self/mounts; then
 	echo "You need to have /dev/shm mounted in order to build this package!" >&2
@@ -663,7 +662,7 @@ install -p Tools/scripts/reindent.py $RPM_BUILD_ROOT%{_bindir}/pyreindent%{py_ve
 
 # that seems to be only an empty extension template,
 # which seems to be built only {with tests}
-%{__rm} -f $RPM_BUILD_ROOT%{py_dyndir}/xxlimited.*.so
+%{__rm} $RPM_BUILD_ROOT%{py_dyndir}/xxlimited*.*.so
 
 # already in %%doc
 %{__rm} $RPM_BUILD_ROOT%{py_libdir}/LICENSE.txt
@@ -690,8 +689,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/python%{py_abi}
 %endif
 %attr(755,root,root) %{_bindir}/python3
-%{_mandir}/man1/python%{py_ver}.1*
-%{_mandir}/man1/python3.1*
+%{_mandir}/man1/python3*.1*
 
 %files libs
 %defattr(644,root,root,755)
@@ -795,7 +793,6 @@ rm -rf $RPM_BUILD_ROOT
 %{py_libdir}/__future__.py
 %{py_libdir}/__phello__.foo.py
 %{py_libdir}/_aix_support.py
-%{py_libdir}/_bootlocale.py
 %{py_libdir}/_bootsubprocess.py
 %{py_libdir}/_compat_pickle.py
 %{py_libdir}/_compression.py
@@ -841,7 +838,6 @@ rm -rf $RPM_BUILD_ROOT
 %{py_libdir}/filecmp.py
 %{py_libdir}/fileinput.py
 %{py_libdir}/fnmatch.py
-%{py_libdir}/formatter.py
 %{py_libdir}/fractions.py
 %{py_libdir}/ftplib.py
 %{py_libdir}/getopt.py
@@ -905,7 +901,6 @@ rm -rf $RPM_BUILD_ROOT
 %{py_libdir}/struct.py
 %{py_libdir}/subprocess.py
 %{py_libdir}/sunau.py
-%{py_libdir}/symbol.py
 %{py_libdir}/symtable.py
 %{py_libdir}/tabnanny.py
 %{py_libdir}/tarfile.py
@@ -931,7 +926,6 @@ rm -rf $RPM_BUILD_ROOT
 %{py_libdir}/__pycache__/__future__.cpython-*.py[co]
 %{py_libdir}/__pycache__/__phello__.foo.cpython-*.py[co]
 %{py_libdir}/__pycache__/_aix_support.cpython-*.py[co]
-%{py_libdir}/__pycache__/_bootlocale.cpython-*.py[co]
 %{py_libdir}/__pycache__/_bootsubprocess.cpython-*.py[co]
 %{py_libdir}/__pycache__/_compat_pickle.cpython-*.py[co]
 %{py_libdir}/__pycache__/_compression.cpython-*.py[co]
@@ -977,7 +971,6 @@ rm -rf $RPM_BUILD_ROOT
 %{py_libdir}/__pycache__/filecmp.cpython-*.py[co]
 %{py_libdir}/__pycache__/fileinput.cpython-*.py[co]
 %{py_libdir}/__pycache__/fnmatch.cpython-*.py[co]
-%{py_libdir}/__pycache__/formatter.cpython-*.py[co]
 %{py_libdir}/__pycache__/fractions.cpython-*.py[co]
 %{py_libdir}/__pycache__/ftplib.cpython-*.py[co]
 %{py_libdir}/__pycache__/getopt.cpython-*.py[co]
@@ -1041,7 +1034,6 @@ rm -rf $RPM_BUILD_ROOT
 %{py_libdir}/__pycache__/struct.cpython-*.py[co]
 %{py_libdir}/__pycache__/subprocess.cpython-*.py[co]
 %{py_libdir}/__pycache__/sunau.cpython-*.py[co]
-%{py_libdir}/__pycache__/symbol.cpython-*.py[co]
 %{py_libdir}/__pycache__/symtable.cpython-*.py[co]
 %{py_libdir}/__pycache__/tabnanny.cpython-*.py[co]
 %{py_libdir}/__pycache__/tarfile.cpython-*.py[co]
@@ -1136,7 +1128,6 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{py_dyndir}/mmap.cpython-*.so
 %attr(755,root,root) %{py_dyndir}/nis.cpython-*.so
 %attr(755,root,root) %{py_dyndir}/ossaudiodev.cpython-*.so
-%attr(755,root,root) %{py_dyndir}/parser.cpython-*.so
 %attr(755,root,root) %{py_dyndir}/pyexpat.cpython-*.so
 %attr(755,root,root) %{py_dyndir}/readline.cpython-*.so
 %attr(755,root,root) %{py_dyndir}/resource.cpython-*.so
@@ -1205,6 +1196,9 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{py_libdir}/importlib
 %{py_libdir}/importlib/__pycache__
 %{py_libdir}/importlib/*.py
+%dir %{py_libdir}/importlib/metadata
+%{py_libdir}/importlib/metadata/__pycache__
+%{py_libdir}/importlib/metadata/*.py
 
 %dir %{py_libdir}/json
 %{py_libdir}/json/__pycache__
diff --git a/python3-BLDLIBRARY.patch b/python3-BLDLIBRARY.patch
deleted file mode 100644
index 865b51b..0000000
--- a/python3-BLDLIBRARY.patch
+++ /dev/null
@@ -1,83 +0,0 @@
---- Python-3.8.5/Makefile.pre.in.orig	2020-09-17 07:55:13.731893519 +0200
-+++ Python-3.8.5/Makefile.pre.in	2020-09-17 10:33:36.683744945 +0200
-@@ -224,6 +224,7 @@
- LIBRARY=	@LIBRARY@
- LDLIBRARY=      @LDLIBRARY@
- BLDLIBRARY=     @BLDLIBRARY@
-+BLDLIBDIR=      @BLDLIBDIR@
- PY3LIBRARY=     @PY3LIBRARY@
- DLLLIBRARY=	@DLLLIBRARY@
- LDLIBRARYDIR=   @LDLIBRARYDIR@
-@@ -588,7 +588,7 @@ clinic: check-clean-src $(srcdir)/Module
- 
- # Build the interpreter
- $(BUILDPYTHON):	Programs/python.o $(LIBRARY_DEPS)
--	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
-+	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBDIR) $(LIBS) $(MODLIBS) $(SYSLIBS)
- 
- platform: $(BUILDPYTHON) pybuilddir.txt
- 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
-@@ -723,7 +723,7 @@ Makefile Modules/config.c: Makefile.pre
- 
- 
- Programs/_testembed: Programs/_testembed.o $(LIBRARY_DEPS)
--	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
-+	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBDIR) $(LIBS) $(MODLIBS) $(SYSLIBS)
- 
- ############################################################################
- # Importlib
---- Python-3.8.5/configure.ac.orig	2020-09-17 07:55:13.735226834 +0200
-+++ Python-3.8.5/configure.ac	2020-09-17 10:46:44.172812084 +0200
-@@ -1033,6 +1033,7 @@
- # with the ABI build flags appended.
- AC_SUBST(LDLIBRARY)
- AC_SUBST(DLLLIBRARY)
-+AC_SUBST(BLDLIBDIR)
- AC_SUBST(BLDLIBRARY)
- AC_SUBST(PY3LIBRARY)
- AC_SUBST(LDLIBRARYDIR)
-@@ -1040,6 +1041,7 @@
- AC_SUBST(RUNSHARED)
- AC_SUBST(LDVERSION)
- LDLIBRARY="$LIBRARY"
-+BLDLIBDIR=''
- BLDLIBRARY='$(LDLIBRARY)'
- INSTSONAME='$(LDLIBRARY)'
- DLLLIBRARY=''
-@@ -1156,7 +1158,8 @@
-           ;;
-     SunOS*)
- 	  LDLIBRARY='libpython$(LDVERSION).so'
--	  BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
-+	  BLDLIBDIR='-Wl,-R,$(LIBDIR) -L.'
-+	  BLDLIBRARY='-lpython$(VERSION)'
- 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- 	  INSTSONAME="$LDLIBRARY".$SOVERSION
- 	  if test "$with_pydebug" != yes
-@@ -1147,7 +1147,8 @@ if test $enable_shared = "yes"; then
-           ;;
-     Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*)
- 	  LDLIBRARY='libpython$(LDVERSION).so'
--	  BLDLIBRARY='-L. -lpython$(LDVERSION)'
-+	  BLDLIBDIR='-Wl,-R,$(LIBDIR) -L.'
-+	  BLDLIBRARY='-lpython$(VERSION)'
- 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- 	  INSTSONAME="$LDLIBRARY".$SOVERSION
- 	  if test "$with_pydebug" != yes
-@@ -1183,12 +1187,14 @@
- 			LDLIBRARY='libpython$(LDVERSION).sl'
- 			;;
- 	  esac
--	  BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
-+	  BLDLIBDIR='-Wl,+b,$(LIBDIR) -L.'
-+	  BLDLIBRARY='-lpython$(VERSION)'
- 	  RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}}
- 	  ;;
-     Darwin*)
-     	LDLIBRARY='libpython$(LDVERSION).dylib'
--	BLDLIBRARY='-L. -lpython$(LDVERSION)'
-+	BLDLIBDIR='-L.'
-+	BLDLIBRARY='-lpython$(LDVERSION)'
- 	RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
- 	;;
-     AIX*)
diff --git a/python3-install_prefix.patch b/python3-install_prefix.patch
deleted file mode 100644
index b342314..0000000
--- a/python3-install_prefix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/command/install.py Python-3.9.2/Lib/distutils/command/install.py
---- Python-3.9.2.org/Lib/distutils/command/install.py	2021-02-25 18:41:13.921266287 +0100
-+++ Python-3.9.2/Lib/distutils/command/install.py	2021-02-25 18:41:15.634652993 +0100
-@@ -9,6 +9,7 @@ from distutils import log
- from distutils.core import Command
- from distutils.debug import DEBUG
- from distutils.sysconfig import get_config_vars
-+from distutils.sysconfig import PREFIX, EXEC_PREFIX
- from distutils.errors import DistutilsPlatformError
- from distutils.file_util import write_file
- from distutils.util import convert_path, subst_vars, change_root
-@@ -419,8 +420,8 @@ class install(Command):
-                     raise DistutilsOptionError(
-                           "must not supply exec-prefix without prefix")
- 
--                self.prefix = os.path.normpath(sys.prefix)
--                self.exec_prefix = os.path.normpath(sys.exec_prefix)
-+                self.prefix = PREFIX
-+                self.exec_prefix = EXEC_PREFIX
- 
-             else:
-                 if self.exec_prefix is None:
-diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/sysconfig.py Python-3.9.2/Lib/distutils/sysconfig.py
---- Python-3.10.0/Lib/distutils/sysconfig.py~	2021-10-20 22:42:16.000000000 +0200
-+++ Python-3.10.0/Lib/distutils/sysconfig.py	2021-10-20 22:53:54.943156539 +0200
-@@ -320,6 +320,10 @@ def get_python_lib(plat_specific=0, stan
-     If 'prefix' is supplied, use it instead of sys.base_prefix or
-     sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
-     """
-+    if PREFIX == "/usr":
-+        PREFIX = "/usr/local"
-+    if EXEC_PREFIX == "/usr":
-+        EXEC_PREFIX = "/usr/local"
-     if prefix is None:
-         if standard_lib:
-             prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
-diff -urNp -x '*.orig' Python-3.9.2.org/Lib/site.py Python-3.9.2/Lib/site.py
---- Python-3.9.2.org/Lib/site.py	2021-02-25 18:41:13.924599724 +0100
-+++ Python-3.9.2/Lib/site.py	2021-02-25 18:41:15.634652993 +0100
-@@ -76,7 +76,7 @@ import _sitebuiltins
- import io
- 
- # Prefixes for site-packages; add additional prefixes like /usr/local here
--PREFIXES = [sys.prefix, sys.exec_prefix]
-+PREFIXES = ["/usr/local", sys.prefix, sys.exec_prefix]
- # Enable per user site-packages directory
- # set it to False to disable the feature or True to force the feature
- ENABLE_USER_SITE = None
diff --git a/python3-multilib.patch b/python3-multilib.patch
index 49417ce..4e83d8c 100644
--- a/python3-multilib.patch
+++ b/python3-multilib.patch
@@ -32,6 +32,15 @@ diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/tests/test_install.py Pyth
 diff -urNp -x '*.orig' Python-3.9.2.org/Lib/site.py Python-3.9.2/Lib/site.py
 --- Python-3.9.2.org/Lib/site.py	2021-02-19 13:31:44.000000000 +0100
 +++ Python-3.9.2/Lib/site.py	2021-02-25 18:40:00.705652346 +0100
+@@ -295,7 +295,7 @@
+     if sys.platform == 'darwin' and sys._framework:
+         return f'{userbase}/lib/python/site-packages'
+ 
+-    return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'
++    return f'{userbase}/{sys.platlibdir}/python{version[0]}.{version[1]}/site-packages'
+ 
+ 
+ def getuserbase():
 @@ -344,6 +344,8 @@ def getsitepackages(prefixes=None):
                                      "python%d.%d" % sys.version_info[:2],
                                      "site-packages")
@@ -123,3 +132,22 @@ diff -urNp -x '*.orig' Python-3.9.2.org/setup.py Python-3.9.2/setup.py
                                 extra_link_args=readline_extra_link_args,
                                 libraries=readline_libs))
          else:
+--- Python-3.10.3/Lib/test/test_sysconfig.py~	2022-03-16 12:27:11.000000000 +0100
++++ Python-3.10.3/Lib/test/test_sysconfig.py	2022-03-22 23:11:16.335919644 +0100
+@@ -299,13 +299,13 @@
+                 expected = global_path.replace(base, user, 1)
+                 # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
+                 # whereas posix_prefix does.
+-                if name == 'platlib':
++                if name != 'platlib':
+                     # Replace "/lib64/python3.11/site-packages" suffix
+                     # with "/lib/python3.11/site-packages".
+                     py_version_short = sysconfig.get_python_version()
+                     suffix = f'python{py_version_short}/site-packages'
+-                    expected = expected.replace(f'/{sys.platlibdir}/{suffix}',
+-                                                f'/lib/{suffix}')
++                    expected = expected.replace(f'/lib/{suffix}',
++                                                f'/{sys.platlibdir}/{suffix}')
+                 self.assertEqual(user_path, expected)
+ 
+     def test_main(self):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3.git/commitdiff/91530447b7fec1998c74eae52331d5762509b2f0



More information about the pld-cvs-commit mailing list