From d6bc1d879d4907f8408ee19ed3e019d30cb2bc73 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Thu, 19 Dec 2019 12:27:39 +0300 Subject: [PATCH] 3.8.1 --- .abf.yml | 4 +- 00001-rpath.patch | 19 + 00102-lib64.patch | 261 +++++++++++++ 00111-no-static-lib.patch | 78 ++++ 00189-use-rpm-wheels.patch | 51 +++ 00205-make-libpl-respect-lib64.patch | 12 + 00251-change-user-install-location.patch | 46 +++ 00274-fix-arch-names.patch | 86 +++++ 00328-pyc-timestamp-invalidation-mode.patch | 55 +++ link-C-modules-with-libpython.patch | 13 + python-2.7.13-lib64.patch | 345 ++++++++++++++++++ ...on3-3.5.2-dont-raise-from-py_compile.patch | 21 ++ ...istutils-tests-that-fail-in-rpmbuild.patch | 18 + ...thon3-config-LIBPLUSED-cmp0004-error.patch | 26 ++ python3-3.7.1-module-linkage.patch | 21 ++ python3-3.7.1-uid-gid-overflows.patch | 17 + python3.spec | 140 +++---- 17 files changed, 1151 insertions(+), 62 deletions(-) create mode 100644 00001-rpath.patch create mode 100644 00102-lib64.patch create mode 100644 00111-no-static-lib.patch create mode 100644 00189-use-rpm-wheels.patch create mode 100644 00205-make-libpl-respect-lib64.patch create mode 100644 00251-change-user-install-location.patch create mode 100644 00274-fix-arch-names.patch create mode 100644 00328-pyc-timestamp-invalidation-mode.patch create mode 100644 link-C-modules-with-libpython.patch create mode 100644 python-2.7.13-lib64.patch create mode 100644 python3-3.5.2-dont-raise-from-py_compile.patch create mode 100644 python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch create mode 100644 python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch create mode 100644 python3-3.7.1-module-linkage.patch create mode 100644 python3-3.7.1-uid-gid-overflows.patch diff --git a/.abf.yml b/.abf.yml index a61cf9e..6da803e 100644 --- a/.abf.yml +++ b/.abf.yml @@ -9,6 +9,7 @@ removed_sources: Python-3.4.3.tar.xz: 7ca5cd664598bea96eec105aa6453223bb6b4456 Python-3.4.5.tar.xz: 882e83e0286b253ee651aa3f9a5d27ebc46e6632 Python-3.5.1.tar.xz: 0186da436db76776196612b98bb9c2f76acfe90e + Python-3.5.2.tar.xz: 4843aabacec5bc0cdd3e1f778faa926e532794d2 python-3.3.0-docs-html.tar.bz2: 5299b1523ede931767199a5b13388a5bf35351d5 python-3.3.1-docs-html.tar.bz2: 55c3b3f3453346835b0df2b3b0ad7fe20833a7f7 python-3.3.2-docs-html.tar.bz2: 514e1a0810fa9e6433f4bc64bdc0ad407d49ebc5 @@ -17,6 +18,7 @@ removed_sources: python-3.4.0-docs-html.tar.bz2: d6e8f45219353b128f002f3a7311ec4e08c0ca49 python-3.4.1-docs-html.tar.bz2: acc5911f0e41774788121064e004941e6090542a sources: - Python-3.5.2.tar.xz: 4843aabacec5bc0cdd3e1f778faa926e532794d2 + Python-3.8.1.tar.xz: a48fd28a037c0bcd7b7fc4d914c023f584e910ed python-3.4.2-docs-html.tar.bz2: 29fd43d785d545959b744ba44c9cbe314c12804b python-3.5.2-docs-html.tar.bz2: 72829db77244df58fe949a5ba7d9b55fd384d170 + python-3.8.1rc1-docs-html.tar.bz2: 0576d82ac59a0c37dff4f697c658f0dc8f6c8ea2 diff --git a/00001-rpath.patch b/00001-rpath.patch new file mode 100644 index 0000000..9fae54c --- /dev/null +++ b/00001-rpath.patch @@ -0,0 +1,19 @@ +diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/distutils/unixccompiler.py +--- Python-3.1.1/Lib/distutils/unixccompiler.py.rpath 2009-09-04 17:29:34.000000000 -0400 ++++ Python-3.1.1/Lib/distutils/unixccompiler.py 2009-09-04 17:49:54.000000000 -0400 +@@ -141,6 +141,15 @@ class UnixCCompiler(CCompiler): + if sys.platform == "cygwin": + exe_extension = ".exe" + ++ def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs): ++ """Remove standard library path from rpath""" ++ libraries, library_dirs, runtime_library_dirs = super()._fix_lib_args( ++ libraries, library_dirs, runtime_library_dirs) ++ libdir = sysconfig.get_config_var('LIBDIR') ++ if runtime_library_dirs and (libdir in runtime_library_dirs): ++ runtime_library_dirs.remove(libdir) ++ return libraries, library_dirs, runtime_library_dirs ++ + def preprocess(self, source, output_file=None, macros=None, + include_dirs=None, extra_preargs=None, extra_postargs=None): + fixed_args = self._fix_compile_args(None, macros, include_dirs) diff --git a/00102-lib64.patch b/00102-lib64.patch new file mode 100644 index 0000000..27b53e8 --- /dev/null +++ b/00102-lib64.patch @@ -0,0 +1,261 @@ +From 81904771db8b112c8617a111e989b68e55af7a9c Mon Sep 17 00:00:00 2001 +From: David Malcolm +Date: Wed, 13 Jan 2010 21:25:18 +0000 +Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/ + instead or /usr/lib/ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Only used when "%{_lib}" == "lib64". + +Co-authored-by: David Malcolm +Co-authored-by: Thomas Spura +Co-authored-by: Slavek Kabrda +Co-authored-by: Matej Stuchlik +Co-authored-by: Tomas Orsava +Co-authored-by: Charalampos Stratakis +Co-authored-by: Petr Viktorin +Co-authored-by: Miro Hrončok +Co-authored-by: Iryna Shcherbina +--- + Lib/distutils/command/install.py | 4 ++-- + Lib/distutils/sysconfig.py | 6 +++++- + Lib/distutils/tests/test_install.py | 3 ++- + Lib/site.py | 4 ++++ + Lib/sysconfig.py | 12 ++++++------ + Lib/test/test_site.py | 4 ++-- + Makefile.pre.in | 2 +- + Modules/getpath.c | 6 +++--- + configure | 4 ++-- + configure.ac | 4 ++-- + setup.py | 6 +++--- + 11 files changed, 32 insertions(+), 23 deletions(-) + +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index c625c95bf7..ae4f915669 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -30,14 +30,14 @@ WINDOWS_SCHEME = { + INSTALL_SCHEMES = { + 'unix_prefix': { + 'purelib': '$base/lib/python$py_version_short/site-packages', +- 'platlib': '$platbase/lib/python$py_version_short/site-packages', ++ 'platlib': '$platbase/lib64/python$py_version_short/site-packages', + 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', + }, + 'unix_home': { + 'purelib': '$base/lib/python', +- 'platlib': '$base/lib/python', ++ 'platlib': '$base/lib64/python', + 'headers': '$base/include/python/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index b51629eb94..9a4892a737 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -146,8 +146,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + prefix = plat_specific and EXEC_PREFIX or PREFIX + + if os.name == "posix": ++ if plat_specific or standard_lib: ++ lib = "lib64" ++ else: ++ lib = "lib" + libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) ++ lib, "python" + get_python_version()) + if standard_lib: + return libpython + else: +diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py +index 287ab1989e..d4c05e0ab1 100644 +--- a/Lib/distutils/tests/test_install.py ++++ b/Lib/distutils/tests/test_install.py +@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager, + self.assertEqual(got, expected) + + libdir = os.path.join(destination, "lib", "python") ++ platlibdir = os.path.join(destination, "lib64", "python") + check_path(cmd.install_lib, libdir) +- check_path(cmd.install_platlib, libdir) ++ check_path(cmd.install_platlib, platlibdir) + check_path(cmd.install_purelib, libdir) + check_path(cmd.install_headers, + os.path.join(destination, "include", "python", "foopkg")) +diff --git a/Lib/site.py b/Lib/site.py +index a065ab0b5d..22d53fa562 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -335,11 +335,15 @@ def getsitepackages(prefixes=None): + seen.add(prefix) + + if os.sep == '/': ++ sitepackages.append(os.path.join(prefix, "lib64", ++ "python" + sys.version[:3], ++ "site-packages")) + sitepackages.append(os.path.join(prefix, "lib", + "python%d.%d" % sys.version_info[:2], + "site-packages")) + else: + sitepackages.append(prefix) ++ sitepackages.append(os.path.join(prefix, "lib64", "site-packages")) + sitepackages.append(os.path.join(prefix, "lib", "site-packages")) + return sitepackages + +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index b9e2fafbc0..0ae6d35b69 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -20,10 +20,10 @@ __all__ = [ + + _INSTALL_SCHEMES = { + 'posix_prefix': { +- 'stdlib': '{installed_base}/lib/python{py_version_short}', +- 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'stdlib': '{installed_base}/lib64/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib64/python{py_version_short}', + 'purelib': '{base}/lib/python{py_version_short}/site-packages', +- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', ++ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages', + 'include': + '{installed_base}/include/python{py_version_short}{abiflags}', + 'platinclude': +@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = { + 'data': '{userbase}', + }, + 'posix_user': { +- 'stdlib': '{userbase}/lib/python{py_version_short}', +- 'platstdlib': '{userbase}/lib/python{py_version_short}', ++ 'stdlib': '{userbase}/lib64/python{py_version_short}', ++ 'platstdlib': '{userbase}/lib64/python{py_version_short}', + 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', +- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', ++ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages', + 'include': '{userbase}/include/python{py_version_short}', + 'scripts': '{userbase}/bin', + 'data': '{userbase}', +diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py +index 41c4229919..543c88432a 100644 +--- a/Lib/test/test_site.py ++++ b/Lib/test/test_site.py +@@ -266,8 +266,8 @@ class HelperFunctionsTests(unittest.TestCase): + dirs = site.getsitepackages() + if os.sep == '/': + # OS X, Linux, FreeBSD, etc +- self.assertEqual(len(dirs), 1) +- wanted = os.path.join('xoxo', 'lib', ++ self.assertEqual(len(dirs), 2) ++ wanted = os.path.join('xoxo', 'lib64', + 'python%d.%d' % sys.version_info[:2], + 'site-packages') + self.assertEqual(dirs[0], wanted) +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 502317aa0c..4ad3df1122 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -143,7 +143,7 @@ LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= $(prefix)/lib64 + ABIFLAGS= @ABIFLAGS@ + + # Detailed destination directories +diff --git a/Modules/getpath.c b/Modules/getpath.c +index b727f66953..a0c5fb6139 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, + if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) { + return PATHLEN_ERR(); + } +- status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len); ++ status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len); + if (_PyStatus_EXCEPTION(status)) { + return status; + } +@@ -1067,7 +1067,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix, + return PATHLEN_ERR(); + } + } +- status = joinpath(zip_path, L"lib/python00.zip", zip_path_len); ++ status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len); + if (_PyStatus_EXCEPTION(status)) { + return status; + } +@@ -1197,7 +1197,7 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config) + if (!calculate->exec_prefix) { + return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); + } +- calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len); ++ calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len); + if (!calculate->lib_python) { + return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); + } +diff --git a/configure b/configure +index 2a933cdbeb..bec365124e 100755 +--- a/configure ++++ b/configure +@@ -15182,9 +15182,9 @@ fi + + + if test x$PLATFORM_TRIPLET = x; then +- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}" ++ LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}" + else +- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" ++ LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" + fi + + +diff --git a/configure.ac b/configure.ac +index a189d42c2c..154a0aa5cc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4668,9 +4668,9 @@ fi + dnl define LIBPL after ABIFLAGS and LDVERSION is defined. + AC_SUBST(PY_ENABLE_SHARED) + if test x$PLATFORM_TRIPLET = x; then +- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}" ++ LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}" + else +- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" ++ LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" + fi + AC_SUBST(LIBPL) + +diff --git a/setup.py b/setup.py +index 20d7f35652..024a1035c0 100644 +--- a/setup.py ++++ b/setup.py +@@ -649,7 +649,7 @@ class PyBuildExt(build_ext): + # directories (i.e. '.' and 'Include') must be first. See issue + # 10520. + if not CROSS_COMPILING: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') ++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64') + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + # only change this for cross builds for 3.3, issues on Mageia + if CROSS_COMPILING: +@@ -953,11 +953,11 @@ class PyBuildExt(build_ext): + elif curses_library: + readline_libs.append(curses_library) + elif self.compiler.find_library_file(self.lib_dirs + +- ['/usr/lib/termcap'], ++ ['/usr/lib64/termcap'], + 'termcap'): + readline_libs.append('termcap') + self.add(Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], ++ library_dirs=['/usr/lib64/termcap'], + extra_link_args=readline_extra_link_args, + libraries=readline_libs)) + else: +-- +2.21.0 + diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch new file mode 100644 index 0000000..cb7b91b --- /dev/null +++ b/00111-no-static-lib.patch @@ -0,0 +1,78 @@ +From 5b9fcc86532051bea5d0e9fa856b014f229f4794 Mon Sep 17 00:00:00 2001 +From: David Malcolm +Date: Mon, 18 Jan 2010 17:59:07 +0000 +Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Downstream only: not appropriate for upstream. + +See https://bugzilla.redhat.com/show_bug.cgi?id=556092 + +Co-authored-by: David Malcolm +Co-authored-by: Bohuslav Kabrda +Co-authored-by: Matej Stuchlik +Co-authored-by: Robert Kuska +Co-authored-by: Charalampos Stratakis +Co-authored-by: Miro Hrončok +--- + Makefile.pre.in | 21 ++------------------- + 1 file changed, 2 insertions(+), 19 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 4ad3df1122..72d202d71b 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -562,7 +562,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) + + # Build the interpreter +-$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) + + platform: $(BUILDPYTHON) pybuilddir.txt +@@ -610,12 +610,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + +- +-# Build static library +-$(LIBRARY): $(LIBRARY_OBJS) +- -rm -f $@ +- $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) +- + libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS) + if test $(INSTSONAME) != $(LDLIBRARY); then \ + $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ +@@ -693,7 +687,7 @@ Makefile Modules/config.c: Makefile.pre \ + @echo "The Makefile was updated, you may need to re-run make." + + +-Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) + + ############################################################################ +@@ -1557,17 +1551,6 @@ libainstall: @DEF_MAKE_RULE@ python-config + else true; \ + fi; \ + done +- @if test -d $(LIBRARY); then :; else \ +- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ +- if test "$(SHLIB_SUFFIX)" = .dll; then \ +- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ +- else \ +- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ +- fi; \ +- else \ +- echo Skip install of $(LIBRARY) - use make frameworkinstall; \ +- fi; \ +- fi + $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c + $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o + $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in +-- +2.21.0 + diff --git a/00189-use-rpm-wheels.patch b/00189-use-rpm-wheels.patch new file mode 100644 index 0000000..1afdab1 --- /dev/null +++ b/00189-use-rpm-wheels.patch @@ -0,0 +1,51 @@ +diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py +index 4748ba4..fc02255 100644 +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py +@@ -1,16 +1,27 @@ ++import distutils.version ++import glob + import os + import os.path +-import pkgutil + import sys + import tempfile + + + __all__ = ["version", "bootstrap"] + ++_WHEEL_DIR = "/usr/share/python-wheels/" + +-_SETUPTOOLS_VERSION = "40.6.2" + +-_PIP_VERSION = "18.1" ++def _get_most_recent_wheel_version(pkg): ++ prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg)) ++ suffix = "-py2.py3-none-any.whl" ++ pattern = "{}*{}".format(prefix, suffix) ++ versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern)) ++ return str(max(versions, key=distutils.version.LooseVersion)) ++ ++ ++_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools") ++ ++_PIP_VERSION = _get_most_recent_wheel_version("pip") + + _PROJECTS = [ + ("setuptools", _SETUPTOOLS_VERSION), +@@ -94,12 +105,9 @@ def _bootstrap(*, root=None, upgrade=False, user=False, + additional_paths = [] + for project, version in _PROJECTS: + wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) +- whl = pkgutil.get_data( +- "ensurepip", +- "_bundled/{}".format(wheel_name), +- ) +- with open(os.path.join(tmpdir, wheel_name), "wb") as fp: +- fp.write(whl) ++ with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp: ++ with open(os.path.join(tmpdir, wheel_name), "wb") as fp: ++ fp.write(sfp.read()) + + additional_paths.append(os.path.join(tmpdir, wheel_name)) + diff --git a/00205-make-libpl-respect-lib64.patch b/00205-make-libpl-respect-lib64.patch new file mode 100644 index 0000000..3e7c797 --- /dev/null +++ b/00205-make-libpl-respect-lib64.patch @@ -0,0 +1,12 @@ +diff -up Python-3.5.0/Makefile.pre.in.lib Python-3.5.0/Makefile.pre.in +--- Python-3.5.0/Makefile.pre.in.lib 2015-09-21 15:39:47.928286620 +0200 ++++ Python-3.5.0/Makefile.pre.in 2015-09-21 15:42:58.004042762 +0200 +@@ -1340,7 +1340,7 @@ inclinstall: + + # Install the library and miscellaneous stuff needed for extending/embedding + # This goes into $(exec_prefix) +-LIBPL= @LIBPL@ ++LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) + + # pkgconfig directory + LIBPC= $(LIBDIR)/pkgconfig diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch new file mode 100644 index 0000000..4104449 --- /dev/null +++ b/00251-change-user-install-location.patch @@ -0,0 +1,46 @@ +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index 0258d3d..4ebf50a 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -418,8 +418,19 @@ 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 is set to sys.prefix + /local/ ++ # if neither RPM build nor virtual environment is ++ # detected to make pip and distutils install packages ++ # into the separate location. ++ if (not (hasattr(sys, 'real_prefix') or ++ sys.prefix != sys.base_prefix) and ++ 'RPM_BUILD_ROOT' not in os.environ): ++ addition = "/local" ++ else: ++ addition = "" ++ ++ self.prefix = os.path.normpath(sys.prefix) + addition ++ self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition + + else: + if self.exec_prefix is None: +diff --git a/Lib/site.py b/Lib/site.py +index 0fc9200..c95202e 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -322,7 +322,14 @@ def getsitepackages(prefixes=None): + return sitepackages + + def addsitepackages(known_paths, prefixes=None): +- """Add site-packages to sys.path""" ++ """Add site-packages to sys.path ++ ++ '/usr/local' is included in PREFIXES if RPM build is not detected ++ to make packages installed into this location visible. ++ ++ """ ++ if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ: ++ PREFIXES.insert(0, "/usr/local") + for sitedir in getsitepackages(prefixes): + if os.path.isdir(sitedir): + addsitedir(sitedir, known_paths) diff --git a/00274-fix-arch-names.patch b/00274-fix-arch-names.patch new file mode 100644 index 0000000..f129696 --- /dev/null +++ b/00274-fix-arch-names.patch @@ -0,0 +1,86 @@ +From 02443c3177bd15ddc48e7c3fc1dd2b6a3c095888 Mon Sep 17 00:00:00 2001 +From: Petr Viktorin +Date: Mon, 28 Aug 2017 17:16:46 +0200 +Subject: [PATCH] 00274: Upstream uses Debian-style architecture naming, change + to match Fedora +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Petr Viktorin +Co-authored-by: Miro Hrončok +Co-authored-by: Tomas Orsava +--- + config.sub | 2 +- + configure.ac | 16 ++++++++-------- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/config.sub b/config.sub +index ba37cf99e2..52a9ec6662 100755 +--- a/config.sub ++++ b/config.sub +@@ -1042,7 +1042,7 @@ case $basic_machine in + ;; + ppc64) basic_machine=powerpc64-unknown + ;; +- ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown +diff --git a/configure.ac b/configure.ac +index 154a0aa5cc..273954f461 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -741,9 +741,9 @@ cat >> conftest.c <> conftest.c <> conftest.c < +Date: Thu, 11 Jul 2019 13:44:13 +0200 +Subject: [PATCH] 00328: Restore pyc to TIMESTAMP invalidation mode as default + in rpmbuild + +Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest +%changelog date. This makes Python default to the CHECKED_HASH pyc +invalidation mode, bringing more reproducible builds traded for an import +performance decrease. To avoid that, we don't default to CHECKED_HASH +when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages). + +See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 +--- + Lib/py_compile.py | 3 ++- + Lib/test/test_py_compile.py | 2 ++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Lib/py_compile.py b/Lib/py_compile.py +index 21736896af..310bed5620 100644 +--- a/Lib/py_compile.py ++++ b/Lib/py_compile.py +@@ -70,7 +70,8 @@ class PycInvalidationMode(enum.Enum): + + + def _get_default_invalidation_mode(): +- if os.environ.get('SOURCE_DATE_EPOCH'): ++ if (os.environ.get('SOURCE_DATE_EPOCH') and not ++ os.environ.get('RPM_BUILD_ROOT')): + return PycInvalidationMode.CHECKED_HASH + else: + return PycInvalidationMode.TIMESTAMP +diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py +index d6677ab45f..88059b127e 100644 +--- a/Lib/test/test_py_compile.py ++++ b/Lib/test/test_py_compile.py +@@ -17,6 +17,7 @@ def without_source_date_epoch(fxn): + def wrapper(*args, **kwargs): + with support.EnvironmentVarGuard() as env: + env.unset('SOURCE_DATE_EPOCH') ++ env.unset('RPM_BUILD_ROOT') + return fxn(*args, **kwargs) + return wrapper + +@@ -27,6 +28,7 @@ def with_source_date_epoch(fxn): + def wrapper(*args, **kwargs): + with support.EnvironmentVarGuard() as env: + env['SOURCE_DATE_EPOCH'] = '123456789' ++ env.unset('RPM_BUILD_ROOT') + return fxn(*args, **kwargs) + return wrapper + +-- +2.21.0 + diff --git a/link-C-modules-with-libpython.patch b/link-C-modules-with-libpython.patch new file mode 100644 index 0000000..c685394 --- /dev/null +++ b/link-C-modules-with-libpython.patch @@ -0,0 +1,13 @@ +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index 2d7cdf0..058809b 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -724,7 +724,7 @@ class build_ext(Command): + # Windows like MinGW) it is simply necessary that all symbols in + # shared libraries are resolved at link time. + from distutils.sysconfig import get_config_var +- link_libpython = False ++ link_libpython = True + if get_config_var('Py_ENABLE_SHARED'): + # A native build on an Android device or on Cygwin + if hasattr(sys, 'getandroidapilevel'): diff --git a/python-2.7.13-lib64.patch b/python-2.7.13-lib64.patch new file mode 100644 index 0000000..0b01217 --- /dev/null +++ b/python-2.7.13-lib64.patch @@ -0,0 +1,345 @@ +diff -Naur Python-2.7.13.orig/configure.ac Python-2.7.13/configure.ac +--- Python-2.7.13.orig/configure.ac 2017-12-03 17:32:19.000000000 +0300 ++++ Python-2.7.13/configure.ac 2017-12-03 17:32:27.000000000 +0300 +@@ -759,6 +759,41 @@ + ;; + esac + ++AC_SUBST(ARCH) ++AC_MSG_CHECKING(ARCH) ++ARCH=`uname -m` ++case $ARCH in ++i?86) ARCH=i386;; ++esac ++AC_MSG_RESULT($ARCH) ++ ++AC_SUBST(LIB) ++AC_MSG_CHECKING(LIB) ++case $ac_sys_system in ++Linux*) ++ # Test if the compiler is 64bit ++ echo 'int i;' > conftest.$ac_ext ++ python_cv_cc_64bit_output=no ++ if AC_TRY_EVAL(ac_compile); then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *"ELF 64"*) ++ python_cv_cc_64bit_output=yes ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++esac ++ ++case $ARCH:$python_cv_cc_64bit_output in ++ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) ++ LIB="lib64" ++ ;; ++*:*) ++ LIB="lib" ++ ;; ++esac ++AC_MSG_RESULT($LIB) + + AC_SUBST(LIBRARY) + AC_MSG_CHECKING(LIBRARY) +diff -Naur Python-2.7.13.orig/Include/pythonrun.h Python-2.7.13/Include/pythonrun.h +--- Python-2.7.13.orig/Include/pythonrun.h 2017-12-03 17:32:19.000000000 +0300 ++++ Python-2.7.13/Include/pythonrun.h 2017-12-03 17:32:26.000000000 +0300 +@@ -108,6 +108,8 @@ + /* In their own files */ + PyAPI_FUNC(const char *) Py_GetVersion(void); + PyAPI_FUNC(const char *) Py_GetPlatform(void); ++PyAPI_FUNC(const char *) Py_GetArch(void); ++PyAPI_FUNC(const char *) Py_GetLib(void); + PyAPI_FUNC(const char *) Py_GetCopyright(void); + PyAPI_FUNC(const char *) Py_GetCompiler(void); + PyAPI_FUNC(const char *) Py_GetBuildInfo(void); +diff -Naur Python-2.7.13.orig/Lib/distutils/command/install.py Python-2.7.13/Lib/distutils/command/install.py +--- Python-2.7.13.orig/Lib/distutils/command/install.py 2017-12-03 17:32:22.000000000 +0300 ++++ Python-2.7.13/Lib/distutils/command/install.py 2017-12-03 17:32:27.000000000 +0300 +@@ -22,6 +22,8 @@ + from site import USER_SITE + + ++libname = sys.lib ++ + if sys.version < "2.2": + WINDOWS_SCHEME = { + 'purelib': '$base', +@@ -42,14 +44,14 @@ + INSTALL_SCHEMES = { + 'unix_prefix': { + 'purelib': '$base/lib/python$py_version_short/site-packages', +- 'platlib': '$platbase/lib/python$py_version_short/site-packages', ++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', + 'headers': '$base/include/python$py_version_short/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', + }, + 'unix_home': { + 'purelib': '$base/lib/python', +- 'platlib': '$base/lib/python', ++ 'platlib': '$base/'+libname+'/python', + 'headers': '$base/include/python/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +diff -Naur Python-2.7.13.orig/Lib/distutils/sysconfig.py Python-2.7.13/Lib/distutils/sysconfig.py +--- Python-2.7.13.orig/Lib/distutils/sysconfig.py 2017-12-03 17:32:22.000000000 +0300 ++++ Python-2.7.13/Lib/distutils/sysconfig.py 2017-12-03 17:32:27.000000000 +0300 +@@ -119,8 +119,12 @@ + prefix = plat_specific and EXEC_PREFIX or PREFIX + + if os.name == "posix": ++ if plat_specific: ++ lib = sys.lib ++ else: ++ lib = 'lib' + libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) ++ lib, "python" + get_python_version()) + if standard_lib: + return libpython + else: +@@ -230,7 +234,8 @@ + else: + inc_dir = project_base + else: +- inc_dir = get_python_inc(plat_specific=1) ++ prefix = EXEC_PREFIX or PREFIX ++ inc_dir = os.path.join(prefix, "include", "multiarch-" + sys.arch + "-linux", "python" + sys.version[:3]) + if get_python_version() < '2.2': + config_h = 'config.h' + else: +diff -Naur Python-2.7.13.orig/Lib/distutils/tests/test_install.py Python-2.7.13/Lib/distutils/tests/test_install.py +--- Python-2.7.13.orig/Lib/distutils/tests/test_install.py 2017-12-03 17:32:22.000000000 +0300 ++++ Python-2.7.13/Lib/distutils/tests/test_install.py 2017-12-03 17:32:27.000000000 +0300 +@@ -57,8 +57,9 @@ + self.assertEqual(got, expected) + + libdir = os.path.join(destination, "lib", "python") ++ platlibdir = os.path.join(destination, sys.lib, "python") + check_path(cmd.install_lib, libdir) +- check_path(cmd.install_platlib, libdir) ++ check_path(cmd.install_platlib, platlibdir) + check_path(cmd.install_purelib, libdir) + check_path(cmd.install_headers, + os.path.join(destination, "include", "python", "foopkg")) +diff -Naur Python-2.7.13.orig/Lib/site.py Python-2.7.13/Lib/site.py +--- Python-2.7.13.orig/Lib/site.py 2017-12-03 17:32:22.000000000 +0300 ++++ Python-2.7.13/Lib/site.py 2017-12-03 17:40:44.000000000 +0300 +@@ -288,13 +288,18 @@ + if sys.platform in ('os2emx', 'riscos'): + sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) + elif os.sep == '/': +- sitepackages.append(os.path.join(prefix, "lib", ++ sitepackages.append(os.path.join(prefix, sys.lib, + "python" + sys.version[:3], + "site-packages")) +- sitepackages.append(os.path.join(prefix, "lib", "site-python")) ++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) ++ if sys.lib != 'lib': ++ sitepackages.append(os.path.join(prefix, 'lib', ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, 'lib', "site-python")) + else: + sitepackages.append(prefix) +- sitepackages.append(os.path.join(prefix, "lib", "site-packages")) ++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) + return sitepackages + + def addsitepackages(known_paths): +diff -Naur Python-2.7.13.orig/Lib/sysconfig.py Python-2.7.13/Lib/sysconfig.py +--- Python-2.7.13.orig/Lib/sysconfig.py 2017-12-03 17:32:23.000000000 +0300 ++++ Python-2.7.13/Lib/sysconfig.py 2017-12-03 17:32:27.000000000 +0300 +@@ -7,20 +7,20 @@ + + _INSTALL_SCHEMES = { + 'posix_prefix': { +- 'stdlib': '{base}/lib/python{py_version_short}', +- 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}', ++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', + 'purelib': '{base}/lib/python{py_version_short}/site-packages', +- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', ++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': '{base}/include/python{py_version_short}', + 'platinclude': '{platbase}/include/python{py_version_short}', + 'scripts': '{base}/bin', + 'data': '{base}', + }, + 'posix_home': { +- 'stdlib': '{base}/lib/python', +- 'platstdlib': '{base}/lib/python', ++ 'stdlib': '{base}/'+sys.lib+'/python', ++ 'platstdlib': '{base}/'+sys.lib+'/python', + 'purelib': '{base}/lib/python', +- 'platlib': '{base}/lib/python', ++ 'platlib': '{base}/'+sys.lib+'/python', + 'include': '{base}/include/python', + 'platinclude': '{base}/include/python', + 'scripts': '{base}/bin', +@@ -65,10 +65,10 @@ + 'data' : '{userbase}', + }, + 'posix_user': { +- 'stdlib': '{userbase}/lib/python{py_version_short}', +- 'platstdlib': '{userbase}/lib/python{py_version_short}', ++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', ++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', + 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', +- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', ++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', + 'include': '{userbase}/include/python{py_version_short}', + 'scripts': '{userbase}/bin', + 'data' : '{userbase}', +diff -Naur Python-2.7.13.orig/Makefile.pre.in Python-2.7.13/Makefile.pre.in +--- Python-2.7.13.orig/Makefile.pre.in 2017-12-03 17:32:19.000000000 +0300 ++++ Python-2.7.13/Makefile.pre.in 2017-12-03 17:32:27.000000000 +0300 +@@ -92,6 +92,8 @@ + + # Machine-dependent subdirectories + MACHDEP= @MACHDEP@ ++LIB= @LIB@ ++ARCH= @ARCH@ + + # Multiarch directory (may be empty) + MULTIARCH= @MULTIARCH@ +@@ -111,7 +113,7 @@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= $(prefix)/$(LIB) + + # Detailed destination directories + BINLIBDEST= $(LIBDIR)/python$(VERSION) +@@ -708,7 +710,7 @@ + Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) + + Python/getplatform.o: $(srcdir)/Python/getplatform.c +- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c ++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c + + Python/importdl.o: $(srcdir)/Python/importdl.c + $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c +diff -Naur Python-2.7.13.orig/Modules/getpath.c Python-2.7.13/Modules/getpath.c +--- Python-2.7.13.orig/Modules/getpath.c 2017-12-03 17:32:25.000000000 +0300 ++++ Python-2.7.13/Modules/getpath.c 2017-12-03 17:32:27.000000000 +0300 +@@ -100,6 +100,19 @@ + #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" + #endif + ++#ifndef LIB_PYTHON ++#if defined(__x86_64__) || defined(__powerpc64__) ++#define LIB_PYTHON "lib64/python" VERSION ++#else ++#define LIB_PYTHON "lib/python" VERSION ++#endif ++#endif ++ ++#ifndef PYTHONPATH ++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ ++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" ++#endif ++ + #ifndef LANDMARK + #define LANDMARK "os.py" + #endif +@@ -108,7 +121,7 @@ + static char exec_prefix[MAXPATHLEN+1]; + static char progpath[MAXPATHLEN+1]; + static char *module_search_path = NULL; +-static char lib_python[] = "lib/python" VERSION; ++static char lib_python[] = LIB_PYTHON; + + static void + reduce(char *dir) +diff -Naur Python-2.7.13.orig/Python/getplatform.c Python-2.7.13/Python/getplatform.c +--- Python-2.7.13.orig/Python/getplatform.c 2017-12-03 17:32:21.000000000 +0300 ++++ Python-2.7.13/Python/getplatform.c 2017-12-03 17:32:27.000000000 +0300 +@@ -10,3 +10,23 @@ + { + return PLATFORM; + } ++ ++#ifndef ARCH ++#define ARCH "unknown" ++#endif ++ ++const char * ++Py_GetArch(void) ++{ ++ return ARCH; ++} ++ ++#ifndef LIB ++#define LIB "lib" ++#endif ++ ++const char * ++Py_GetLib(void) ++{ ++ return LIB; ++} +diff -Naur Python-2.7.13.orig/Python/sysmodule.c Python-2.7.13/Python/sysmodule.c +--- Python-2.7.13.orig/Python/sysmodule.c 2017-12-03 17:32:21.000000000 +0300 ++++ Python-2.7.13/Python/sysmodule.c 2017-12-03 17:32:27.000000000 +0300 +@@ -1439,6 +1439,10 @@ + PyString_FromString(Py_GetPlatform())); + SET_SYS_FROM_STRING("executable", + PyString_FromString(Py_GetProgramFullPath())); ++ SET_SYS_FROM_STRING("arch", ++ PyString_FromString(Py_GetArch())); ++ SET_SYS_FROM_STRING("lib", ++ PyString_FromString(Py_GetLib())); + SET_SYS_FROM_STRING("prefix", + PyString_FromString(Py_GetPrefix())); + SET_SYS_FROM_STRING("exec_prefix", +diff -Naur Python-2.7.13.orig/setup.py Python-2.7.13/setup.py +--- Python-2.7.13.orig/setup.py 2017-12-03 17:32:19.000000000 +0300 ++++ Python-2.7.13/setup.py 2017-12-03 17:32:27.000000000 +0300 +@@ -512,6 +512,7 @@ + except NameError: + have_unicode = 0 + ++ libname = sys.lib + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. +@@ -523,8 +524,7 @@ + ): + add_dir_to_list(inc_dirs, d) + for d in ( +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', ++ libname, '/usr/'+libname + ): + add_dir_to_list(lib_dirs, d) + exts = [] +@@ -782,11 +782,11 @@ + elif curses_library: + readline_libs.append(curses_library) + elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], ++ ['/usr/'+libname+'/termcap'], + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], ++ library_dirs=['/usr/'+libname+'/termcap'], + extra_link_args=readline_extra_link_args, + libraries=readline_libs) ) + else: +@@ -1941,8 +1941,8 @@ + added_lib_dirs.append('/usr/openwin/lib') + elif os.path.exists('/usr/X11R6/include'): + include_dirs.append('/usr/X11R6/include') +- added_lib_dirs.append('/usr/X11R6/lib64') +- added_lib_dirs.append('/usr/X11R6/lib') ++ added_lib_dirs.append('/usr/X11R6/'+sys.lib) ++ #added_lib_dirs.append('/usr/X11R6/lib') + elif os.path.exists('/usr/X11R5/include'): + include_dirs.append('/usr/X11R5/include') + added_lib_dirs.append('/usr/X11R5/lib') diff --git a/python3-3.5.2-dont-raise-from-py_compile.patch b/python3-3.5.2-dont-raise-from-py_compile.patch new file mode 100644 index 0000000..783be96 --- /dev/null +++ b/python3-3.5.2-dont-raise-from-py_compile.patch @@ -0,0 +1,21 @@ +commit 2f819184eb7e28b6e5eb32aaee8e65c506499f29 +Author: Philippe Makowski +Date: Sun Jul 3 17:55:24 2016 +0200 + + dont-raise-from-py_compile + +diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py +index 4a6caa5..bf67e36 100644 +--- a/Lib/test/test_py_compile.py ++++ b/Lib/test/test_py_compile.py +@@ -69,6 +69,10 @@ class PyCompileTests(unittest.TestCase): + self.assertTrue(os.path.exists(self.pyc_path)) + self.assertFalse(os.path.exists(self.cache_path)) + ++ def test_bad_coding(self): ++ bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py') ++ self.assertIsNone(py_compile.compile(bad_coding, doraise=False)) ++ + def test_relative_path(self): + py_compile.compile(os.path.relpath(self.source_path), + os.path.relpath(self.pyc_path)) diff --git a/python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch b/python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch new file mode 100644 index 0000000..33b4b48 --- /dev/null +++ b/python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch @@ -0,0 +1,18 @@ +commit f628cebffae0b4967c9193df2b2d0d8d27344af2 +Author: Philippe Makowski +Date: Sun Jul 3 16:43:03 2016 +0200 + + skip-distutils-tests-that-fail-in-rpmbuild + +diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py +index 25c14ab..a6ab37c 100644 +--- a/Lib/distutils/tests/test_bdist_rpm.py ++++ b/Lib/distutils/tests/test_bdist_rpm.py +@@ -23,6 +23,7 @@ setup(name='foo', version='0.1', py_modules=['foo'], + + """ + ++@unittest._skipInRpmBuild("don't try to nest one rpm build inside another rpm build") + class BuildRpmTestCase(support.TempdirManager, + support.EnvironGuard, + support.LoggingSilencer, diff --git a/python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch b/python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch new file mode 100644 index 0000000..e09e1d6 --- /dev/null +++ b/python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch @@ -0,0 +1,26 @@ +Author: Stig-Ørjan Smelror +Date: 2018-02-23 +Subject: Encountered CMP0004 error +Description: While compiling ecFlow with Python 3 support I encountered +a CMP0004 error: + +Target "xxxx" links to item " -L/usr/lib64 -lpython3" which has + leading or trailing whitespace. This is now an error according to policy + CMP0004. + +The cause of this error is that $LIBPLUSED is not always set. +The fix is to move this to the second place. + +Index: Python-3.7.4/Misc/python-config.sh.in +=================================================================== +--- a/Misc/python-config.sh.in 2019-07-08 20:03:50.000000000 +0200 ++++ b/Misc/python-config.sh.in 2019-07-09 18:43:29.420421542 +0200 +@@ -92,7 +92,7 @@ do + if [ "$PY_ENABLE_SHARED" = "0" ] ; then + LIBPLUSED="-L$LIBPL" + fi +- echo "$LIBPLUSED -L$libdir $LIBS" ++ echo "-L$libdir $LIBPLUSED $LIBS" + ;; + --extension-suffix) + echo "$SO" diff --git a/python3-3.7.1-module-linkage.patch b/python3-3.7.1-module-linkage.patch new file mode 100644 index 0000000..7bbfae3 --- /dev/null +++ b/python3-3.7.1-module-linkage.patch @@ -0,0 +1,21 @@ +diff -up ./setup.py.orig ./setup.py +--- ./setup.py.orig 2019-01-01 20:17:55.775281126 +0200 ++++ ./setup.py 2019-01-01 20:18:41.833486600 +0200 +@@ -670,7 +670,7 @@ class PyBuildExt(build_ext): + libraries=['m']) ) + + # time libraries: librt may be needed for clock_gettime() +- time_libs = [] ++ time_libs = ['m'] + lib = sysconfig.get_config_var('TIMEMODULE_LIB') + if lib: + time_libs.append(lib) +@@ -1965,7 +1965,7 @@ class PyBuildExt(build_ext): + include_dirs=include_dirs, + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, +- libraries=[], ++ libraries=['m', 'dl'], + sources=sources, + depends=depends) + # function my_sqrt() needs libm for sqrt() diff --git a/python3-3.7.1-uid-gid-overflows.patch b/python3-3.7.1-uid-gid-overflows.patch new file mode 100644 index 0000000..3e7f129 --- /dev/null +++ b/python3-3.7.1-uid-gid-overflows.patch @@ -0,0 +1,17 @@ +diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py +index ac9cff7..db98159 100644 +--- a/Lib/test/test_pwd.py ++++ b/Lib/test/test_pwd.py +@ -95,9 +95,9 @@ class PwdTest(unittest.TestCase): + # In some cases, byuids isn't a complete list of all users in the + # system, so if we try to pick a value not in byuids (via a perturbing + # loop, say), pwd.getpwuid() might still be able to find data for that +- # uid. Using sys.maxint may provoke the same problems, but hopefully ++ # uid. Using 2**32 - 2 may provoke the same problems, but hopefully + # it will be a more repeatable failure. +- fakeuid = sys.maxsize ++ fakeuid = 2**32 - 2 + self.assertNotIn(fakeuid, byuids) + self.assertRaises(KeyError, pwd.getpwuid, fakeuid) + + diff --git a/python3.spec b/python3.spec index 8581bcf..5f73f79 100644 --- a/python3.spec +++ b/python3.spec @@ -1,5 +1,5 @@ -%define docver 3.5.2 -%define dirver 3.5 +%define docver 3.8.1rc1 +%define dirver 3.8 %define familyver 3 %define lib_major %{dirver} @@ -8,7 +8,7 @@ %define develname %mklibname python3 -d %ifarch %{ix86} x86_64 ppc -%bcond_without valgrind +%bcond_with valgrind %else %bcond_with valgrind %endif @@ -33,8 +33,8 @@ Summary: An interpreted, interactive object-oriented programming language Name: python3 -Version: 3.5.2 -Release: 12 +Version: 3.8.1 +Release: 1 License: Modified CNRI Open Source License Group: Development/Python @@ -44,33 +44,59 @@ Source2: python3.macros Source3: pybytecompile.macros Source100: %{name}.rpmlintrc -Patch0: python3-3.5.2-module-linkage.patch -Patch1: python3-3.5.2-multilib.patch -Patch2: python3-3.5.2-fdr-lib64-fix-for-test_install.patch -Patch3: python3-3.5.0-no-static-lib.patch -Patch4: python3-3.4.0-more-configuration-flags.patch -Patch5: python3-3.4.0-disable-tests-in-test_io.patch -Patch6: python3-3.5.0-add-rpmbuild-hooks-to-unittest.patch -Patch7: python3-3.4.3-skip-distutils-tests-that-fail-in-rpmbuild.patch -Patch8: python3-3.4.0-hashlib-fips.patch -Patch9: python3-3.5.2-fix-test_gdb-noise.patch -Patch10: python3-3.4.0-uid-gid-overflows.patch -Patch11: python3-3.4.0-disable-test_fs_holes-in-rpm-build.patch -Patch12: python3-3.4.0-disable-parts-of-test_socket-in-rpm-build.patch -Patch13: python3-3.4.0-dont-duplicate-flags-in-sysconfig.patch -Patch14: python3-3.4.0-ctypes-should-build-with-libffi-multilib-wrapper.patch -Patch15: python3-3.4.0-dont-raise-from-py_compile.patch -%if %{with rewheel} -Patch16: python3-3.4.0-add-rewheel-module.patch -%endif -Patch19: Python-nis-requires-tirpc.patch -Patch20: Python-select-requires-libm.patch -Patch21: python3-3.4.2-distutils-init.patch -Patch22: python3-3.5.0-make-libpl-respect-lib64.patch +# 00001 # +# Fixup distutils/unixccompiler.py to remove standard library path from rpath: +# Was Patch0 in ivazquez' python3000 specfile: +Patch1: 00001-rpath.patch -Patch23: CVE-2019-16056.patch -Patch24: CVE-2019-16935.patch -Patch25: avoid_test_docxmlrpc_race.patch +# 00102 # +# Change the various install paths to use /usr/lib64/ instead or /usr/lib +# Only used when "%%{_lib}" == "lib64" +# Not yet sent upstream. +Patch102: 00102-lib64.patch + +# 00111 # +# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build +# a libpythonMAJOR.MINOR.a +# See https://bugzilla.redhat.com/show_bug.cgi?id=556092 +# Downstream only: not appropriate for upstream +Patch111: 00111-no-static-lib.patch + +# 00189 # +# Instead of bundled wheels, use our RPM packaged wheels from +# /usr/share/python-wheels +Patch189: 00189-use-rpm-wheels.patch + +# 00205 # +# LIBPL variable in makefile takes LIBPL from configure.ac +# but the LIBPL variable defined there doesn't respect libdir macro +Patch205: 00205-make-libpl-respect-lib64.patch + +# 00251 +# Set values of prefix and exec_prefix in distutils install command +# to /usr/local if executable is /usr/bin/python* and RPM build +# is not detected to make pip and distutils install into separate location +# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe +Patch251: 00251-change-user-install-location.patch + +# 00274 # +# Upstream uses Debian-style architecture naming. Change to match Fedora. +Patch274: 00274-fix-arch-names.patch + +# 00328 # +# Restore pyc to TIMESTAMP invalidation mode as default in rpmbubild +# See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 +Patch328: 00328-pyc-timestamp-invalidation-mode.patch + +# +# Mageia patches +# +Patch500: python3-3.7.1-module-linkage.patch +Patch501: python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch +Patch502: python3-3.7.1-uid-gid-overflows.patch +Patch503: python3-3.5.2-dont-raise-from-py_compile.patch +Patch506: python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch +Patch507: link-C-modules-with-libpython.patch URL: http://www.python.org/ Conflicts: tkinter3 < %{version} @@ -194,38 +220,31 @@ Various applications written using tkinter %prep %setup -qn Python-%{version} -%patch0 -p1 -b .link +%patch1 -p1 -%patch1 -p1 -b .lib64 %if "%{_lib}" == "lib64" -%patch2 -p1 +%patch102 -p1 +%endif +%patch111 -p1 + +%if %{with rpmwheels} +%patch189 -p1 +rm Lib/ensurepip/_bundled/*.whl %endif -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 +%patch205 -p1 +%patch251 -p1 +%patch274 -p1 +%patch328 -p1 -%if %{with rewheel} -%patch16 -p1 -%endif - -%patch19 -p1 -b .tirpc~ -%patch20 -p1 -b .lm~ -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 +# Mageia patches +#%patch500 -p1 +%patch501 -p1 +%patch502 -p1 +%patch503 -p1 +%patch504 -p1 +%patch506 -p1 +%patch507 -p1 # drop Autoconf version requirement sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac @@ -399,7 +418,6 @@ export TMP="/tmp" TMPDIR="/tmp" %{_libdir}/python%{dirver}/lib2to3 %{_libdir}/python%{dirver}/logging %{_libdir}/python%{dirver}/multiprocessing -%{_libdir}/python%{dirver}/plat-linux %{_libdir}/python%{dirver}/pydoc_data %{_libdir}/python%{dirver}/site-packages %{_libdir}/python%{dirver}/sqlite3 @@ -415,7 +433,6 @@ export TMP="/tmp" TMPDIR="/tmp" # %exclude %{_libdir}/python%{dirver}/ensurepip/_bundled %{_bindir}/pydoc3* %{_bindir}/python3* -%{_bindir}/pyvenv* %{_bindir}/2to3-%{dirver} %exclude %{_bindir}/python*config #%{_datadir}/emacs/site-lisp/* @@ -430,11 +447,12 @@ export TMP="/tmp" TMPDIR="/tmp" %files -n %{develname} %{_libdir}/libpython*.so %{_includedir}/python* -%{_libdir}/python*/config-%{dirver}* +%{_libdir}/python*/config-* %{_libdir}/python*/test/ %{_bindir}/python%{dirver}*-config %{_bindir}/python%{familyver}-config %{_libdir}/pkgconfig/python*.pc +#%{_libdir}/python*/config-* %exclude %{_includedir}/python*/pyconfig.h %exclude %{_libdir}/python*/config*/Makefile