aboutsummaryrefslogtreecommitdiffstats
path: root/testing/pypy3/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/pypy3/APKBUILD')
-rw-r--r--testing/pypy3/APKBUILD136
1 files changed, 114 insertions, 22 deletions
diff --git a/testing/pypy3/APKBUILD b/testing/pypy3/APKBUILD
index 16a6714ba74..5322f6e6f83 100644
--- a/testing/pypy3/APKBUILD
+++ b/testing/pypy3/APKBUILD
@@ -1,43 +1,135 @@
# Maintainer: Thomas Liske <thomas@fiasko-nw.net>
-
pkgname=pypy3
-pkgver=7.3.7
+pkgver=7.3.12
+_pkgver=${pkgver/_/}
+_pyver=3.10
pkgrel=0
-pkgdesc="fast, compliant alternative implementation of Python 3.7"
+pkgdesc="Fast, compliant alternative implementation of Python $_pyver"
url="https://www.pypy.org/"
arch="x86 x86_64 aarch64 s390x"
license="MIT"
-makedepends="bzip2-dev expat-dev gdbm-dev libc-dev libffi-dev linux-headers
- ncurses-dev openssl1.1-compat-dev pkgconf readline-dev sqlite-dev tk-dev
- xz-dev zlib-dev pypy"
-options="!check" # checks will be enabled later
-[ "$CARCH" = "x86" ] && options="$options textrels" # on x86 has textrels
-source="https://downloads.python.org/pypy/pypy3.7-v$pkgver-src.tar.bz2
+makedepends="
+ bzip2-dev
+ expat-dev
+ gdbm-dev
+ libffi-dev
+ linux-headers
+ ncurses-dev
+ openssl-dev>3
+ pypy
+ readline-dev
+ sqlite-dev
+ tk-dev
+ util-linux-misc
+ xz-dev
+ zlib-dev
+ "
+subpackages="$pkgname-dev $pkgname-tests $pkgname-tkinter $pkgname-pyc"
+source="https://downloads.python.org/pypy/pypy$_pyver-v$_pkgver-src.tar.bz2
0001-time.patch
0002-extern-stdio.patch
"
-builddir="$srcdir/pypy3.7-v$pkgver-src"
+builddir="$srcdir/pypy$_pyver-v$_pkgver-src"
+options="!check" # todo
+
+[ "$CARCH" = "x86" ] && options="$options textrels" # on x86 has textrels
build() {
- cd pypy/goal
+ if [ "$JOBS" -gt 16 ]; then
+ export JOBS=16
+ fi
+
+ msg "building pypy3"
+ pypy rpython/bin/rpython --opt=jit --shared --make-jobs=${JOBS:-2} pypy/goal/targetpypystandalone.py
+
+ msg "configuring system dirs"
+ ./pypy3.10-c -m sysconfig --generate-posix-vars \
+ LIBDIR=/usr/lib \
+ TZPATH=/usr/share/zoneinfo \
+ INCLUDEPY=/usr/include/pypy$_pyver
- # translate with JIT
- export JOBS=${JOBS:-$(nproc)}
- pypy ../../rpython/bin/rpython --opt=jit --shared --make-jobs $(( JOBS > 16 ? 16 : JOBS )) targetpypystandalone
+ local out="$(cat pybuilddir.txt)"
+ cp "$out"/_sysconfigdata__*.py lib-python/3/
- # compile binary modules
- PYTHONPATH=../.. ./pypy3-c ../../lib_pypy/pypy_tools/build_cffi_imports.py
+ msg "generating pattern pickles"
+ ./pypy$_pyver-c - <<-EOF
+ import lib2to3.pygram
+ import lib2to3.patcomp
+ lib2to3.patcomp.PatternCompiler()
+ EOF
+
+ msg "compiling binary modules"
+ ./pypy$_pyver-c lib_pypy/pypy_tools/build_cffi_imports.py
+
+ # cleanup pypy libdir
+ find lib_pypy -name "*_cffi.[co]" -delete
+ find lib_pypy -type d -empty -delete
+}
+
+check() {
+ ./pypy$_pyver-c -u pypy/test_all.py \
+ pypy/module/pypyjit/test_pypy_c
}
package() {
- # Prepare installation
- pypy pypy/tool/release/package.py --archive-name pypy --targetdir .
- mkdir -p $pkgdir
- tar xf pypy.tar.bz2 -C "$pkgdir"
+ mkdir -p "$pkgdir"/usr/lib/pypy$_pyver "$pkgdir"/usr/include
+
+ # install stdlib
+ # this puts everything just like python itself does
+ cp -a lib-python/3/. lib_pypy/. "$pkgdir"/usr/lib/pypy$_pyver/
+
+ # install includes
+ cp -a include/pypy$_pyver "$pkgdir"/usr/include/
+
+ # install pypy itself
+ install -Dm755 ./pypy$_pyver-c -t "$pkgdir"/usr/bin
+ install -Dm755 ./libpypy$_pyver-c.so -t "$pkgdir"/usr/lib/
+
+ # install symlink
+ ln -sfv pypy$_pyver-c "$pkgdir"/usr/bin/pypy3
+
+ # allow fail for 2to3 module
+ ./pypy$_pyver-c -m compileall -fq "$pkgdir"/usr/lib || true
+}
+
+dev() {
+ default_dev
+
+ # pyconfig.h is needed at runtime
+ mkdir -p "$pkgdir"/usr/include/pypy$_pyver
+ mv "$subpkgdir"/usr/include/pypy$_pyver/pyconfig.h \
+ "$pkgdir"/usr/include/pypy$_pyver/
+}
+
+tests() {
+ pkgdesc="$pkgdesc (test module)"
+
+ amove \
+ usr/lib/pypy$_pyver/test \
+ usr/lib/pypy$_pyver/*/test \
+ usr/lib/pypy$_pyver/*/tests
+}
+
+pyc() {
+ pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
+ install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"
+
+ cd "$pkgdir"
+ local IFS='
+'
+ # shellcheck disable=2046
+ amove $(find usr/lib/pypy$_pyver -type d -name __pycache__)
+}
+
+tkinter() {
+ pkgdesc="$pkgdesc (tkinter module)"
+
+ amove usr/lib/pypy$_pyver/_tkinter \
+ usr/lib/pypy$_pyver/tkinter
}
sha512sums="
-99099f17682b606864753b76a6a0cdf860bc2bf79588ee53e7d0586d3f8f6ab6820240666bd3646ade6523dd5adc6999116d4db4285c688984dc33d4fa7743c6 pypy3.7-v7.3.7-src.tar.bz2
-17c5cb7101e9e1edaabf87e69e89bc5c750657291df7817b1cc86e63f28e86f61e14523a3ab9a04d35078efcf563c0b7bd45cdd7dea665df10e061a356aa66b1 0001-time.patch
+080520c7de267e17a2823f06cd0a15c108a2c32fc296d6e24782050eb546fa74852d948ede2c381dba110774121b20efc3a07b553acd0ac0db4a844dfc09069e pypy3.10-v7.3.12-src.tar.bz2
+42abc8c67c249ff012010aec568579cd738ed2d74ffdf93755c9427117e85cd859390266c7431fcb4d2fcfd82b61d5ba0c58bd0ceda44e5d12bf22df5935bb24 0001-time.patch
b648204914072e74367b94065d65b423324bcbabc0e2199ad195ab9822ccc6c51ec552c8c17ed22c26caf73b04d16d6f4c3e14a8d1af0e378d76d6c3b587b784 0002-extern-stdio.patch
"