# Maintainer: soh @ AUR # Contributor: Angel Velasquez # Contributor: Felix Yan # Contributor: Stéphane Gaudreault # Contributor: Allan McRae # Contributor: Jason Chu pkgname=python310 pkgver=3.10.14 pkgrel=2 _pymajver=3 _pybasever=${pkgver%.*} pkgdesc="Next generation of the python high-level scripting language, version 3.10" arch=('x86_64') license=('custom') url="https://www.python.org/" depends=('bzip2' 'expat' 'gdbm' 'libffi' 'libnsl' 'libxcrypt' 'openssl' 'zlib') makedepends=('tk' 'sqlite' 'bluez-libs' 'mpdecimal' 'llvm' 'gdb') optdepends=('python-setuptools' 'python-pip' 'sqlite' 'mpdecimal: for decimal' 'xz: for lzma' 'tk: for tkinter') source=("https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz") sha256sums=('9c50481faa8c2832329ba0fc8868d0a606a680fc4f60ec48d26ce8e076751fda') validpgpkeys=('A035C8C19219BA821ECEA86B64E628F8D684696D') # Pablo Galindo Salgado provides=("python=$pkgver") prepare() { cd Python-${pkgver} # 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} # PGO should be done with -O3 CFLAGS="${CFLAGS/-O2/-O3} -ffat-lto-objects" # Disable bundled pip & setuptools ./configure \ ax_cv_c_float_words_bigendian=no \ --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 \ --with-tzpath=/usr/share/zoneinfo make EXTRA_CFLAGS="$CFLAGS" } package() { 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}" make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" altinstall maninstall # Split tests rm -r "$pkgdir"/usr/lib/python*/{test,ctypes/test,distutils/tests,idlelib/idle_test,lib2to3/tests,sqlite3/test,tkinter/test,unittest/test} # Avoid conflicts with the main 'python' package. rm -f "${pkgdir}/usr/lib/libpython${_pymajver}.so" rm -f "${pkgdir}/usr/share/man/man1/python${_pymajver}.1" # Clean-up reference to build directory sed -i "s|$srcdir/Python-${pkgver}:||" "$pkgdir/usr/lib/python${_pybasever}/config-${_pybasever}-${CARCH}-linux-gnu/Makefile" # 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" }