aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-tqdm/APKBUILD
blob: 819b425325437714dfb5811bf40565b25993ddea (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
71
72
73
74
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-tqdm
_pkgname=tqdm
pkgver=4.19.5
pkgrel=1
pkgdesc="Fast, Extensible Progress Meter"
url="https://pypi.python.org/pypi/tqdm"
arch="noarch"
license="MIT"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch
	0001-Import-sleep-nearer-to-usage.patch"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"

	case "$CARCH" in
		# XXX: Perf tests fail on aarch64 builder.
		aarch64) rm tqdm/tests/tests_perf.py;;
	esac
}

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"

	python2 setup.py test
	# Broken on our current Python build due to setuptools version conflict
	#python3 setup.py test
}

package() {
	mkdir -p "$pkgdir"/usr/bin
	ln -s tqdm-3 "$pkgdir"/usr/bin/tqdm
}

_py() {
	local python="$1"
	local pyver="${python:6:1}"
	pkgdesc="$pkgdesc ($python)"
	depends="$python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"

	cd "$subpkgdir"

	# Add version suffix to executable.
	mv usr/bin/tqdm usr/bin/tqdm-$pyver

	rm -r usr/man
}

_py2() {
	_py python2
}

_py3() {
	_py python3
}

sha512sums="fff1946466e109bf020a6dbaca7e99b992c0335bc4b380224e981b2e0690a5ef465fdd95ee9473bdc0f0381897c5314cee715c600708d02892e0a109e5b9dbbe  tqdm-4.19.5.tar.gz
3e94642970da68ec422f78ba8aa080832ab3b2d2cb66b137d79dccd71921d0bb8796f97828b1eedd5751502a816bbd6a6d66fae238bd9a6fbc46c58f93d69636  0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch
4d6b06028a8d8c4214dc57168fa50ccd19fea79b7099d5d695bf00a6e8f01ece76341dc992ce8bfb513140f3b425d29e428842a8ade417d758bf4c67474d65d0  0001-Import-sleep-nearer-to-usage.patch"