aboutsummaryrefslogtreecommitdiffstats
path: root/testing/python3/APKBUILD
blob: 3dae913a4622ff15fca9b135e1e74139ed79cd08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Maintainer: Kiyoshi Aman <kiyoshi.aman@gmail.com>
pkgname=python3
pkgver=3.3.4
_pkgver=3.3
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"
source="http://www.python.org/ftp/python/$pkgver/Python-$pkgver.tar.xz
	posix_close.patch"

_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
}

build() {
	cd "$_builddir"
	./configure \
		--prefix=/usr \
		--enable-shared \
		--with-threads \
		--with-system-ffi \
		--enable-unicode=ucs4 \
		--with-dbmliborder=ndbm \
        --disable-rpath \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make -j1 DESTDIR="$pkgdir" install || 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
}

tests() {
	pkgdesc="The test modules from the main python package"
	arch="noarch"
	cd "$pkgdir"
	_mv_files
}

md5sums="8fb961a20600aafafd249537af3ac637  Python-3.3.4.tar.xz
9f3d2782d046ca2b65647d20a6c6daa4  posix_close.patch"
sha256sums="c6cc126d91c04e0348882cfbd36d7a844d4e50acc37a3f6a64d67764e3995689  Python-3.3.4.tar.xz
eb7830dde7db3a906e31053ddaa6145c6ba9f3766b4272722ba5ee7cf9722aff  posix_close.patch"
sha512sums="b6cf2cb32504020c691d5be092ee62415b3f1c1a72ca8285b9f1d8e0770ac57f0d8c451a1e6ab921b77f1abe507c4afd75189b01a3f15438c2e4a4c074c0675a  Python-3.3.4.tar.xz
99791b872f5dd2bb5287fc10a95fcfbdcc40db380e88f88bd8254504950fb3393808a07388cf150f4f09c8e229be15612b3a4c7e707b29e659ae3bf144e51a9d  posix_close.patch"