# Maintainer: # Contributor: Kiyoshi Aman # Contributor: Bartłomiej Piotrowski pkgname=python3 pkgver=3.5.0 pkgrel=0 pkgdesc="A high-level scripting language" url="http://www.python.org" arch="all" license="custom" subpackages="$pkgname-dev $pkgname-doc $pkgname-tests" depends="" makedepends="expat-dev openssl-dev zlib-dev ncurses-dev bzip2-dev sqlite-dev libffi-dev tcl-dev linux-headers gdbm-dev libedit-dev" source="http://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz" _builddir="$srcdir"/Python-$pkgver prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done # force system libs rm -r Modules/expat \ Modules/zlib \ Modules/_ctypes/darwin* \ Modules/_ctypes/libffi* \ || return 1 } build() { cd "$_builddir" ./configure \ --prefix=/usr \ --enable-shared \ --enable-ipv6 \ --with-computed-gotos \ --with-threads \ --with-system-ffi \ --with-system-expat \ --with-dbmliborder=gdbm:ndbm \ --enable-loadable-sqlite-extensions \ --disable-rpath \ --without-ensurepip \ || return 1 make EXTRA_CFLAGS="$CFLAGS" || return 1 } package() { cd "$_builddir" make -j1 DESTDIR="$pkgdir" EXTRA_CFLAGS="$CFLAGS" install maninstall \ || return 1 mv "$pkgdir"/usr/bin/2to3 "$pkgdir"/usr/bin/2to3-3.3 install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE } _mv_files() { cd "$pkgdir"/usr/lib/python${pkgver%.*} for i in */test */tests; do mkdir -p "$subpkgdir"/usr/lib/python${pkgver%.*}/"$i" mv "$i"/* "$subpkgdir"/usr/lib/python${pkgver%.*}/"$i" rm -rf "$i" done mv "$pkgdir"/usr/lib/python${pkgver%.*}/test \ "$subpkgdir"/usr/lib/python${pkgver%.*} } dev() { # pyconfig.h is needed runtime so we move it back default_dev mkdir -p "$pkgdir"/usr/include/python${pkgver%.*}m mv "$subpkgdir"/usr/include/python${pkgver%.*}m/pyconfig.h \ "$pkgdir"/usr/include/python${pkgver%.*}m/ } tests() { pkgdesc="The test modules from the main python package" arch="noarch" cd "$pkgdir" _mv_files } md5sums="d149d2812f10cbe04c042232e7964171 Python-3.5.0.tar.xz" sha256sums="d6d7aa1634a5eeeca6ed4fca266982a04f84bd8f3945a9179e20b24ad2e2be91 Python-3.5.0.tar.xz" sha512sums="f06bd652484aa89371021d0f9fcb08e6e905e90b39ae065d7df75b367e66b7ea43a818ca33ce04aa3d6746b5e8b1b83e90b709ac2203324fb7a595c1017be149 Python-3.5.0.tar.xz"