summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkj-sh6042025-05-15 13:48:58 -0400
committerkj-sh6042025-05-15 13:48:58 -0400
commit7198cdf3fe2a12476303d9b74014b305f1bef309 (patch)
tree02dfb83c0e9758ff8dccd465ae2de5f1f844ccf8
parent567784ee66df2b5d4ba1518ff1d286d30bc9d134 (diff)
feat: add self-managed `python311` package
-rw-r--r--python311-kj_sh604/.SRCINFO32
-rw-r--r--python311-kj_sh604/.gitignore3
-rw-r--r--python311-kj_sh604/PKGBUILD81
3 files changed, 116 insertions, 0 deletions
diff --git a/python311-kj_sh604/.SRCINFO b/python311-kj_sh604/.SRCINFO
new file mode 100644
index 0000000..78c5153
--- /dev/null
+++ b/python311-kj_sh604/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = python311-kj_sh604
+ pkgdesc = Major release 3.11 of the Python high-level programming language
+ pkgver = 3.11.12
+ pkgrel = 1
+ url = https://www.python.org/
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = bluez-libs
+ makedepends = mpdecimal
+ makedepends = gdb
+ depends = bzip2
+ depends = expat
+ depends = gdbm
+ depends = libffi
+ depends = libnsl
+ depends = libxcrypt
+ depends = openssl
+ depends = zlib
+ optdepends = sqlite
+ optdepends = mpdecimal: for decimal
+ optdepends = xz: for lzma
+ optdepends = tk: for tkinter
+ provides = python=3.11.12
+ provides = python311
+ conflicts = python311
+ source = https://www.python.org/ftp/python/3.11.12/Python-3.11.12.tar.xz
+ validpgpkeys = 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
+ validpgpkeys = E3FF2839C048B25C084DEBE9B26995E310250568
+ sha256sums = 849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09
+
+pkgname = python311-kj_sh604
diff --git a/python311-kj_sh604/.gitignore b/python311-kj_sh604/.gitignore
new file mode 100644
index 0000000..4e1c38b
--- /dev/null
+++ b/python311-kj_sh604/.gitignore
@@ -0,0 +1,3 @@
+pkg
+src
+*.tar*
diff --git a/python311-kj_sh604/PKGBUILD b/python311-kj_sh604/PKGBUILD
new file mode 100644
index 0000000..b6058e1
--- /dev/null
+++ b/python311-kj_sh604/PKGBUILD
@@ -0,0 +1,81 @@
+pkgname=python311-kj_sh604
+_pkgname=python311
+pkgver=3.11.12
+pkgrel=1
+_pybasever=3.11
+_pymajver=3
+pkgdesc="Major release 3.11 of the Python high-level programming language"
+arch=('i686' 'x86_64')
+license=('custom')
+url="https://www.python.org/"
+depends=('bzip2' 'expat' 'gdbm' 'libffi' 'libnsl' 'libxcrypt' 'openssl' 'zlib')
+makedepends=('bluez-libs' 'mpdecimal' 'gdb')
+optdepends=('sqlite' 'mpdecimal: for decimal' 'xz: for lzma' 'tk: for tkinter')
+source=(https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz)
+sha256sums=('849da87af4df137710c1796e276a955f7a85c9f971081067c8f565d15c352a09')
+validpgpkeys=(
+ '0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D' # Ned Deily (Python release signing key) <nad@python.org>
+ 'E3FF2839C048B25C084DEBE9B26995E310250568' # Ɓukasz Langa (GPG langa.pl) <lukasz@langa.pl>
+)
+provides=("python=$pkgver" "python311")
+conflicts=("python311")
+
+prepare() {
+ cd "${srcdir}/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, zlib and libffi),
+ # rather than copies shipped in the tarball
+ rm -rf Modules/expat
+ rm -rf Modules/zlib
+ rm -rf Modules/_ctypes/{darwin,libffi}*
+ rm -rf Modules/_decimal/libmpdec
+}
+
+build() {
+ cd "${srcdir}/Python-${pkgver}"
+
+ CFLAGS="${CFLAGS} -fno-semantic-interposition"
+ ./configure \
+ ax_cv_c_float_words_bigendian=no \
+ --prefix=/usr \
+ --enable-shared \
+ --with-computed-gotos \
+ --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 "${srcdir}/Python-${pkgver}"
+ # altinstall: /usr/bin/pythonX.Y but not /usr/bin/python or /usr/bin/pythonX
+ make DESTDIR="${pkgdir}" altinstall maninstall
+
+ # Split tests
+ rm -r "$pkgdir"/usr/lib/python*/{test,ctypes/test,distutils/tests,idlelib/idle_test,lib2to3/tests,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"
+
+ # Add useful scripts 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"
+}