123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- # Maintainer: Carlos Aznarán <caznaranl@uni.pe>
- _base=ufl
- pkgname=python-fenics-${_base}
- pkgdesc="UFL - Unified Form Language"
- pkgver=2024.2.0.dev0_r3607.effa67e
- pkgrel=1
- arch=(any)
- url="https://github.com/FEniCS/${_base}"
- license=(MIT)
- depends=("python-numpy" "python-setuptools")
- makedepends=("python-build" "python-installer" "python-wheel")
- checkdepends=("python-cppimport" "python-pytest")
- source=("git+${url}#branch=main")
- sha512sums=('SKIP')
- provides=("python-${_base}")
- conflicts=("python-${_base}" "python-${_base}-git")
- _base_dir="${startdir}"/src/"${_base}"
- prepare() {
- cd "${_base_dir}"/
- git clean -dfx
- }
- pkgver() {
- cd "${_base_dir}"
- for i in pyproject.toml setup.cfg setup.py; do
- # Check if /version/ exists in any of these files
- if [[ -n $(grep 'version.*=' $i) ]]; then
- # Get version by removing " , ', spaces and =
- tag="$(grep -m 1 'version[[:space:]]*=' "${i}" |
- tr -d '", ' | tr -d "'" | cut -d'=' -f2)"
- break;
- fi;
- done
- printf "%s_r%s.%s" \
- ${tag%%.} \
- "$(git rev-list --count HEAD)" \
- "$(git rev-parse --short=7 HEAD)"
- }
- build() {
- cd "${_base_dir}"
- python -m build --wheel --skip-dependency-check --no-isolation
- }
- check() {
- cd "${_base_dir}"
- python -m venv --system-site-packages test-env
- test-env/bin/python -m installer dist/*.whl
- test-env/bin/python -m pytest
- }
- package() {
- cd "${_base_dir}"
- PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl --compile-bytecode 1
- install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
- }
|