summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: db401739780ea890104459e4712972209ece78b3 (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
# Maintainer: Anton Kudelin <kudelin at proton dot me>

_pyname=nmrglue
pkgname=python-$_pyname
pkgver=0.11
pkgrel=1
pkgdesc="A module for working with NMR data in Python"
arch=(any)
url="http://www.nmrglue.com"
license=(BSD-3-Clause)
depends=(python-scipy python-matplotlib python-ipywidgets)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
source=(https://github.com/jjhelmus/nmrglue/releases/download/v$pkgver/$_pyname-$pkgver.tar.gz)
sha256sums=('9e740a02d34ce5df9eb0390274c6a5f37b4837d59139512a3dd169106a8e3fe1')

prepare() {
  cd "$srcdir/$_pyname-$pkgver"
  sed -i 's/recfromtxt/genfromtxt/g' $_pyname/fileio/*.py
}

build() {
  cd "$srcdir/$_pyname-$pkgver"
  python -m build \
    --wheel \
    --no-isolation \
    --skip-dependency-check
}

check() {
  cd "$srcdir/$_pyname-$pkgver"

  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl

  test-env/bin/python -m pytest -v --pyargs nmrglue
}

package() {
  cd "$srcdir/$_pyname-$pkgver"

  python -m installer \
    --destdir="$pkgdir" \
    --compile-bytecode=2 \
    dist/*.whl

  install -Dm755 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}