summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3e56b40d082a2d49970a5c753b8b524c5134eca8 (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
# Maintainer: Maximilian Stahlberg <maximilian.stahlberg tu-berlin de>

pkgname=python-swiglpk
pkgver=5.0.3
pkgrel=1
pkgdesc='A Python interface to the GLPK optimization solver.'
arch=('any')
url='https://github.com/biosustain/swiglpk'
license=('GPL3')
depends=('python' 'glpk')
makedepends=('swig' 'python-setuptools')
conflicts=('python-swiglpk-git')
source=("https://github.com/biosustain/swiglpk/archive/${pkgver}.tar.gz")
md5sums=('53c8175cab624cf6b6b6f2ba004abc0d')

prepare() {
	cd "${srcdir}/swiglpk-${pkgver}"

	# Work around https://github.com/biosustain/swiglpk/issues/40.
	cp /usr/include/glpk.h .
}

build() {
	cd "${srcdir}/swiglpk-${pkgver}"
	python setup.py build
}

check() {
	_arch="linux-$(uname -m)"
	_pymajver="$(python -V | awk '{print $2}' | awk -F. '{print $1"."$2}')"

	cd "${srcdir}/swiglpk-${pkgver}/build/lib.${_arch}-${_pymajver}"
	python -Bc "import swiglpk"
}

package() {
	cd "${srcdir}/swiglpk-${pkgver}"
	python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
}