summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8af1378960b2accd5d3f4a322c372a5f94c99325 (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
# Maintainer: Renato Caldas <renato@calgera.com>
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
pkgname='dolfinx-git'
pkgdesc='Next generation FEniCS problem solving environment'
pkgver=0.9.0.dev0_r27933.de18733
pkgrel=1
arch=('x86_64')
url='https://fenicsproject.org'
license=('MIT')
depends=('basix-git' 'boost-libs' 'petsc' 'pugixml' 'hdf5-openmpi' 'adios2' 'scotch' 'parmetis')
makedepends=('git' 'cmake' 'chrpath' 'python-fenics-ffcx-git')
optdepends=()
provides=('dolfinx')
conflicts=('dolfinx')
source=("git+https://github.com/FEniCS/dolfinx")
sha512sums=('SKIP')

pkgver()  {
    cd "$srcdir/dolfinx"
    # The main repo unfortunately has no meaningful tags..
    printf "%s_r%s.%s" "$(sed -n -e 's/^version *= \"*\(.*\)\"/\1/p' python/pyproject.toml)" \
        "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
    git -C "${srcdir}/dolfinx" clean -dfx
}

build() {
    cd "$srcdir/dolfinx"
    source /etc/profile.d/petsc.sh

    # Build c++ library
    cmake -DCMAKE_BUILD_TYPE="Release" \
        -S cpp \
        -B build \
        -DBUILD_SHARED_LIBS=TRUE \
        -DCMAKE_CXX_STANDARD=20 \
        -DCMAKE_C_COMPILER=gcc \
        -DCMAKE_CXX_COMPILER=g++ \
        -DDOLFINX_ENABLE_ADIOS2=ON \
        -DDOLFINX_ENABLE_PARMETIS=ON \
        -DDOLFINX_ENABLE_SCOTCH=ON \
        -DDOLFINX_ENABLE_SLEPC=OFF \
        -DDOLFINX_ENABLE_KAHIP=OFF \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -Wno-dev
    cmake --build build
}

package() {
    cd "$srcdir/dolfinx"
    DESTDIR="$pkgdir" cmake --install build
    install -Dm644 COPYING "$pkgdir/usr/share/licenses/dolfinx-git/LICENSE"

    # Remove insecure runpath
    chrpath --delete "$pkgdir/usr/lib/libdolfinx.so"
}