summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b20b66e4db9e4e28f61b753e29942a2373d328e3 (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: Carlos Aznarán <caznaranl@uni.pe>
pkgbase=dune-mmesh
pkgname=(${pkgbase} python-${pkgbase})
pkgver=1.3.1
pkgrel=1
pkgdesc="MMesh is a grid implementation based on CGAL triangulations"
arch=('x86_64')
url="https://dune-project.org/modules/${pkgbase}"
license=('GPL3')
makedepends=('dune-fem>=2.8.0' 'boost' 'texlive-core' 'doxygen' 'graphviz' 'python-setuptools')
optdepends=('openmpi: for mpi support'
  'vc: C++ Vectorization library'
  'texlive-core: Type setting system'
  'doxygen: Generate the class documentation from C++ sources'
  'graphviz: Graph visualization software'
  'dune-fem: for store static information about grid implementation or support type of boundary id provider specialized for each grid type')
source=(https://github.com/samuelburbulla/${pkgbase}/archive/release/${pkgver}.tar.gz)
sha512sums=('f704d33f77b37ef02a0b15af4a1feac4fc240e87544e2aa4ece4bdb427be24af475e9dd2c1f2f28df3036eee73e1ae246ddb0f46431367df4d7de6ab1a320ae5')

prepare() {
  sed -i 's/^Version: 1.3-git/Version: '"${pkgver}"'/' ${pkgbase}-release-${pkgver}/dune.module
}

build() {
  cmake \
    -S ${pkgbase}-release-${pkgver} \
    -B build-cmake \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=TRUE \
    -DCMAKE_CXX_STANDARD=17 \
    -DCMAKE_C_COMPILER=gcc \
    -DCMAKE_CXX_COMPILER=g++ \
    -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
    -DENABLE_HEADERCHECK=ON \
    -DDUNE_ENABLE_PYTHONBINDINGS=ON \
    -DDUNE_PYTHON_INSTALL_LOCATION='none' \
    -Wno-dev
  cmake --build build-cmake --target all
  cd "build-cmake/python"
  python setup.py build
}

package_dune-mmesh() {
  depends=('dune-grid>=2.8.0')
  DESTDIR="${pkgdir}" cmake --build build-cmake --target install
  install -m644 -D ${pkgbase}-release-${pkgver}/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE"
  find "${pkgdir}" -type d -empty -delete
}

package_python-dune-mmesh() {
  depends=('dune-mmesh>=2.8.0' 'python-dune-fem>=2.8.0')
  pkgdesc+=" (python bindings)"
  cd "build-cmake/python"
  PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
}