From 514c1496b1e51a714428fa809e27b9b055455136 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 28 Jun 2018 11:38:17 +0200 Subject: [PATCH] - started playing with python 3.7 --- python3-ac_fixes.patch | 7 +++-- python3-multilib.patch | 57 ++++++++++++++++++++-------------------- python3-pythonpath.patch | 28 +------------------- python3.spec | 15 +++++------ 4 files changed, 39 insertions(+), 68 deletions(-) diff --git a/python3-ac_fixes.patch b/python3-ac_fixes.patch index b005cdd..36e3783 100644 --- a/python3-ac_fixes.patch +++ b/python3-ac_fixes.patch @@ -1,6 +1,6 @@ --- Python-3.6.2/configure.ac~ 2017-07-08 05:33:27.000000000 +0200 +++ Python-3.6.2/configure.ac 2017-08-07 10:28:44.498951134 +0200 -@@ -1494,26 +1494,7 @@ then +@@ -1485,25 +1485,6 @@ then CFLAGS_ALIASING="-fno-strict-aliasing" fi @@ -23,8 +23,7 @@ - ;; - esac - -- OPT="$OPT $STRICT_PROTO" -+ OPT="$OPT $CPPFLAGS $CFLAGS $STRICT_PROTO" - case $ac_sys_system in SCO_SV*) OPT="$OPT -m486 -DSCO5" + ;; + diff --git a/python3-multilib.patch b/python3-multilib.patch index 5a9d38f..4898f2b 100644 --- a/python3-multilib.patch +++ b/python3-multilib.patch @@ -74,7 +74,7 @@ diff -dur Python-3.5.0.orig/Lib/distutils/tests/test_install.py Python-3.5.0/Lib diff -dur Python-3.5.0.orig/Lib/site.py Python-3.5.0/Lib/site.py --- Python-3.5.0.orig/Lib/site.py 2015-09-13 13:41:21.000000000 +0200 +++ Python-3.5.0/Lib/site.py 2015-12-03 17:31:03.874280444 +0100 -@@ -304,12 +304,14 @@ def getsitepackages(prefixes=None): +@@ -334,12 +334,14 @@ def getsitepackages(prefixes=None): seen.add(prefix) if os.sep == '/': @@ -88,9 +88,9 @@ diff -dur Python-3.5.0.orig/Lib/site.py Python-3.5.0/Lib/site.py sitepackages.append(prefix) - sitepackages.append(os.path.join(prefix, "lib", "site-packages")) + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) - if sys.platform == "darwin": - # for framework builds *only* we add the standard Apple - # locations. + return sitepackages + + def addsitepackages(known_paths, prefixes=None): diff -dur Python-3.5.0.orig/Lib/sysconfig.py Python-3.5.0/Lib/sysconfig.py --- Python-3.5.0.orig/Lib/sysconfig.py 2015-09-13 13:41:21.000000000 +0200 +++ Python-3.5.0/Lib/sysconfig.py 2015-12-03 17:31:51.974741432 +0100 @@ -182,14 +182,15 @@ diff -dur Python-3.5.0.orig/Makefile.pre.in Python-3.5.0/Makefile.pre.in Python/importdl.o: $(srcdir)/Python/importdl.c $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c -@@ -1362,8 +1364,8 @@ +@@ -1470,9 +1470,9 @@ libainstall: @DEF_MAKE_RULE@ python-conf + @if test -d $(LIBRARY); then :; else \ + if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ if test "$(SHLIB_SUFFIX)" = .dll; then \ - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ +- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ ++ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \ else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ -- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \ -+ $(RANLIB) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \ fi; \ else \ echo Skip install of $(LIBRARY) - use make frameworkinstall; \ @@ -214,24 +215,24 @@ diff -dur Python-3.5.0.orig/Modules/getpath.c Python-3.5.0/Modules/getpath.c #if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH) #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" -@@ -511,7 +523,7 @@ - _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); - _prefix = Py_DecodeLocale(PREFIX, NULL); - _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); -- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); -+ lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, NULL); +@@ -753,7 +753,7 @@ calculate_zip_path(PyCalculatePath *calc + else { + wcsncpy(calculate->zip_path, calculate->prefix, MAXPATHLEN); + } +- joinpath(calculate->zip_path, L"lib/python00.zip"); ++ joinpath(calculate->zip_path, L"" LIB_PYTHON "00.zip"); - if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { - Py_FatalError( -@@ -700,7 +712,7 @@ + /* Replace "00" with version */ + size_t bufsz = wcslen(calculate->zip_path); +@@ -878,7 +878,7 @@ calculate_init(PyCalculatePath *calculat + if (!calculate->prefix) { + return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); + } +- calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len); ++ calculate->lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, &len); + if (!calculate->lib_python) { + return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); } - else - wcsncpy(zip_path, _prefix, MAXPATHLEN); -- joinpath(zip_path, L"lib/python00.zip"); -+ joinpath(zip_path, L"" LIB_PYTHON "00.zip"); - bufsz = wcslen(zip_path); /* Replace "00" with version */ - zip_path[bufsz - 6] = VERSION[0]; - zip_path[bufsz - 5] = VERSION[2]; diff -dur Python-3.5.0.orig/Python/getplatform.c Python-3.5.0/Python/getplatform.c --- Python-3.5.0.orig/Python/getplatform.c 2015-09-13 13:41:26.000000000 +0200 +++ Python-3.5.0/Python/getplatform.c 2015-12-03 17:31:03.874280444 +0100 @@ -262,7 +263,7 @@ diff -dur Python-3.5.0.orig/Python/getplatform.c Python-3.5.0/Python/getplatform diff -dur Python-3.5.0.orig/Python/sysmodule.c Python-3.5.0/Python/sysmodule.c --- Python-3.5.0.orig/Python/sysmodule.c 2015-09-13 13:41:26.000000000 +0200 +++ Python-3.5.0/Python/sysmodule.c 2015-12-03 17:31:03.874280444 +0100 -@@ -1767,6 +1767,10 @@ +@@ -2307,6 +2307,10 @@ _PySys_BeginInit(PyObject **sysmod) PyUnicode_FromString(Py_GetCopyright())); SET_SYS_FROM_STRING("platform", PyUnicode_FromString(Py_GetPlatform())); @@ -270,9 +271,9 @@ diff -dur Python-3.5.0.orig/Python/sysmodule.c Python-3.5.0/Python/sysmodule.c + PyUnicode_FromString(Py_GetArch())); + SET_SYS_FROM_STRING("lib", + PyUnicode_FromString(Py_GetLib())); - SET_SYS_FROM_STRING("executable", - PyUnicode_FromWideChar( - Py_GetProgramFullPath(), -1)); + SET_SYS_FROM_STRING("maxsize", + PyLong_FromSsize_t(PY_SSIZE_T_MAX)); + SET_SYS_FROM_STRING("float_info", diff -dur Python-3.5.0.orig/configure.ac Python-3.5.0/configure.ac --- Python-3.5.0.orig/configure.ac 2015-12-03 17:30:32.777292009 +0100 +++ Python-3.5.0/configure.ac 2015-12-03 17:31:03.877613811 +0100 diff --git a/python3-pythonpath.patch b/python3-pythonpath.patch index 69be183..1342158 100644 --- a/python3-pythonpath.patch +++ b/python3-pythonpath.patch @@ -31,30 +31,4 @@ # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is ---- Python-3.0.1/Tools/pybench/pybench.py.wiget 2009-02-07 18:28:46.000000000 +0100 -+++ Python-3.0.1/Tools/pybench/pybench.py 2009-03-14 18:12:32.000000000 +0100 -@@ -1,4 +1,4 @@ --#!/usr/local/bin/python -O -+#!/usr/bin/python3 -O - - """ A Python Benchmark Suite - ---- Python-3.0.1/Tools/scripts/fixps.py.wiget 2007-08-03 19:06:41.000000000 +0200 -+++ Python-3.0.1/Tools/scripts/fixps.py 2009-03-14 18:12:32.000000000 +0100 -@@ -15,13 +15,13 @@ def main(): - print(filename, ': can\'t open :', msg) - continue - line = f.readline() -- if not re.match('^#! */usr/local/bin/python', line): -- print(filename, ': not a /usr/local/bin/python script') -+ if not re.match('^#! */usr/bin/python3', line): -+ print(filename, ': not a /usr/bin/python3 script') - f.close() - continue - rest = f.read() - f.close() -- line = re.sub('/usr/local/bin/python', -+ line = re.sub('/usr/bin/python3', - '/usr/bin/env python', line) - print(filename, ':', repr(line)) - f = open(filename, "w") + diff --git a/python3.spec b/python3.spec index 3da5ed6..5e875ff 100644 --- a/python3.spec +++ b/python3.spec @@ -20,7 +20,7 @@ %endif %define broken_tests test_nntplib test_gdb test_site test_ssl %{?broken_tests_x32} -%define py_ver 3.6 +%define py_ver 3.7 %define py_abi %{py_ver}m %define py_platform %{py_abi}-%{_target_base_arch}-%{_target_os}%{?_gnu} %define py_prefix %{_prefix} @@ -38,13 +38,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}.5 -Release: 3 +Version: %{py_ver}.0 +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: 9f49654a4d6f733ff3284ab9d227e9fd +# Source0-md5: eb8c2a6b1447d50813c02714af4681f3 Source1: pyconfig.h.in Patch0: %{name}-pythonpath.patch Patch1: %{name}-ac_fixes.patch @@ -487,10 +487,9 @@ Moduły testowe dla Pythona. %patch11 -p1 %patch12 -p1 -%{__rm} -r Modules/zlib %{__rm} -r Modules/expat -for SUBDIR in darwin libffi libffi_msvc libffi_osx; do +for SUBDIR in darwin libffi_msvc libffi_osx; do %{__rm} -r Modules/_ctypes/$SUBDIR/* done @@ -526,12 +525,10 @@ fi --with-dbmliborder=gdbm:ndbm:bdb \ --with-doc-strings \ --without-ensurepip \ - --with-fpectl \ %{?with_debug:--with-pydebug} \ --with-system-expat \ --with-system-ffi \ - %{?with_system_mpdecimal:--with-system-libmpdec} \ - --with-threads + %{?with_system_mpdecimal:--with-system-libmpdec} %{__make} 2>&1 | awk ' BEGIN { fail = 0; logmsg = ""; } -- 2.44.0