summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c2778840df88c96d43cb848fb690e1c08daddbb (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
# Contributor: Luis Sarmiento < Luis.Sarmiento-ala-nuclear.lu.se >
pkgname=mcnptools-git
_pkgname=mcnptools
pkgver=r2.d476edf
pkgrel=1
tag=v${pkgver}
pkgdesc="Several utility programs to perform common tasks when interacting with the MCNP® code"
url="https://github.com/lanl/mcnptools"
license=('BSD-3')
arch=('x86_64')
makedepends=('git' 'cmake')
depends=('hdf5' 'python')
source=($pkgname::git+https://github.com/lanl/mcnptools.git)
sha256sums=('SKIP')
provides=(${_pkgname})
conflicts=(${_pkgname})

pkgver() {
  cd ${srcdir}/${pkgname}
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare(){
    cd ${srcdir}/${pkgname}
    msg "git checkout main"
    git checkout main
    msg "git fetch origin"
    git fetch origin
}

build() {
    rm -rf ${srcdir}/build
    mkdir ${srcdir}/build
    cd ${srcdir}/build
    cmake -D CMAKE_INSTALL_PREFIX=/usr \
          -D mcnptools.python_install=User \
          ../${pkgname}
    cmake --build . --config Release
}

check(){
    cd ${srcdir}/build
    ctest --build-config Release
}

package() {
    cd ${srcdir}/build
    DESTDIR="$pkgdir" cmake --install . --config Release
}