Date: Wednesday, January 8, 2020 @ 22:51:15 Author: felixonmars Revision: 372839
upgpkg: python 3.8.1-2 split out tests to make python ~50% smaller Modified: python/trunk/PKGBUILD ----------+ PKGBUILD | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2020-01-08 21:23:13 UTC (rev 372838) +++ PKGBUILD 2020-01-08 22:51:15 UTC (rev 372839) @@ -4,9 +4,12 @@ # Contributor: Allan McRae <al...@archlinux.org> # Contributor: Jason Chu <ja...@archlinux.org> -pkgname=python +shopt -s extglob + +pkgbase=python +pkgname=(python python-tests) pkgver=3.8.1 -pkgrel=1 +pkgrel=2 _pybasever=${pkgver%.*} pkgdesc="Next generation of the python high-level scripting language" arch=('x86_64') @@ -101,7 +104,7 @@ -x test_httplib } -package() { +package_python() { cd Python-${pkgver} # Hack to avoid building again @@ -112,6 +115,9 @@ make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" install + # Split tests + rm -r "$pkgdir"/usr/lib/python*/{test,ctypes/test,distutils/tests,idlelib/idle_test,lib2to3/tests,sqlite3/test,tkinter/test,unittest/test} + # Why are these not done by default... ln -s python3 "${pkgdir}"/usr/bin/python ln -s python3-config "${pkgdir}"/usr/bin/python-config @@ -127,3 +133,28 @@ # License install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } + +package_python-tests() { + pkgdesc="Regression tests packages for Python" + depends=('python') + + cd Python-${pkgver} + + make DESTDIR="${pkgdir}" EXTRA_CFLAGS="$CFLAGS" libinstall + cd "$pkgdir"/usr/lib/python*/ + rm -r !(test|ctypes|distutils|idlelib|lib2to3|sqlite3|tkinter|unittest) + cd "$pkgdir"/usr/lib/python*/ctypes + rm -r !(test) + cd "$pkgdir"/usr/lib/python*/distutils + rm -r !(tests) + cd "$pkgdir"/usr/lib/python*/idlelib + rm -r !(idle_test) + cd "$pkgdir"/usr/lib/python*/lib2to3 + rm -r !(tests) + cd "$pkgdir"/usr/lib/python*/sqlite3 + rm -r !(test) + cd "$pkgdir"/usr/lib/python*/tkinter + rm -r !(test) + cd "$pkgdir"/usr/lib/python*/unittest + rm -r !(test) +}