extra/python to 3.7.0-4

This commit is contained in:
Kevin Mihelich 2018-09-17 18:36:23 +00:00
parent 46f6456240
commit d959898080
2 changed files with 77 additions and 3 deletions

View file

@ -0,0 +1,57 @@
From 84fdbc156ed424d030686de350fbfc6c3593263f Mon Sep 17 00:00:00 2001
Message-Id: <84fdbc156ed424d030686de350fbfc6c3593263f.1537028533.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Sat, 15 Sep 2018 18:22:06 +0200
Subject: [PATCH] compileall: Fix ddir when recursing
---
Lib/compileall.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 72592126d7..70e246fd96 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -45,12 +45,16 @@ def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0):
else:
dfile = None
if not os.path.isdir(fullname):
- yield fullname
+ yield fullname, ddir
elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
os.path.isdir(fullname) and not os.path.islink(fullname)):
yield from _walk_dir(fullname, ddir=dfile,
maxlevels=maxlevels - 1, quiet=quiet)
+def _compile_one(file_ddir, *args, **kwargs):
+ file, ddir = file_ddir
+ return compile_file(file, ddir, *args, **kwargs)
+
def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
quiet=0, legacy=False, optimize=-1, workers=1,
invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP):
@@ -79,17 +83,17 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
if workers is not None and workers != 1 and ProcessPoolExecutor is not None:
workers = workers or None
with ProcessPoolExecutor(max_workers=workers) as executor:
- results = executor.map(partial(compile_file,
- ddir=ddir, force=force,
+ results = executor.map(partial(_compile_one,
+ force=force,
rx=rx, quiet=quiet,
legacy=legacy,
optimize=optimize,
invalidation_mode=invalidation_mode),
files)
success = min(results, default=True)
else:
- for file in files:
- if not compile_file(file, ddir, force, rx, quiet,
+ for file_ddir in files:
+ if not _compile_one(file_ddir, force, rx, quiet,
legacy, optimize, invalidation_mode):
success = False
return success
--
2.18.0

View file

@ -12,7 +12,7 @@
pkgname=python
pkgver=3.7.0
pkgrel=3
pkgrel=4
_pybasever=${pkgver%.*}
pkgdesc="Next generation of the python high-level scripting language"
arch=('x86_64')
@ -30,11 +30,13 @@ provides=('python3')
replaces=('python3')
source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz"{,.asc}
bpo34056-always-return-bytes-from-_HackedGetData.get_data.patch
dont-make-libpython-readonly.patch)
dont-make-libpython-readonly.patch
0001-compileall-Fix-ddir-when-recursing.patch)
sha512sums=('8bb11233fb67ee9ab8ed1b72f8fdc62f66e26a6beaaeb92448bce681cf065269833b1658d3ed2459127f25ba43adb0eab73cf27c59834a2a803fb529b4216739'
'SKIP'
'0ec544fa95ba30be03e866d02848f9fa4921304055368609136ac39626df9835bad75506f6d81ef9fdc0ebcc29a9749f84b5b5f4dd75958c9699ade522d51b68'
'2ef96708d5b13ae2a3d2cc62c87b4780e60ecfce914e190564492def3a11d5e56977659f41c7f9d12266e58050c766bce4e2b5d50b708eb792794fa8357920c4')
'2ef96708d5b13ae2a3d2cc62c87b4780e60ecfce914e190564492def3a11d5e56977659f41c7f9d12266e58050c766bce4e2b5d50b708eb792794fa8357920c4'
'ebd04c3b6d41321b1f0d439d356e0ce463760db55dc64109854c70d017cf56608aa19de9fc4a21bf840795ff202b4703444f9af8074b661780798c17e03089ff')
validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D') # Ned Deily (Python release signing key) <nad@python.org>
prepare() {
@ -46,9 +48,18 @@ prepare() {
# FS#45809
patch -p1 -i ../dont-make-libpython-readonly.patch
# FS#59997
patch -p1 -i ../0001-compileall-Fix-ddir-when-recursing.patch
# https://bugs.python.org/issue34587
sed -i -e "s|testCongestion|disabled_&|" Lib/test/test_socket.py
# FS#23997
sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py
# Speed up LTO
sed -i -e "s|-flto |-flto=4 |g" configure configure.ac
# Ensure that we are using the system copy of various libraries (expat, libffi, and libmpdec),
# rather than copies shipped in the tarball
rm -r Modules/expat
@ -59,6 +70,9 @@ prepare() {
build() {
cd Python-${pkgver}
# PGO should be done with -O3
CFLAGS="${CFLAGS/-O2/-O3}"
# Disable bundled pip & setuptools
./configure --prefix=/usr \
--enable-shared \
@ -106,6 +120,9 @@ package() {
# Hack to avoid building again
sed -i 's/^all:.*$/all: build_all/' Makefile
# PGO should be done with -O3
CFLAGS="${CFLAGS/-O2/-O3}"
make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" install
# Why are these not done by default...