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
|
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Michel Zou <xantares09@hotmail.com>
_base=FMPy
pkgname=python-${_base,,}
_gitcommit=1a1cc37d15ad866cf85c6116fc7c520c11702521
pkgver=0.3.29
pkgrel=1
pkgdesc="Simulate Functional Mockup Units (FMUs) in Python"
url="https://github.com/CATIA-Systems/${_base}"
arch=(x86_64)
license=(BSD-2-Clause)
depends=(python-attrs python-jinja python-lark-parser python-lxml python-msgpack python-numpy jupyter-nbformat sundials) # rpclib
makedepends=(python-build python-installer python-hatchling python-wheel python-requests cmake git python-toml)
checkdepends=(python-pytest python-dask python-scipy python-plotly)
optdepends=('python-matplotlib: for plot results'
'python-kaleido: for SVG export'
'jupyter-notebook: for simulate the FMU in jupyter'
'python-plotly: for plot results'
'python-dash-bootstrap-components: for webapp support'
'python-pyqtgraph: for graphical user interface') # python-pyqt6 python-pyqt6-webengine
source=(git+${url}.git#commit=${_gitcommit}
git+https://github.com/ludocode/mpack.git
git+https://github.com/modelica/Reference-FMUs.git)
sha512sums=('f0d3fba70da87ce8b6beff670a9d2d9f8e3f6844b7849fc06b95d1096d07c79fb9a4b306b8112adaeb0913292b0577d05f707146c44475301e63e004d4a6b2fd'
'SKIP'
'SKIP')
prepare() {
cd ${_base}
git submodule init
git config submodule.libs/thirdparty/mpack.url "${srcdir}/mpack"
git config submodule.libs/thirdparty/Reference-FMUs.url "${srcdir}/Reference-FMUs"
git -c protocol.file.allow=always submodule update
# sed -i "s/\['cmake'/\['cmake', '-DCMAKE_CXX_FLAGS=\"-Wno-format-security\"'/" build_binaries.py
# sed -i "32 a \ \ \ \ \ \ \ \ '-D', 'CMAKE_CXX_FLAGS="-Wno-format-security"'," build_binaries.py
# sed -i "s/^ fprintf/ fputs/" src/modelica/ModelicaFMI.c
# sed -i "s/ printf/ fputs/" src/modelica/ModelicaUtilities.c
# sed -i "s/library_dir, _ = os.path.split(__file__)/library_dir = '\/usr\/lib'/" ${_base}/${_base,,}/sundials/libraries.py
# sed -i "s/, platform_tuple//" ${_base}/${_base,,}/sundials/libraries.py
# sed -i "s/'s/'libs/" ${_base}/${_base,,}/sundials/libraries.py
# sed -i '/if major/,+1 s/^/#/' ${_base}/${_base,,}/sundials/__init__.py
}
build() {
cd ${_base}/native
PYTHONPATH=$PWD/../src python download_binaries.py
# PYTHONPATH=$PWD/../src python build_cvode.py build_binaries.py
cd ${srcdir}/${_base}
python -m build --wheel --skip-dependency-check --no-isolation
}
# check() {
# cd ${_base}
# python -m venv --system-site-packages test-env
# test-env/bin/python -m installer dist/*.whl
# PATH="${srcdir}/${_base}/test-env/bin:$PATH"
# test-env/bin/python -m pytest tests \
# -k 'not cmake and not simulate and not cswrapper and not create_juypter_notebook' \
# --ignore=tests/test_fmu_container.py
# }
package() {
cd ${_base}
PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
rm -rf ${pkgdir}${site_packages}/${_base,,}/sundials/x86_64-darwin/
rm -rf ${pkgdir}${site_packages}/${_base,,}/sundials/x86_64-windows/
rm -rf ${pkgdir}${site_packages}/${_base,,}/sundials/x86_64-linux/
}
|