# Maintainer: # Contributor: Kiyoshi Aman # Contributor: Bartłomiej Piotrowski pkgname=python3 pkgver=3.5.1 pkgrel=1 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 \ || 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="e9ea6f2623fffcdd871b7b19113fde80 Python-3.5.1.tar.xz" sha256sums="c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 Python-3.5.1.tar.xz" sha512sums="261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 Python-3.5.1.tar.xz"