|
| 1 | +# Maintainer: Tobias Kunze <r@rixx.de> |
| 2 | +# Maintained at https://github.com/rixx/pkgbuilds, feel free to submit patches |
| 3 | + |
| 4 | +pkgname=python39 |
| 5 | +pkgver=3.9.16 |
| 6 | +pkgrel=2 |
| 7 | +_pybasever=3.9 |
| 8 | +_pymajver=3 |
| 9 | +pkgdesc="Major release 3.9 of the Python high-level programming language" |
| 10 | +arch=('i686' 'x86_64') |
| 11 | +license=('custom') |
| 12 | +url="https://www.python.org/" |
| 13 | +depends=('bzip2' 'expat' 'gdbm' 'libffi' 'libnsl' 'libxcrypt' 'openssl' 'zlib') |
| 14 | +makedepends=('bluez-libs' 'mpdecimal' 'gdb') |
| 15 | +optdepends=('sqlite' 'mpdecimal: for decimal' 'xz: for lzma' 'tk: for tkinter') |
| 16 | +source=( |
| 17 | + https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz |
| 18 | + mpdecimal-2.5.1.patch |
| 19 | +) |
| 20 | +sha256sums=( |
| 21 | + '22dddc099246dd2760665561e8adb7394ea0cc43a72684c6480f9380f7786439' |
| 22 | + '8eb389be1babe03a0231001dc16dd2d69a3ea0fbf6b8c976a580787e7ff1594c' |
| 23 | +) |
| 24 | +validpgpkeys=( |
| 25 | + '0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key) <nad@python.org> |
| 26 | + 'E3FF2839C048B25C084DEBE9B26995E310250568' # Łukasz Langa (GPG langa.pl) <lukasz@langa.pl> |
| 27 | +) |
| 28 | +provides=("python=$pkgver") |
| 29 | + |
| 30 | +prepare() { |
| 31 | + cd "${srcdir}/Python-${pkgver}" |
| 32 | + |
| 33 | + patch -p1 -i "${srcdir}/mpdecimal-2.5.1.patch" |
| 34 | + |
| 35 | + # FS#23997 |
| 36 | + sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py |
| 37 | + |
| 38 | + # Ensure that we are using the system copy of various libraries (expat, zlib and libffi), |
| 39 | + # rather than copies shipped in the tarball |
| 40 | + rm -rf Modules/expat |
| 41 | + rm -rf Modules/zlib |
| 42 | + rm -rf Modules/_ctypes/{darwin,libffi}* |
| 43 | + rm -rf Modules/_decimal/libmpdec |
| 44 | +} |
| 45 | + |
| 46 | +build() { |
| 47 | + cd "${srcdir}/Python-${pkgver}" |
| 48 | + CFLAGS="${CFLAGS} -fno-semantic-interposition" |
| 49 | + |
| 50 | + export ax_cv_c_float_words_bigendian=no |
| 51 | + ./configure --prefix=/usr \ |
| 52 | + --enable-shared \ |
| 53 | + --with-computed-gotos \ |
| 54 | + --with-lto \ |
| 55 | + --enable-ipv6 \ |
| 56 | + --with-system-expat \ |
| 57 | + --with-dbmliborder=gdbm:ndbm \ |
| 58 | + --with-system-ffi \ |
| 59 | + --with-system-libmpdec \ |
| 60 | + --enable-loadable-sqlite-extensions \ |
| 61 | + --without-ensurepip \ |
| 62 | + --with-tzpath=/usr/share/zoneinfo |
| 63 | + |
| 64 | + make EXTRA_CFLAGS="$CFLAGS" |
| 65 | +} |
| 66 | + |
| 67 | +package() { |
| 68 | + cd "${srcdir}/Python-${pkgver}" |
| 69 | + # altinstall: /usr/bin/pythonX.Y but not /usr/bin/python or /usr/bin/pythonX |
| 70 | + make DESTDIR="${pkgdir}" altinstall maninstall |
| 71 | + |
| 72 | + # Split tests |
| 73 | + rm -r "$pkgdir"/usr/lib/python*/{test,ctypes/test,distutils/tests,idlelib/idle_test,lib2to3/tests,sqlite3/test,tkinter/test,unittest/test} |
| 74 | + |
| 75 | + # Avoid conflicts with the main 'python' package. |
| 76 | + rm -f "${pkgdir}/usr/lib/libpython${_pymajver}.so" |
| 77 | + rm -f "${pkgdir}/usr/share/man/man1/python${_pymajver}.1" |
| 78 | + |
| 79 | + # Clean-up reference to build directory |
| 80 | + sed -i "s|$srcdir/Python-${pkgver}:||" "$pkgdir/usr/lib/python${_pybasever}/config-${_pybasever}-${CARCH}-linux-gnu/Makefile" |
| 81 | + |
| 82 | + # Add useful scripts FS#46146 |
| 83 | + install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts} |
| 84 | + install -m755 Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}"/usr/lib/python${_pybasever}/Tools/i18n/ |
| 85 | + install -m755 Tools/scripts/{README,*py} "${pkgdir}"/usr/lib/python${_pybasever}/Tools/scripts/ |
| 86 | + |
| 87 | + # License |
| 88 | + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" |
| 89 | +} |
0 commit comments