blob: 478acb7e1608bcf19cc8312791f8301c8989c732 (
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
|
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
pkgname=dumux
_dunever=2.9.0
_tarver=3.9.0
_tar="${_tarver}/${pkgname}-${_tarver}.tar.gz"
pkgver="${_tarver}"
pkgrel=1
pkgdesc="An open-source simulator and research code in modern C++"
arch=(x86_64)
url="https://${pkgname}.org"
license=(GPL-3.0-or-later)
depends=("dune-grid>=${_dunever}" "dune-istl>=${_dunever}" "dune-localfunctions>=${_dunever}")
makedepends=(doxygen graphviz python-scikit-build)
optdepends=('dune-alugrid: for grid manager ALUGrid support'
'dune-foamgrid: for grid manager FoamGrids support'
'dune-functions: for functions spaces support'
'opm-grid: for cornerpoint grid support'
'dune-subgrid: for grid manager SubGrid support'
'dune-spgrid: for grid manager SPGrid support'
'dune-mmesh: for grid manager MMesh support')
source=(https://git.iws.uni-stuttgart.de/${pkgname}-repositories/${pkgname}/-/archive/${_tar})
sha512sums=('35f66dd898568deb0bed8e6a4a455b0233146970ae6eb6f2528ecb613405f331a9614615580ba464455fb96fb45bd93d0a44c7c37c6dca812fc7f4a0f0dc12af')
prepare() {
cd ${pkgname}-${pkgver}
export _pyversion=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
sed -i 's/^Version: '"${pkgver%%.0}"'/Version: '"${pkgver}"'/' dune.module
sed -i 's/"python"/"\/usr\/include\/dumux\/common\/"/' python/dumux/common/properties.py
python -m venv --system-site-packages _skbuild/linux-${CARCH}-${_pyversion}/cmake-build/dune-env
}
build() {
cd ${pkgname}-${pkgver}
XDG_CACHE_HOME="${PWD}" \
python setup.py build \
--build-type=None \
-G 'Unix Makefiles' \
-DBUILD_SHARED_LIBS=TRUE \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_FLAGS='-Wall -fdiagnostics-color=always' \
-DCMAKE_CXX_FLAGS="-O2 -Wall -fdiagnostics-color=always -mavx" \
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
-DALLOW_CXXFLAGS_OVERWRITE=ON \
-DCMAKE_DISABLE_FIND_PACKAGE_LATEX=FALSE \
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=FALSE \
-DENABLE_HEADERCHECK=ON \
-DDUNE_ENABLE_PYTHONBINDINGS=ON \
-DDUNE_PYTHON_INSTALL_LOCATION='none' \
-DDUNE_PYTHON_WHEELHOUSE="dist"
}
package() {
cd ${pkgname}-${pkgver}
PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python setup.py --skip-cmake install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
install -Dm 644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
install -Dm 644 python/${pkgname}/__init__.py -t "${pkgdir}${site_packages}"/${pkgname}
find "${pkgdir}" -type d -empty -delete
}
|