# Maintainer: Jesus E. pkgname=python pkgver=3.8.5 _debver=$pkgver _debrel=1 pkgrel=3 _pybasever=${pkgver%.*} pkgdesc="Next generation of the python high-level scripting language" arch=('i686' 'x86_64') license=('Python') url="https://www.python.org/" depends=('expat' 'bzip2' 'gdbm' 'libressl' 'libffi' 'libxcrypt' 'zlib') makedepends=('tk' 'sqlite' 'mpdecimal' 'quilt') optdepends=('sqlite: for a default database integration' 'mpdecimal: for decimal' 'xz: for lzma' 'tk: for tkinter') provides=('python3') replaces=('python3') source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz"{,.asc} "https://repo.hyperbola.info:50000/sources/${pkgname}/python3.8_$_debver-$_debrel.debian.tar.xz"{,.sig}) sha512sums=('460cee65d7df7150694590575502d7f22e548ebfc99c8f8b363eef8bf30ee72e58d8ffacb1d607824f877f880eb9fd6775a508388029583e1e1df3380f3f9587' 'SKIP' '9540848f66c03c0e6ca289ca5b4aeefc41e04b199a3e073509eb23d8095814a39aa3f835d4e495656ff6fe3a6f942c44755d2d34fcd77f002a2bc13aac239125' 'SKIP') validpgpkeys=('0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key) 'E3FF2839C048B25C084DEBE9B26995E310250568' # Łukasz Langa (GPG langa.pl) 'C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva prepare() { cd Python-${pkgver} if [[ ${pkgver%.*} = ${_debver%.*} ]]; then # Debian patches export QUILT_PATCHES=debian/patches export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index' export QUILT_DIFF_ARGS='--no-timestamps' mv "$srcdir"/debian . # Doesn't apply rm -v debian/patches/arm-alignment.diff || true rm -v debian/patches/bdist-wininst-notfound.diff || true rm -v debian/patches/ctypes-arm.diff || true rm -v debian/patches/deb-locations.diff || true rm -v debian/patches/deb-setup.diff || true rm -v debian/patches/distutils-install-layout.diff || true rm -v debian/patches/distutils-link.diff || true rm -v debian/patches/distutils-sysconfig.diff || true rm -v debian/patches/doc-build-texinfo.diff || true rm -v debian/patches/ensurepip-disabled.diff || true rm -v debian/patches/ensurepip-wheels.diff || true rm -v debian/patches/ext-no-libpython-link.diff || true rm -v debian/patches/gdbm-import.diff || true rm -v debian/patches/git-updates.diff || true rm -v debian/patches/hurd_kfreebsd_thread_native_id.diff || true rm -v debian/patches/langpack-gettext.diff || true rm -v debian/patches/lib-argparse.diff || true rm -v debian/patches/lib2to3-no-pickled-grammar.diff || true rm -v debian/patches/local-doc-references.diff || true rm -v debian/patches/multiarch-extname.diff || true rm -v debian/patches/multiarch.diff || true rm -v debian/patches/pydoc-use-pager.diff || true rm -v debian/patches/sysconfig-debian-schemes.diff || true rm -v debian/patches/sysconfigdata-name.diff || true rm -v debian/patches/tkinter-import.diff || true quilt push -av fi # 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, 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 Python-${pkgver} # Disable bundled pip & setuptools ./configure --prefix=/usr \ --enable-shared \ --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 } package() { cd Python-${pkgver} # Hack to avoid building again sed -i 's/^all:.*$/all: build_all/' Makefile make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" install # Why are these not done by default... ln -s python3 "${pkgdir}"/usr/bin/python ln -s python3-config "${pkgdir}"/usr/bin/python-config ln -s idle3 "${pkgdir}"/usr/bin/idle ln -s pydoc3 "${pkgdir}"/usr/bin/pydoc ln -s python${_pybasever}.1 "${pkgdir}"/usr/share/man/man1/python.1 # 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" }