Commit 90069e06 authored by Jeff Huang's avatar Jeff Huang 🤔

[testing] python2: update to 2.7.16

parent 660ceecc
Pipeline #2999 failed with stages
in 30 seconds
pkgname=python2
pkgver=2.7.14
pkgver=2.7.16
pkgrel=1
_pybasever=2.7
pkgdesc="A high-level scripting language"
arch=('x86_64')
license=('PSF')
url="http://www.python.org"
depends=('db>=4.8' 'bzip2' 'gdbm' 'openssl' 'zlib' 'expat' 'sqlite3' 'libffi')
makedepends=('tk')
url="https://www.python.org"
depends=('bzip2' 'expat' 'gdbm' 'libffi' 'libnsl' 'openssl' 'sqlite' 'zlib')
makedepends=('tk' 'bluez-libs')
optdepends=('tk: for IDLE'
'python2-setuptools'
'python2-pip')
provides=('python' 'python-elementtree' 'python-ctypes')
replaces=('python-elementtree' 'python-ctypes' 'python')
conflicts=('python')
source=(http://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz
source=(https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz
'add-chakra-support.patch')
md5sums=('1f6db41ad91d9eb0a6f0c769b8613c5b'
'9b47a96ffa3d18cdc864481c178aef28')
sha256sums=('f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7'
'dec83a8ca0e8505cf899c61d8c62ee44ccdd041d22799e17c99d590466ff523e')
build() {
prepare() {
cd "${srcdir}/Python-${pkgver}"
# See http://bugs.python.org/issue10835 for upstream report
......@@ -30,6 +30,9 @@ build() {
sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python2|" Lib/cgi.py
sed -i "s/python2.3/python2/g" Lib/distutils/tests/test_build_scripts.py \
Lib/distutils/tests/test_install_scripts.py
# Make sure platform.linux_distribution() returns the correct info,
# reading it from /etc/chakra-release
patch -p1 -i "${srcdir}/add-chakra-support.patch"
......@@ -40,21 +43,39 @@ build() {
rm -r Modules/zlib
rm -r Modules/_ctypes/{darwin,libffi}*
# clean up #!s
find . -name '*.py' | \
xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python2|"
# Workaround asdl_c.py/makeopcodetargets.py errors after we touched the shebangs
touch Include/Python-ast.h Python/Python-ast.c Python/opcode_targets.h
}
build() {
cd "${srcdir}/Python-${pkgver}"
export OPT="${CFLAGS}"
./configure --prefix=/usr \
--enable-shared \
--enable-ipv6 \
--enable-unicode=ucs4 \
--with-threads \
--with-system-ffi \
--with-dbmliborder=gdbm:ndbm \
--with-system-expat
./configure --prefix=/usr \
--enable-shared \
--with-threads \
--enable-optimizations \
--with-lto \
--enable-ipv6 \
--enable-unicode=ucs4 \
--with-system-expat \
--with-system-ffi \
--with-dbmliborder=gdbm:ndbm \
--without-ensurepip
make
}
package() {
cd "${srcdir}/Python-${pkgver}"
# Hack to avoid building again
sed -i 's/^all:.*$/all: build_all/' Makefile
make DESTDIR="${pkgdir}" altinstall maninstall
ln -sf "python${_pybasever}" "${pkgdir}/usr/bin/python"
......@@ -62,6 +83,8 @@ package() {
ln -sf "python${_pybasever}-config" "${pkgdir}/usr/bin/python2-config"
ln -sf "python${_pybasever}.1" "${pkgdir}/usr/share/man/man1/python2.1"
ln -sf python-${_pybasever}.pc "${pkgdir}"/usr/lib/pkgconfig/python2.pc
ln -sf "../../libpython${_pybasever}.so" \
"${pkgdir}/usr/lib/python${_pybasever}/config/libpython${_pybasever}.so"
......@@ -74,10 +97,6 @@ package() {
install -m755 Tools/scripts/{README,*py} \
"${pkgdir}/usr/lib/python${_pybasever}/Tools/scripts"
# clean up #!s
find "${pkgdir}/usr/lib/python${_pybasever}" -name '*.py' | \
xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python2|"
# clean-up reference to build directory
sed -i "s#${srcdir}/Python-${pkgver}:##" \
"${pkgdir}/usr/lib/python${_pybasever}/config/Makefile"
......@@ -85,5 +104,3 @@ package() {
# license
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
# vim:set ts=2 sw=2 et:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment