summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7081535a9aaf15b11c6b949160e32bce5d6e8ce4 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Maintainer: banana-bred <j.forer@posteo.net>

pkgname='opencoarrays-git'
_name="OpenCoarrays"
pkgver=2.10.2.r0.g5f09984
pkgrel=3
pkgdesc="A transport layer for coarray Fortran compilers."
arch=('x86_64')
url="https://github.com/sourceryinstitute/${_name}"
license=('BSD')
groups=()
depends=('openmpi' )
makedepends=('cmake' 'git' 'gcc-fortran')
checkdepends=()
optdepends=()
provides=()
conflicts=("${pkgname%-*}" "${pkgname%-*}"-mpich-git)
replaces=()
backup=()
options=()
install=
changelog=
noextract=()
source=("${pkgname%-*}::git+${url}.git")
sha256sums=(SKIP)

pkgver() {

  cd "${pkgname%-*}"

  git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'

}

build() {

  cd "${srcdir}/${pkgname%-*}"

  export FC="$(command -v gfortran)"
  export CC="$(command -v gcc)"

  cmake \
    -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib

  cd "${srcdir}/${pkgname%-*}/build"

  make

}

check() {

  cd "${srcdir}/${pkgname%-*}/build"

  make test

}

package() {

  cd "${srcdir}/${pkgname%-*}/build"

  make DESTDIR="${pkgdir}" install

  install -D -m 644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

}

# vim: ts=2 sw=2 et :