summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6e2b1b8f64662f1169863c069a75453cc0a1655 (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
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=freefem-git
pkgver=4.3.1r20190619
epoch=1
pkgrel=1
pkgdesc='A PDE oriented language using the finite element method from git'
arch=('x86_64')
url="https://freefem.org/index.html"
license=('LGPL')
depends=('fftw' 'freeglut' 'glu' 'suitesparse' 'hdf5' 'gsl' 'openmpi' 'openblas-lapack' 'arpack' 'parmetis' 'python')
makedepends=('git' 'texlive-core')
provides=('freefem' 'freefem++')
conflicts=('freefem' 'freefem++')
source=('FreeFem::git+https://github.com/FreeFem/FreeFem-sources.git#branch=develop')
md5sums=('SKIP')
options=('!makeflags')

pkgver() {
  cd FreeFem
  printf "%sr%s" $(grep AC_INIT configure.ac| cut -d, -f2|tr - .) $(git log -1 --format="%cd" --date=short | sed 's|-||g')
}

prepare() {
  cd FreeFem
  autoreconf -fi 
  ./configure CXXFLAGS=" --std=c++11" \
	      --prefix=/usr \
	      --sysconfdir=/etc \
	      --enable-download \
	      --disable-mumps \
	      --enable-hpddm
  find . -name Makefile -exec sed -i 's+^gcc+gcc =+' {} \;
  find . -name Makefile -exec sed -i 's+^dir+dir =+' {} \;
}

build() {
  cd FreeFem
  make 
}

check() {
  cd FreeFem
  make check || true
}

package() {
  cd FreeFem
  make -d DESTDIR="$pkgdir" install||true
  find "$pkgdir"/usr/lib/ff++/ -name "*.h" -exec chmod o+r {} \;
  # remove unneeded files
  rm -f "$pkgdir"/usr/share/freefem++/${_pkgver}/INSTALL*
  rm -f "$pkgdir"/usr/share/freefem++/${_pkgver}/README_*
  rm -f "$pkgdir"/usr/share/freefem++/${_pkgver}/mode-mi-edp.zip
  rm -rf "$pkgdir"/usr/share/freefem++/${_pkgver}/download
}