diff options
Diffstat (limited to 'testing/pypy-bootstrap/APKBUILD')
-rw-r--r-- | testing/pypy-bootstrap/APKBUILD | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/testing/pypy-bootstrap/APKBUILD b/testing/pypy-bootstrap/APKBUILD new file mode 100644 index 00000000000..103cfb5e43b --- /dev/null +++ b/testing/pypy-bootstrap/APKBUILD @@ -0,0 +1,121 @@ +# Maintainer: Thomas Liske <thomas@fiasko-nw.net> +pkgname=pypy-bootstrap +pkgver=7.3.12 +_py2ver=2.7.18 +_pycpver=2.21 +pkgrel=0 +pkgdesc="Fast, compliant alternative implementation of Python" +url="https://www.pypy.org/" +arch="x86 x86_64 s390x aarch64 ppc64le" +license="MIT" +makedepends=" + bzip2-dev + expat-dev + gdbm-dev + libc-dev + libffi-dev + linux-headers + ncurses-dev + openssl-dev>3 + perl + pkgconf + readline-dev + rsync + sqlite-dev + tk-dev + xz-dev + zlib-dev + " +options="!check" +# libpypy-c.so on x86 has textrels; no checks for bootstrap +[ "$CARCH" = "x86" ] && options="$options textrels" +source="https://downloads.python.org/pypy/pypy2.7-v$pkgver-src.tar.bz2 + https://www.python.org/ftp/python/$_py2ver/Python-$_py2ver.tar.xz + https://files.pythonhosted.org/packages/source/p/pycparser/pycparser-$_pycpver.tar.gz + py2_musl-find_library.py2patch + py2_unchecked-ioctl.py2patch + py2_cve-2021-3177.py2patch + " + +# Provide pypy-bootstrap for testing/pypy. +provider_priority=1 # lowest + +prepare() { + default_prepare + + cd Python-$_py2ver + + # apply Python2 patches + for i in ../py2_*.py2patch; do + patch -p1 <$i + done + + # Make sure Python2 uses system libs + rm -r Modules/expat Modules/_ctypes/libffi* Modules/zlib +} + +build() { + ### Python2 ### + export OPT="$CFLAGS -DTHREAD_STACK_SIZE=0x100000" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=$srcdir/usr \ + --enable-ipv6 \ + --enable-shared \ + --enable-unicode=ucs4 \ + --with-system-expat \ + --with-system-ffi \ + --with-system-zlib \ + --with-threads + make LD_RUN_PATH="$srcdir/usr/lib" + make -j1 install + + # pycparser + cd $srcdir/pycparser-$_pycpver + ../usr/bin/python2 setup.py install + + ### PyPy ### + cd $srcdir/pypy2.7-v$pkgver-src/pypy/goal + + if [ "$JOBS" -gt 16 ]; then + export JOBS=16 + fi + + # translate with JIT + ../../../usr/bin/python2 ../../rpython/bin/rpython \ + --opt=jit \ + --shared \ + --make-jobs $JOBS \ + targetpypystandalone + + # compile binary modules + PYTHONPATH=../.. ./pypy-c ../../lib_pypy/pypy_tools/build_cffi_imports.py +} + +package() { + cd src/pypy2.7-v$pkgver-src + + install -Dm755 pypy/goal/pypy-c "$pkgdir"/usr/lib/pypy/bin/pypy-c + install -Dm755 pypy/goal/libpypy-c.so "$pkgdir"/usr/lib/pypy/bin/libpypy-c.so + + rsync -r --exclude='__pycache__' --exclude='*.c' --exclude '*.o' lib_pypy/ "$pkgdir"/usr/lib/pypy/lib_pypy/ + + rsync -r --exclude='__pycache__' --exclude='test' --exclude='tests' lib-python/ "$pkgdir"/usr/lib/pypy/lib-python/ + + rsync -r --include='*.h' -f 'hide,! */' include/ "$pkgdir"/usr/lib/pypy/include/ + + # Install symlinks + mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/lib + ln -s ../lib/pypy/bin/pypy-c "$pkgdir"/usr/bin/pypy + ln -s pypy/bin/libpypy-c.so "$pkgdir"/usr/lib/libpypy-c.so +} + +sha512sums=" +35ec35376f1e7c1a5dea9dc5bce6819a94c2df2645806c83185487587470b47ab529c25ecb8ca200505319f40789859a2919c61902b693421e2001313b46e5f4 pypy2.7-v7.3.12-src.tar.bz2 +a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c Python-2.7.18.tar.xz +e61fbdde484d1cf74d4b27bdde40cf2da4b7028ca8ecd37c83d77473dab707d457321aecaf97da3b114c1d58a4eb200290b76f9c958044b57e5fed949895b5f0 pycparser-2.21.tar.gz +ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 py2_musl-find_library.py2patch +5a8e013a4132d71c4360771f130d27b37275ae59330cf9a75378dc8a11236017f540eb224f2a148984e82ca3fb6b29129375b1080ba05b81044faa717520ab82 py2_unchecked-ioctl.py2patch +7d6c5d85a572450fb463feea9c7a8159aa8dd0c604e69f19da6eb57108c60e37ebce41b80758f63dd01e4a22286f80665ce4d778a30fa45ad5f1d6ce074c1f81 py2_cve-2021-3177.py2patch +" |