pkgname=python3 pkgver=3.6.4 pkgrel=1 _pybasever=3.6 pkgdesc="Next generation of the python high-level scripting language" arch=('x86_64') license=('custom') url="http://www.python.org/" depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib') makedepends=('tk' 'sqlite3' 'valgrind' 'bluez-libs') checkdepends=('gdb' 'xorg-server-xvfb') optdepends=('python3-setuptools' 'python3-pip' 'sqlite3' 'xz: for lzma' 'tk: for tkinter') options=('!makeflags') source=("http://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz" dont-make-libpython-readonly.patch) sha1sums=('36a90695cda9298a0663e667c12909246c358851' 'c22b24324b8e53326702de439c401d97927ee3f2') prepare() { cd Python-${pkgver} # 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 # Ensure that we are using the system copy of various libraries (expat, zlib, libffi, and libmpdec), # rather than copies shipped in the tarball rm -r Modules/expat rm -r Modules/zlib rm -r Modules/_ctypes/{darwin,libffi}* rm -r Modules/_decimal/libmpdec } build() { cd Python-${pkgver} # 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 \ --enable-loadable-sqlite-extensions \ --without-ensurepip make EXTRA_CFLAGS="$CFLAGS" } check() { # Failures: # test_pathlib & test_posixpath: https://bugs.python.org/issue24950 # test_gdb # test_distutils: because of our EXTRA_CFLAGS # test_nntplib: downloading external files and failed # Hacks: # test_tk: xvfb-run # test_unicode_file: LC_CTYPE=en_US.utf-8 # test_gdb: SHELL=/bin/sh cd Python-${pkgver} SHELL=/bin/sh \ LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \ LC_CTYPE=en_US.utf-8 xvfb-run \ "${srcdir}/Python-${pkgver}/python" -m test.regrtest -v -uall || warning "Expected failure" } package() { cd Python-${pkgver} # Hack to avoid building again sed -i 's/^all:.*$/all: build_all/' Makefile make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" install maninstall # Fix conflicts with python2 rm ${pkgdir}/usr/bin/2to3 #rm ${pkgdir}/usr/bin/python #rm ${pkgdir}/usr/bin/python-config #rm ${pkgdir}/usr/bin/idle #rm ${pkgdir}/usr/bin/pydoc # 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" }