summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5edeb8cf7fe4ec8ca1b7b8231f5d953ab059056c (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
_name=pyjnius
pkgbase=python-$_name
pkgname=(python2-$_name python-$_name)
pkgver=1.2.0
pkgrel=1
pkgdesc='Python module to access Java class as Python class, using JNI.'
arch=(any)
url="https://github.com/kivy/$_name"
license=(MIT)
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
sha256sums=('9ff35438d6f6774d7d6fb0632587e45d5dd3d4ecb1d3a3bef31a3e31de1709d0')
makedepends=(
    cython  python-setuptools
    cython2 python2-setuptools
)

prepare() {
	rm -rf "$srcdir"/python{,2}-"$_name-$pkgver"
	mv "$srcdir/$_name-$pkgver" "$srcdir/python-$_name-$pkgver"
	cp -a "$srcdir"/python{,2}-"$_name-$pkgver"
}

build_() {
	local python=$1
	cd "$srcdir/$python-$_name-$pkgver"
	
	$python setup.py build_ext --inplace -f
	$python setup.py build
}
build() {
	build_ python
	build_ python2
}


check_() {
	local python=$1
	cd "$srcdir/$python-$_name-$pkgver"
	$python setup.py test
}
check_python-pyjnius() {
	check_ python
}
check_python2-pyjnius() {
	check_ python2
}

package_() {
	local python=$1
	cd "$srcdir/$python-$_name-$pkgver"
	
	depends=($python 'java-environment')
	$python setup.py install --root="$pkgdir" --skip-build
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE.rst"
}
package_python-pyjnius() {
	package_ python
}
package_python2-pyjnius() {
	package_ python2
}