summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6ba83d46495b6beda4fb8ef630d9e0b6e3707237 (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
73
74
75
76
77
# Maintainer: eolianoe <eolianoe [at] gmail [DoT] com>
# Contributor: Carl Rogers <carl.rogers@gmail.com>
# Contributor: Jed Brown <jed@59A2.org>
# Contributor: Brenden Mervin <bmervin@utk.edu>

pkgname=silo
pkgver=4.10.2
pkgrel=2
pkgdesc="A Mesh and Field I/O Library and Scientific Database"
url="https://wci.llnl.gov/simulation/computer-codes/silo"
arch=('i686' 'x86_64')
depends=('qt4' 'python2' 'szip' 'hdf5')
makedepends=('gcc-fortran')
license=('BSD' 'custom')
source=(https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('3af87e5f0608a69849c00eb7c73b11f8422fa36903dd14610584506e7f68e638')

_install_docs=1

prepare(){
  cd "${srcdir}"

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

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

  export PYTHON=/usr/bin/python2
  ../${pkgname}-${pkgver}/configure \
    --prefix=/usr \
    --enable-shared --enable-optimization \
    --enable-fortran --enable-browser \
    --enable-silex \
    --with-Qt-dir= --with-Qt-include-dir=/usr/include/qt4 \
    --with-Qt-bin-dir=/usr/lib/qt4/bin  --with-Qt-lib-dir=/usr/lib \
    --with-Qt-lib="{QtCore,QtGui}" \
    --with-zlib=/usr/include,/usr/lib \
    --with-hdf5=/usr/include,/usr/lib \
    --enable-pythonmodule \
    --with-szlib=/usr/lib \
    --enable-install-lite-headers \
    --enable-hzip --enable-fpzip

  make
}

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

  # Quick test
  make testall
  ./testall

  # All tests, but tests 33 (rocket) and 46 (write objects) failed,
  # and they all failed with an out of source build
  #make check PYTHON=/usr/bin/python2 BROWSER="${srcdir}/${pkgname}-${pkgver}/build/tools/browser"
}

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

  make DESTDIR="${pkgdir}" install

  if [ ${_install_docs} -eq 1 ]
  then
    make DESTDIR="${pkgdir}" install-html
    install -Dm644 "${srcdir}/${pkgname}-${pkgver}/docs/Silo.book.pdf" \
      "${pkgdir}/usr/share/doc/${pkgname}/Silo.book.pdf"
  fi

  cd "${srcdir}/${pkgname}-${pkgver}"
  install -Dm644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 BSD_LICENSE_README "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-BSD"
}