summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b211f3bb545a4ed759c1a5dd6811253b3e18705f (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
# Maintainer: Graham Gower <graham dot gower at gmail dot com>
_gitname=SLiM
#_gittag=v3.3.2	# tag, branch, or commit; comment out to use latest
pkgname=slim-simulator
pkgver=3.3.2.r177.g148cdba4
pkgrel=1
pkgdesc="A forwards-time population genetic simulator."
arch=("x86_64")
url="https://messerlab.org/slim/"
license=('GPL3')
depends=("qt5-base")
makedepends=("git" "cmake")
conflicts=("slim") # a display manager, also called SLiM
source=("git+https://github.com/MesserLab/${_gitname}.git#branch=qtslim")
md5sums=('SKIP')

prepare() {
	if [ ! -z "$_gittag" ] ; then
		cd "${srcdir}/${_gitname}"
		git checkout $_gittag \
			|| (echo "Couldn't checkout '${_gittag}'"; exit 1)
		cd ../..
	fi
	mkdir -p build
}

pkgver() {
	cd "${srcdir}/${_gitname}"
	git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd build
	cmake \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D BUILD_QTSLIM=ON \
		../${_gitname} \
		|| (echo "cmake failed"; exit 1)
	make || (echo "make failed"; exit 1)
}

check() {
	cd build
	echo "Running 'slim -testEidos'..."
	./slim -testEidos || (echo "Eidos tests failed"; exit 1)
	echo "Running 'slim -testSLiM'..."
	./slim -testSLiM || (echo "SLiM tests failed"; exit 1)
}

package() {
	cd build
	make DESTDIR="$pkgdir" install || (echo "make install failed"; exit 1)
}