blob: 886612d5988cbc2f1f21d68be339b1eb1c0b00da (
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
|
# Maintainer: Martin Larralde <martin.larralde@embl.de>
_name=gb-io
_module=gb_io
_minpy=37
pkgname=python-${_name}
pkgver=0.4.0
pkgrel=1
pkgdesc="A Python interface to gb-io, a fast GenBank parser and serializer written in Rust."
url="https://github.com/althonos/gb-io.py"
arch=('any')
license=("MIT")
depends=('python')
makedepends=('python-maturin' 'python-build' 'python-installer' 'cargo')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_module-$pkgver.tar.gz")
sha256sums=(29ecc93467964cd8dd5303756d282ed20f895938c8997aa45e97314c782bcfcd)
prepare() {
cargo fetch --manifest-path "${srcdir}/${_module}-${pkgver}/Cargo.toml" --target "$CARCH-unknown-linux-gnu"
}
build() {
export RUSTUP_TOOLCHAIN=stable
cd "${srcdir}/${_module}-${pkgver}"
python -m build --wheel --no-isolation
}
check() {
local machine=$(python -c 'import platform; print(platform.machine())')
whl="${srcdir}/${_module}-${pkgver}/dist/${_module}-${pkgver}-cp${_minpy}-abi3-linux_${machine}.whl"
rm -rf "${srcdir}/env"
python -m venv --symlinks --system-site-packages "${srcdir}/env"
source "${srcdir}/env/bin/activate"
python -m installer "$whl"
cd "${srcdir}/${_module}-${pkgver}"
python -m unittest discover
deactivate
}
package() {
local machine=$(python -c 'import platform; print(platform.machine())')
whl="${srcdir}/${_module}-${pkgver}/dist/${_module}-${pkgver}-cp${_minpy}-abi3-linux_${machine}.whl"
python -m installer --destdir="$pkgdir" "$whl"
install -Dm644 ${srcdir}/${_module}-${pkgver}/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
|