summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 221004f60d37f62626b1fdf959f74a2891ea202b (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
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Torleif Skår <torleif.skaar AT gmail DOT com>
_name="scikit-misc"
pkgname="python-${_name}"
pkgver=0.4.0
pkgrel=1
pkgdesc="Miscellaenous tools for scientific computing"
arch=('x86_64')
url="https://github.com/has2k1/${_name}"
license=('BSD-3-Clause')
depends=(
  "python>=3.10"
  "python-numpy>=2.0.0"
  "blas-openblas"
)
makedepends=(
  "python-setuptools"
  "python-build"
  "python-installer"
  "python-wheel"
  "python-spin"
  "meson"
  "meson-python"
  "cython"
  "gcc-fortran" # Alternative compilers are also supported
  "git"
)
optdepends=(
  "python-yaml: Better output during compilation"
)
checkdepends=(
  "python-pytest"
)

source=(
  "${_name}-${pkgver}"::"git+${url}#tag=v${pkgver}"
)

sha256sums=(
  '488afbf88dad2b6a72afd8e445c3a607e06e4e740abadf399467f5c943eaa502'
)

_archive="${_name}-${pkgver}"

prepare() {
  cd "${_archive}"
  # Disable coverage during check()
  sed -i -e 's/--cov=skmisc --cov-report=xml//' pyproject.toml
  # Append version info manually
  sed -i "s/ version: .*/ version: '${pkgver}',/" meson.build 
}

build() {
  cd "${_archive}"
  python -m build --wheel --no-isolation
}

check() {
  # Stolen from python-numpy
  local site_packages="$(python -c 'import site; print(site.getsitepackages()[0])')"
  cd "${_archive}"

  python -m installer --destdir="${PWD}/tmp_install" dist/*.whl
  cd "${PWD}/tmp_install"
  PATH="${PWD}/usr/bin:${PATH}" PYTHONPATH="${PWD}/${site_packages}:${PYTHONPATH}" pytest
}

package() {
  cd "${_archive}"
  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -Dm0644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" LICENSE
}

# vim: sw=2 ts=2 et: