From 66b494a977bfe3987ebd91691c4f508bd505367f Mon Sep 17 00:00:00 2001 From: Rmys Date: Fri, 22 Oct 2021 16:13:04 +0300 Subject: [PATCH] Python-3.9.7 --- system/base/python3/actions.py | 8 +- ...nX.Y.a-in-usr-lib-instead-of-usr-lib.patch | 10 +- ...exit-with-non-zero-status-on-failure.patch | 28 ++-- .../0005-Improve-distutils-C-support.patch | 28 ++-- ...O-enable-both-opt-1-and-opt-2-optimi.patch | 81 ++++++++++++ system/base/python3/pspec.xml | 121 +++++++++--------- 6 files changed, 181 insertions(+), 95 deletions(-) create mode 100644 system/base/python3/files/gentoo/0007-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch diff --git a/system/base/python3/actions.py b/system/base/python3/actions.py index 494ee66b..b0c8e76a 100644 --- a/system/base/python3/actions.py +++ b/system/base/python3/actions.py @@ -52,8 +52,8 @@ def install(): pisitools.remove("/usr/bin/2to3") pisitools.dodoc("LICENSE", "README.*") - pisitools.removeDir("/usr/lib/python3.8/idlelib") - pisitools.removeDir("/usr/lib/python3.8/tkinter") - pisitools.removeDir("/usr/lib/python3.8/turtledemo") + pisitools.removeDir("/usr/lib/python3.9/idlelib") + pisitools.removeDir("/usr/lib/python3.9/tkinter") + pisitools.removeDir("/usr/lib/python3.9/turtledemo") pisitools.remove("/usr/bin/idle3*") - pisitools.remove("/usr/lib/libpython3.8.a") + pisitools.remove("/usr/lib/libpython3.9.a") diff --git a/system/base/python3/files/gentoo/0001-Install-libpythonX.Y.a-in-usr-lib-instead-of-usr-lib.patch b/system/base/python3/files/gentoo/0001-Install-libpythonX.Y.a-in-usr-lib-instead-of-usr-lib.patch index a4e467a5..06455611 100644 --- a/system/base/python3/files/gentoo/0001-Install-libpythonX.Y.a-in-usr-lib-instead-of-usr-lib.patch +++ b/system/base/python3/files/gentoo/0001-Install-libpythonX.Y.a-in-usr-lib-instead-of-usr-lib.patch @@ -1,7 +1,7 @@ -From cb8a5266fd6cef5f523f64f95905d684766c68de Mon Sep 17 00:00:00 2001 +From c7d26e6881e6d305a9e2cb095b540a9062f84272 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Fri, 5 Jan 2018 13:28:45 -0500 -Subject: [PATCH 01/16] Install libpythonX.Y.a in /usr/lib instead of +Subject: [PATCH 01/14] Install libpythonX.Y.a in /usr/lib instead of /usr/lib/pythonX.Y/config https://bugs.gentoo.org/show_bug.cgi?id=252372 @@ -14,10 +14,10 @@ https://bugs.python.org/issue6103 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 7e381283fe..37cbb02890 100644 +index 6ce7a614dc..27666e9d16 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1582,9 +1582,9 @@ libainstall: @DEF_MAKE_RULE@ python-config +@@ -1655,9 +1655,9 @@ libainstall: @DEF_MAKE_RULE@ python-config @if test -d $(LIBRARY); then :; else \ if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ if test "$(SHLIB_SUFFIX)" = .dll; then \ @@ -30,7 +30,7 @@ index 7e381283fe..37cbb02890 100644 else \ echo Skip install of $(LIBRARY) - use make frameworkinstall; \ diff --git a/Misc/python-config.in b/Misc/python-config.in -index 727c4a8682..bab60cf2d1 100644 +index ebd99daa0c..ddcb9e0154 100644 --- a/Misc/python-config.in +++ b/Misc/python-config.in @@ -56,12 +56,6 @@ for opt in opt_flags: diff --git a/system/base/python3/files/gentoo/0004-setup.py-exit-with-non-zero-status-on-failure.patch b/system/base/python3/files/gentoo/0004-setup.py-exit-with-non-zero-status-on-failure.patch index 8e8479c2..20d9fb68 100644 --- a/system/base/python3/files/gentoo/0004-setup.py-exit-with-non-zero-status-on-failure.patch +++ b/system/base/python3/files/gentoo/0004-setup.py-exit-with-non-zero-status-on-failure.patch @@ -1,38 +1,38 @@ -From dbb695267eb05999d2af3ce85200c3ebdf53b1e5 Mon Sep 17 00:00:00 2001 +From da4a87387b4589313003a7bc73832ee6d19f74c4 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Fri, 5 Jan 2018 13:32:45 -0500 -Subject: [PATCH 04/16] setup.py: exit with non-zero status on failure +Subject: [PATCH 04/14] setup.py: exit with non-zero status on failure https://bugs.gentoo.org/show_bug.cgi?id=281968 https://bugs.python.org/issue6731 --- - setup.py | 6 ++++++ - 1 file changed, 6 insertions(+) + setup.py | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py -index 53591bc1e6..2b362029ac 100644 +index e5a3f1aff8..15dd1c4ad4 100644 --- a/setup.py +++ b/setup.py -@@ -86,6 +86,7 @@ Programming Language :: Python +@@ -105,6 +105,7 @@ Programming Language :: Python Topic :: Software Development """ +exit_status = 0 - # Set common compiler and linker flags derived from the Makefile, - # reserved for building the interpreter and the stdlib modules. -@@ -430,7 +431,10 @@ class PyBuildExt(build_ext): - print_three_column([ext.name for ext in mods_disabled]) + def run_command(cmd): + status = os.system(cmd) +@@ -524,8 +525,10 @@ class PyBuildExt(build_ext): + print("been built, they are *disabled* by configure:") + print_three_column(self.disabled_configure) print() - + global exit_status -+ + if self.failed: + exit_status = 1 failed = self.failed[:] print() print("Failed to build these modules:") -@@ -438,6 +442,7 @@ class PyBuildExt(build_ext): +@@ -533,6 +536,7 @@ class PyBuildExt(build_ext): print() if self.failed_on_import: @@ -40,7 +40,7 @@ index 53591bc1e6..2b362029ac 100644 failed = self.failed_on_import[:] print() print("Following modules built successfully" -@@ -2415,6 +2420,7 @@ def main(): +@@ -2603,6 +2607,7 @@ def main(): scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", "Tools/scripts/2to3"] ) diff --git a/system/base/python3/files/gentoo/0005-Improve-distutils-C-support.patch b/system/base/python3/files/gentoo/0005-Improve-distutils-C-support.patch index af111a5a..3a7eb872 100644 --- a/system/base/python3/files/gentoo/0005-Improve-distutils-C-support.patch +++ b/system/base/python3/files/gentoo/0005-Improve-distutils-C-support.patch @@ -1,7 +1,7 @@ -From 5082bf6ec57eed8680eac679f6c3e6908031b3f7 Mon Sep 17 00:00:00 2001 +From a6d965d846dd989bfd9bcfa806575cadf5643656 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Fri, 5 Jan 2018 13:34:21 -0500 -Subject: [PATCH 05/16] Improve distutils C++ support +Subject: [PATCH 05/14] Improve distutils C++ support https://bugs.python.org/issue1222585 --- @@ -14,7 +14,7 @@ https://bugs.python.org/issue1222585 6 files changed, 80 insertions(+), 52 deletions(-) diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py -index 9b127c2491..b13734a271 100644 +index 37975fe8a3..b4e46df29c 100644 --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -14,13 +14,13 @@ __all__ = [ @@ -35,10 +35,10 @@ index 9b127c2491..b13734a271 100644 # prefix added to original configuration variable names _INITPRE = '_OSX_SUPPORT_INITIAL_' diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py -index 6c5d77746b..640fa2da34 100644 +index 66c12dd358..dddb9fd2d4 100644 --- a/Lib/distutils/cygwinccompiler.py +++ b/Lib/distutils/cygwinccompiler.py -@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler): +@@ -123,8 +123,10 @@ class CygwinCCompiler(UnixCCompiler): # dllwrap 2.10.90 is buggy if self.ld_version >= "2.10.90": self.linker_dll = "gcc" @@ -49,7 +49,7 @@ index 6c5d77746b..640fa2da34 100644 # ld_version >= "2.13" support -shared so use it instead of # -mdll -static -@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler): +@@ -138,9 +140,13 @@ class CygwinCCompiler(UnixCCompiler): self.set_executables(compiler='gcc -mcygwin -O -Wall', compiler_so='gcc -mcygwin -mdll -O -Wall', compiler_cxx='g++ -mcygwin -O -Wall', @@ -64,7 +64,7 @@ index 6c5d77746b..640fa2da34 100644 # cygwin and mingw32 need different sets of libraries if self.gcc_version == "2.91.57": -@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler): +@@ -164,8 +170,12 @@ class CygwinCCompiler(UnixCCompiler): raise CompileError(msg) else: # for other files use the C-compiler try: @@ -79,7 +79,7 @@ index 6c5d77746b..640fa2da34 100644 except DistutilsExecError as msg: raise CompileError(msg) -@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler): +@@ -300,9 +310,14 @@ class Mingw32CCompiler(CygwinCCompiler): self.set_executables(compiler='gcc -O -Wall', compiler_so='gcc -mdll -O -Wall', compiler_cxx='g++ -O -Wall', @@ -95,10 +95,10 @@ index 6c5d77746b..640fa2da34 100644 # Maybe we should also append -mthreads, but then the finished # dlls need another dll (mingwm10.dll see Mingw32 docs) diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index b51629eb94..c00870fb0f 100644 +index 37feae5df7..f78d01257a 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -187,9 +187,12 @@ def customize_compiler(compiler): +@@ -193,9 +193,12 @@ def customize_compiler(compiler): _osx_support.customize_compiler(_config_vars) _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' @@ -114,7 +114,7 @@ index b51629eb94..c00870fb0f 100644 if 'CC' in os.environ: newcc = os.environ['CC'] -@@ -204,19 +207,27 @@ def customize_compiler(compiler): +@@ -210,19 +213,27 @@ def customize_compiler(compiler): cxx = os.environ['CXX'] if 'LDSHARED' in os.environ: ldshared = os.environ['LDSHARED'] @@ -143,7 +143,7 @@ index b51629eb94..c00870fb0f 100644 if 'AR' in os.environ: ar = os.environ['AR'] if 'ARFLAGS' in os.environ: -@@ -225,13 +236,17 @@ def customize_compiler(compiler): +@@ -231,13 +242,17 @@ def customize_compiler(compiler): archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags @@ -312,10 +312,10 @@ index f0792de74a..16e7fbea83 100644 if sys.platform == 'darwin': linker = _osx_support.compiler_fixup(linker, ld_args) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 37cbb02890..3d724dfb51 100644 +index 27666e9d16..abdb4a096f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -606,10 +606,10 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -630,10 +630,10 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o *\ -s*|s*) quiet="-q";; \ *) quiet="";; \ esac; \ diff --git a/system/base/python3/files/gentoo/0007-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch b/system/base/python3/files/gentoo/0007-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch new file mode 100644 index 00000000..850ab7ee --- /dev/null +++ b/system/base/python3/files/gentoo/0007-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch @@ -0,0 +1,81 @@ +From 91d3cec0fc9139817414a9d8af5ba29d22e2e751 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 5 Jun 2016 08:18:01 +0200 +Subject: [PATCH 07/14] distutils: make -OO enable both opt-1 and opt-2 + optimization + +Bug: http://bugs.python.org/issue27226 +Bug: https://bugs.gentoo.org/585060 +--- + Lib/distutils/command/build_py.py | 8 ++++---- + Lib/distutils/command/install_lib.py | 12 ++++++------ + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py +index edc2171cd1..e34749d6eb 100644 +--- a/Lib/distutils/command/build_py.py ++++ b/Lib/distutils/command/build_py.py +@@ -315,9 +315,9 @@ class build_py (Command): + if self.compile: + outputs.append(importlib.util.cache_from_source( + filename, optimization='')) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + outputs.append(importlib.util.cache_from_source( +- filename, optimization=self.optimize)) ++ filename, optimization=opt)) + + outputs += [ + os.path.join(build_dir, filename) +@@ -387,8 +387,8 @@ class build_py (Command): + if self.compile: + byte_compile(files, optimize=0, + force=self.force, prefix=prefix, dry_run=self.dry_run) +- if self.optimize > 0: +- byte_compile(files, optimize=self.optimize, ++ for opt in range(1, self.optimize + 1): ++ byte_compile(files, optimize=opt, + force=self.force, prefix=prefix, dry_run=self.dry_run) + + class build_py_2to3(build_py, Mixin2to3): +diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py +index 6154cf0943..049b662566 100644 +--- a/Lib/distutils/command/install_lib.py ++++ b/Lib/distutils/command/install_lib.py +@@ -24,8 +24,8 @@ class install_lib(Command): + # 2) compile .pyc only (--compile --no-optimize; default) + # 3) compile .pyc and "opt-1" .pyc (--compile --optimize) + # 4) compile "opt-1" .pyc only (--no-compile --optimize) +- # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more) +- # 6) compile "opt-2" .pyc only (--no-compile --optimize-more) ++ # 5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more) ++ # 6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more) + # + # The UI for this is two options, 'compile' and 'optimize'. + # 'compile' is strictly boolean, and only decides whether to +@@ -132,8 +132,8 @@ class install_lib(Command): + byte_compile(files, optimize=0, + force=self.force, prefix=install_root, + dry_run=self.dry_run) +- if self.optimize > 0: +- byte_compile(files, optimize=self.optimize, ++ for opt in range(1, self.optimize + 1): ++ byte_compile(files, optimize=opt, + force=self.force, prefix=install_root, + verbose=self.verbose, dry_run=self.dry_run) + +@@ -167,9 +167,9 @@ class install_lib(Command): + if self.compile: + bytecode_files.append(importlib.util.cache_from_source( + py_file, optimization='')) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + bytecode_files.append(importlib.util.cache_from_source( +- py_file, optimization=self.optimize)) ++ py_file, optimization=opt)) + + return bytecode_files + +-- +2.33.0 + diff --git a/system/base/python3/pspec.xml b/system/base/python3/pspec.xml index 4105f715..525b4988 100644 --- a/system/base/python3/pspec.xml +++ b/system/base/python3/pspec.xml @@ -12,7 +12,7 @@ custom Next generation of the python high-level scripting language Python is an accessible, high-level, dynamically typed, interpreted programming language, designed with an emphasis on code readability. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. - https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz + https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tar.xz bzip2 @@ -34,10 +34,7 @@ gentoo/0001-Install-libpythonX.Y.a-in-usr-lib-instead-of-usr-lib.patch gentoo/0004-setup.py-exit-with-non-zero-status-on-failure.patch gentoo/0005-Improve-distutils-C-support.patch - gentoo/0006-h2py-use-binary-I-O-to-avoid-encoding-issues.patch - gentoo/0008-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch - gentoo/0016-bpo-43650-Fix-MemoryError-on-zip.read-in-shutil._unp.patch - gentoo/0017-bpo-43998-Default-to-TLS-1.2-and-increase-cipher-sui.patch + gentoo/0007-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch @@ -60,59 +57,60 @@ /usr/bin/p* /usr/bin/2to3* - /usr/lib/python3.8/a* - /usr/lib/python3.8/c* - /usr/lib/python3.8/d* - /usr/lib/python3.8/e* - /usr/lib/python3.8/h* - /usr/lib/python3.8/imp* - /usr/lib/python3.8/j* - /usr/lib/python3.8/lib2* - /usr/lib/python3.8/log* - /usr/lib/python3.8/m* - /usr/lib/python3.8/p* - /usr/lib/python3.8/s* - /usr/lib/python3.8/te* - /usr/lib/python3.8/u* - /usr/lib/python3.8/v* - /usr/lib/python3.8/w* - /usr/lib/python3.8/x* - /usr/lib/python3.8/*.py - /usr/lib/python3.8/*.txt - /usr/lib/python3.8/lib-dynload/_a* - /usr/lib/python3.8/lib-dynload/a* - /usr/lib/python3.8/lib-dynload/b* - /usr/lib/python3.8/lib-dynload/_b* - /usr/lib/python3.8/lib-dynload/c* - /usr/lib/python3.8/lib-dynload/_c* - /usr/lib/python3.8/lib-dynload/_d* - /usr/lib/python3.8/lib-dynload/_e* - /usr/lib/python3.8/lib-dynload/f* - /usr/lib/python3.8/lib-dynload/g* - /usr/lib/python3.8/lib-dynload/_g* - /usr/lib/python3.8/lib-dynload/_h* - /usr/lib/python3.8/lib-dynload/_j* - /usr/lib/python3.8/lib-dynload/_l* - /usr/lib/python3.8/lib-dynload/m* - /usr/lib/python3.8/lib-dynload/_m* - /usr/lib/python3.8/lib-dynload/n* - /usr/lib/python3.8/lib-dynload/o* - /usr/lib/python3.8/lib-dynload/_o* - /usr/lib/python3.8/lib-dynload/_p* - /usr/lib/python3.8/lib-dynload/p* - /usr/lib/python3.8/lib-dynload/r* - /usr/lib/python3.8/lib-dynload/_r* - /usr/lib/python3.8/lib-dynload/_s* - /usr/lib/python3.8/lib-dynload/s* - /usr/lib/python3.8/lib-dynload/te* - /usr/lib/python3.8/lib-dynload/_te* - /usr/lib/python3.8/lib-dynload/ti* - /usr/lib/python3.8/lib-dynload/u* - /usr/lib/python3.8/lib-dynload/x* - /usr/lib/python3.8/lib-dynload/z* - /usr/lib/python3.8/__pycache__ + /usr/lib/python3.9/a* + /usr/lib/python3.9/c* + /usr/lib/python3.9/d* + /usr/lib/python3.9/e* + /usr/lib/python3.9/h* + /usr/lib/python3.9/imp* + /usr/lib/python3.9/j* + /usr/lib/python3.9/lib2* + /usr/lib/python3.9/log* + /usr/lib/python3.9/m* + /usr/lib/python3.9/p* + /usr/lib/python3.9/s* + /usr/lib/python3.9/te* + /usr/lib/python3.9/u* + /usr/lib/python3.9/v* + /usr/lib/python3.9/w* + /usr/lib/python3.9/x* + /usr/lib/python3.9/*.py + /usr/lib/python3.9/*.txt + /usr/lib/python3.9/lib-dynload/_a* + /usr/lib/python3.9/lib-dynload/a* + /usr/lib/python3.9/lib-dynload/b* + /usr/lib/python3.9/lib-dynload/_b* + /usr/lib/python3.9/lib-dynload/c* + /usr/lib/python3.9/lib-dynload/_c* + /usr/lib/python3.9/lib-dynload/_d* + /usr/lib/python3.9/lib-dynload/_e* + /usr/lib/python3.9/lib-dynload/f* + /usr/lib/python3.9/lib-dynload/g* + /usr/lib/python3.9/lib-dynload/_g* + /usr/lib/python3.9/lib-dynload/_h* + /usr/lib/python3.9/lib-dynload/_j* + /usr/lib/python3.9/lib-dynload/_l* + /usr/lib/python3.9/lib-dynload/m* + /usr/lib/python3.9/lib-dynload/_m* + /usr/lib/python3.9/lib-dynload/n* + /usr/lib/python3.9/lib-dynload/o* + /usr/lib/python3.9/lib-dynload/_o* + /usr/lib/python3.9/lib-dynload/_p* + /usr/lib/python3.9/lib-dynload/p* + /usr/lib/python3.9/lib-dynload/r* + /usr/lib/python3.9/lib-dynload/_r* + /usr/lib/python3.9/lib-dynload/_s* + /usr/lib/python3.9/lib-dynload/s* + /usr/lib/python3.9/lib-dynload/te* + /usr/lib/python3.9/lib-dynload/_te* + /usr/lib/python3.9/lib-dynload/ti* + /usr/lib/python3.9/lib-dynload/u* + /usr/lib/python3.9/lib-dynload/x* + /usr/lib/python3.9/lib-dynload/z* + /usr/lib/python3.9/__pycache__ + /usr/lib/python3.9/zoneinfo/__pycache__/*.pyc /usr/lib/*.so - /usr/lib/libpython3.8.so* + /usr/lib/libpython3.9.so* /usr/share/man/man1/* /usr/share/doc @@ -125,12 +123,19 @@ python3 - /usr/include/python3.8/* + /usr/include/python3.9/* /usr/lib/pkgconfig/* + + 2021-10-22 + 3.9.7 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2021-10-18 3.8.12