summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 847c94e09de19d32340217054687b43f9cefd69b (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
# Maintainer: Luke Labrie-Cleary <luke dot cleary at copenhagenatomics dot com>
pkgname=dagmc-git
pkgver=stable.r0.gb001729e
pkgrel=1
pkgdesc="Direct Accelerated Geometry Monte Carlo (DAGMC) is a software package 
		 that allows users to perform Monte Carlo radiation transport directly 
		 on CAD models."
arch=('x86_64')
url="https://github.com/svalinn/DAGMC"
license=('BSD')

depends=(
	double-down-git
	moab-git
)
makedepends=(
	git
	python
	cmake
)

provides=("${pkgname%}")
source=("${pkgname}::git+${url}.git")
pkgver() {
  cd "$pkgname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

md5sums=('SKIP')

build() {
	cd $srcdir/$pkgname
	mkdir build && cd build
	cmake .. -DBUILD_TALLY=ON \
	         -DMOAB_DIR=/opt/MOAB \
	         -DDOUBLE_DOWN=ON \
	         -DBUILD_STATIC_EXE=OFF \
	         -DBUILD_STATIC_LIBS=OFF \
	         -DCMAKE_INSTALL_PREFIX=/opt/DAGMC \
	         -DDOUBLE_DOWN_DIR=/opt/double-down/lib/cmake/dd
	_ccores=$(nproc)
	# check if _ccores is a positive integer, if not, serial build
	if [[ "${_ccores}" =~ ^[1-9][0-9]*$ ]]; then
		make -j ${_ccores}
	else
		make
	fi
}

package() {
	cd $srcdir/$pkgname/build
	make DESTDIR="$pkgdir/" install
}