summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 57403872a755ed9ee77a013015d9f30900ae8fd8 (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
# Maintainer: Maximilian Stahlberg <maximilian.stahlberg tu-berlin de>
# Contributor: Feufochmar <feufochmar dot gd at gmail dot com>

_name='libtcod'
_importname='libtcodpy'
pkgbase=('python-libtcod')
pkgname=('python-libtcod' 'python2-libtcod')
pkgver=1.8.2
pkgrel=1
pkgdesc="Python Roguelike graphics/utility library"
arch=('any')
url="https://bitbucket.org/libtcod/libtcod"
license=('BSD')
depends=('libtcod')
makedepends=('mercurial' 'python-setuptools' 'python2-setuptools')
source=("hg+https://bitbucket.org/$_name/$_name#tag=$pkgver")
md5sums=('SKIP')

package_python-libtcod() {
	depends+=('python')

	cd "${srcdir}/${_name}/python"

	python setup.py install --root=${pkgdir}

	# Link libtcod.so so the Python library finds it.
	pythonver="$(python -V)"
	cd "${pkgdir}/usr/lib/python${pythonver:7:3}/site-packages/${_name}py"
	ln -s ../../../libtcod.so .
}

package_python2-libtcod() {
	depends+=('python2')

	cd "${srcdir}/${_name}/python"

	python2 setup.py install --root=${pkgdir}

	# Link libtcod.so so the Python library finds it.
	pythonver="$(python2 -V 2>&1)"
	cd "${pkgdir}/usr/lib/python${pythonver:7:3}/site-packages/${_name}py"
	ln -s ../../../libtcod.so .
}