summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cac12f3ea6a5896966b07c1330548a9fc21a29e0 (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
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
_base=bezier
pkgname=python-${_base}
pkgver=2023.7.28
pkgrel=2
pkgdesc="Helper for Bézier Curves, Triangles, and Higher Order Objects"
arch=(x86_64)
url="https://github.com/dhermes/${_base}"
license=(Apache-2.0)
depends=(${_base} python-numpy)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest python-scipy python-sympy python-matplotlib python-seaborn)
optdepends=('python-matplotlib: for plot helper support'
  'python-seaborn: for plot helper support'
  'python-scipy: for convex hull support'
  'python-sympy: for symbolic support')
source=(${_base}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz)
sha512sums=('beec5c3c9f903a81f02cb491a6c0abdf5d0ad8fb0b9a19a30403113b68b4eee1968c2a4ed1e1dbd4b90e9b35316865cbc6350a6799251a1b087c333117dc5492')

build() {
  cd ${_base}-${pkgver}
  CFLAGS="-Wno-incompatible-pointer-types"
  BEZIER_IGNORE_VERSION_CHECK=1 \
    BEZIER_INSTALL_PREFIX=/usr \
    TARGET_NATIVE_ARCH=OFF \
    python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd ${_base}-${pkgver}
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest tests/unit
}

package() {
  cd ${_base}-${pkgver}
  PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}