summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhyme Lyu2019-11-15 05:22:03 +0800
committerWhyme Lyu2019-11-15 05:22:03 +0800
commit0d00cd24af217193184993c1ee2af082dcfed1a2 (patch)
tree4df10d56023ec04b8d8e97b7a61231fa9bb730f7
parenta68bfffa5e9454ae13cbc87a5112be1b72a9a1d5 (diff)
downloadaur-0d00cd24af217193184993c1ee2af082dcfed1a2.tar.gz
Import PKGBUILD for Python 3.7.5
-rw-r--r--.SRCINFO19
-rw-r--r--0001-compileall-Fix-ddir-when-recursing.patch57
-rw-r--r--PKGBUILD157
-rw-r--r--dont-make-libpython-readonly.patch7
4 files changed, 182 insertions, 58 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 97642eed742a..adbf08eb712b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = python37
- pkgdesc = Next generation of the python high-level scripting language
- pkgver = 3.7.0
+ pkgdesc = Major release 3.7 of the Python high-level programming language
+ pkgver = 3.7.5
pkgrel = 1
url = https://www.python.org/
- arch = i686
arch = x86_64
license = custom
makedepends = tk
@@ -21,15 +20,19 @@ pkgbase = python37
depends = libffi
depends = zlib
depends = libnsl
- optdepends = tk: for tkinter
optdepends = sqlite
optdepends = mpdecimal: for decimal
optdepends = xz: for lzma
- options = !makeflags
- source = https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
+ optdepends = tk: for tkinter
+ source = https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tar.xz
+ source = https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tar.xz.asc
source = dont-make-libpython-readonly.patch
- sha512sums = 8bb11233fb67ee9ab8ed1b72f8fdc62f66e26a6beaaeb92448bce681cf065269833b1658d3ed2459127f25ba43adb0eab73cf27c59834a2a803fb529b4216739
- sha512sums = 500ea7f603f96f721d04ca64390f4bd9ddbab2c16b837b67f8a51ed9167a1d57c5b435be1ebe98b0c74eff728714033b3dcbb5ee978b9bf98086571399717f17
+ source = 0001-compileall-Fix-ddir-when-recursing.patch
+ validpgpkeys = 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
+ sha512sums = f4f3879881f260f58dbb041fb0f2f210d4b70b02a739e41e50e6fea67d31855a7a29ce4ebef66bfde3d0edf54b946a48f78490f986da965357b835d4dbb3f414
+ sha512sums = SKIP
+ sha512sums = 2ef96708d5b13ae2a3d2cc62c87b4780e60ecfce914e190564492def3a11d5e56977659f41c7f9d12266e58050c766bce4e2b5d50b708eb792794fa8357920c4
+ sha512sums = ebd04c3b6d41321b1f0d439d356e0ce463760db55dc64109854c70d017cf56608aa19de9fc4a21bf840795ff202b4703444f9af8074b661780798c17e03089ff
pkgname = python37
diff --git a/0001-compileall-Fix-ddir-when-recursing.patch b/0001-compileall-Fix-ddir-when-recursing.patch
new file mode 100644
index 000000000000..91ebc71f6a22
--- /dev/null
+++ b/0001-compileall-Fix-ddir-when-recursing.patch
@@ -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
+
diff --git a/PKGBUILD b/PKGBUILD
index 2848834ca40d..a9b22a67345e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,71 +1,132 @@
-# Maintainer: Atte Lautanala <atte dot lautanala at gmail dot com>
-# Based on python and python35 PKGBUILD files
+# Maintainer: Whyme Lyu <callme5long@gmail.com>
+# Contributor: Tobias Kunze <r@rixx.de>
+# Contributor: Angel Velasquez <angvp@archlinux.org>
+# Contributor: Felix Yan <felixonmars@archlinux.org>
+# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
+# Contributor: Allan McRae <allan@archlinux.org>
+# Contributor: Jason Chu <jason@archlinux.org>
pkgname=python37
-pkgver=3.7.0
+pkgver=3.7.5
pkgrel=1
-_pybasever=3.7
-pkgdesc="Next generation of the python high-level scripting language"
-arch=('i686' 'x86_64')
+_pybasever=${pkgver%.*}
+_pymajver=3
+pkgdesc="Major release 3.7 of the Python high-level programming language"
+arch=('x86_64')
license=('custom')
url="https://www.python.org/"
depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib' 'libnsl')
makedepends=('tk' 'sqlite' 'valgrind' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb' 'xorg-server-xvfb')
-optdepends=('tk: for tkinter' 'sqlite' 'mpdecimal: for decimal' 'xz: for lzma')
-options=('!makeflags')
-source=("https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz"
- dont-make-libpython-readonly.patch)
-sha512sums=('8bb11233fb67ee9ab8ed1b72f8fdc62f66e26a6beaaeb92448bce681cf065269833b1658d3ed2459127f25ba43adb0eab73cf27c59834a2a803fb529b4216739'
- '500ea7f603f96f721d04ca64390f4bd9ddbab2c16b837b67f8a51ed9167a1d57c5b435be1ebe98b0c74eff728714033b3dcbb5ee978b9bf98086571399717f17')
+optdepends=('sqlite'
+ 'mpdecimal: for decimal'
+ 'xz: for lzma'
+ 'tk: for tkinter')
+source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz"{,.asc}
+ dont-make-libpython-readonly.patch
+ 0001-compileall-Fix-ddir-when-recursing.patch)
+sha512sums=('f4f3879881f260f58dbb041fb0f2f210d4b70b02a739e41e50e6fea67d31855a7a29ce4ebef66bfde3d0edf54b946a48f78490f986da965357b835d4dbb3f414'
+ 'SKIP'
+ '2ef96708d5b13ae2a3d2cc62c87b4780e60ecfce914e190564492def3a11d5e56977659f41c7f9d12266e58050c766bce4e2b5d50b708eb792794fa8357920c4'
+ 'ebd04c3b6d41321b1f0d439d356e0ce463760db55dc64109854c70d017cf56608aa19de9fc4a21bf840795ff202b4703444f9af8074b661780798c17e03089ff')
+validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D') # Ned Deily (Python release signing key) <nad@python.org>
prepare() {
- cd "${srcdir}/Python-${pkgver}"
+ cd Python-${pkgver}
- # FS#45809
- patch -p1 -i ../dont-make-libpython-readonly.patch
+ # FS#45809
+ patch -p1 -i ../dont-make-libpython-readonly.patch
- # FS#23997
- sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py
+ # FS#59997
+ patch -p1 -i ../0001-compileall-Fix-ddir-when-recursing.patch
- rm -r Modules/expat
- rm -r Modules/_ctypes/{darwin,libffi}*
- rm -r Modules/_decimal/libmpdec
+ # 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
+ rm -r Modules/_ctypes/{darwin,libffi}*
+ rm -r Modules/_decimal/libmpdec
}
build() {
- cd "${srcdir}/Python-${pkgver}"
-
- ./configure --prefix=/usr \
- --enable-shared \
- --with-threads \
- --with-computed-gotos \
- --enable-optimizations \
- --with-lto \
- --enable-ipv6 \
- --with-valgrind \
- --with-system-expat \
- --with-dbmliborder=gdbm:ndbm \
- --with-system-ffi \
- --with-system-libmpdec \
- --enable-loadable-sqlite-extensions
-
- LC_CTYPE=en_US.UTF-8 xvfb-run make EXTRA_CFLAGS="$CFLAGS"
+ cd Python-${pkgver}
+
+ # PGO should be done with -O3
+ CFLAGS="${CFLAGS/-O2/-O3}"
+
+ # Disable bundled pip & setuptools
+ ./configure --prefix=/usr \
+ --enable-shared \
+ --with-threads \
+ --with-computed-gotos \
+ --enable-optimizations \
+ --with-lto \
+ --enable-ipv6 \
+ --with-system-expat \
+ --with-dbmliborder=gdbm:ndbm \
+ --with-system-ffi \
+ --with-system-libmpdec \
+ --enable-loadable-sqlite-extensions \
+ --without-ensurepip
+
+ # Obtain next free server number for xvfb-run; this even works in a chroot environment.
+ export servernum=99
+ while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
+
+ LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" make EXTRA_CFLAGS="$CFLAGS"
+}
+
+check() {
+ # test_gdb is expected to fail with LTO
+ # test_idle, test_tk, test_ttk_guionly segfaults since 3.6.5
+
+ # https://bugs.python.org/issue34022
+ # test_cmd_line_script, test_compileall, test_importlib,
+ # test_multiprocessing_main_handling, test_py_compile, test_runpy
+
+ cd Python-${pkgver}
+
+ # Obtain next free server number for xvfb-run; this even works in a chroot environment.
+ export servernum=99
+ while ! xvfb-run -a -n "$servernum" /bin/true 2>/dev/null; do servernum=$((servernum+1)); done
+
+ LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \
+ LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1280x720x24 -ac +extension GLX" -a -n "$servernum" \
+ "${srcdir}/Python-${pkgver}/python" -m test.regrtest -v -uall -x test_gdb -x test_idle -x test_tk -x test_ttk_guionly \
+ -x test_cmd_line_script -x test_compileall -x test_importlib -x test_multiprocessing_main_handling -x test_py_compile -x test_runpy \
+ -x test_httplib
}
package() {
- cd "${srcdir}/Python-${pkgver}"
+ cd Python-${pkgver}
+
+ # Hack to avoid building again
+ sed -i 's/^all:.*$/all: build_all/' Makefile
+
+ # PGO should be done with -O3
+ CFLAGS="${CFLAGS/-O2/-O3}"
+
+ # altinstall: /usr/bin/pythonX.Y but not /usr/bin/python or /usr/bin/pythonX
+ make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" altinstall
- make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" altinstall maninstall
+ # Avoid conflicts with the main 'python' package, once Python 3.8 is standard.
+ rm "${pkgdir}/usr/lib/libpython${_pymajver}.so"
- # Remove files that conflict with python package
- rm "${pkgdir}/usr/lib/libpython3.so"
- rm "${pkgdir}/usr/share/man/man1/python3.1"
+ # Add missing pkgconfig stuff
+ ln -s "python${_pybasever}m-config" "${pkgdir}/usr/bin/python${_pybasever}-config"
- # Add useful scripts FS#46146
- install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts}
- install -m755 Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}"/usr/lib/python${_pybasever}/Tools/i18n/
- install -m755 Tools/scripts/{README,*py} "${pkgdir}"/usr/lib/python${_pybasever}/Tools/scripts/
+ # some useful "stuff" FS#46146
+ install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts}
+ install -m755 Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}"/usr/lib/python${_pybasever}/Tools/i18n/
+ install -m755 Tools/scripts/{README,*py} "${pkgdir}"/usr/lib/python${_pybasever}/Tools/scripts/
- # License
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ # License
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/dont-make-libpython-readonly.patch b/dont-make-libpython-readonly.patch
index ae1ec33375b7..92308bfe97bf 100644
--- a/dont-make-libpython-readonly.patch
+++ b/dont-make-libpython-readonly.patch
@@ -1,10 +1,13 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index ce2c0aa..7d6dcf7 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -70,7 +70,7 @@
+@@ -60,7 +60,7 @@ INSTALL_DATA= @INSTALL_DATA@
# Shared libraries must be installed with executable mode on some systems;
# rather than figuring out exactly which, we always give them executable mode.
# Also, making them read-only seems to be a good idea...
-INSTALL_SHARED= ${INSTALL} -m 555
+INSTALL_SHARED= ${INSTALL} -m 755
-
+
MKDIR_P= @MKDIR_P@
+