summaryrefslogtreecommitdiff
path: root/cgns/PKGBUILD
blob: f959bbe1ec77997d63ecc17fc59f89931291ea5b (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
72
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: eolianoe <eolianoe At GoogleMAIL DoT com>
# Contriburor: Mathias Anselmann <mathias.anselmann@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: lainme <lainme993@gmail.com>
# Contributor: Klimov Max <cleemmi@gmail.com>

pkgname=cgns
_PKGNAME=CGNS
pkgver=3.3.1
pkgrel=1
pkgdesc='Standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations'
arch=('i686' 'x86_64')
url='http://www.cgns.org'
license=('custom')
depends=('tk' 'hdf5' 'libxmu' 'glu')
makedepends=('gcc-fortran' 'cmake')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/${_PKGNAME}/${_PKGNAME}/archive/v${pkgver}.tar.gz)
sha512sums=('d25149b6e59d9db7c31a36967a8d035308a15b9ba884da44999673d9ced43aa60c90a5152ce9f223fb9690a4802e56dce4aaec24f6b40c1d9eea370523383c32')

# need to tell cmake when to build 64bit version
if [[ $CARCH == "x86_64" ]]
then
  _64bits=ON
else
  _64bits=OFF
fi

prepare(){
  cd "${srcdir}"

  # Out of source build
  rm -rf -- build
  mkdir -p -- build
}

build() {
  cd "${srcdir}/build"

  cmake \
    -DCGNS_BUILD_CGNSTOOLS:BOOL=ON \
    -DCGNS_BUILD_SHARED:BOOL=ON \
    -DCGNS_ENABLE_64BIT:BOOL=${_64bits} \
    -DCGNS_ENABLE_FORTRAN:BOOL=ON \
    -DCGNS_ENABLE_HDF5:BOOL=ON \
    -DCGNS_ENABLE_LEGACY:BOOL=ON \
    -DCGNS_ENABLE_SCOPING:BOOL=OFF \
    -DCGNS_ENABLE_TESTS:BOOL=ON \
    -DCMAKE_BUILD_TYPE:STRING="Release" \
    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DCMAKE_SKIP_RPATH:BOOL=ON \
    "../${_PKGNAME}-${pkgver}"

  make -j1
}


check() {
  cd "${srcdir}/build"

  make test
}

package() {
  cd "${srcdir}/build"

  make DESTDIR="${pkgdir}" install

  # install license
  install -Dm644 "${srcdir}/${_PKGNAME}-${pkgver}/license.txt" \
    "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
}