blob: 0a4f44ae40b784e6aefb1e288d3b54b6f8fec7cf (
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: Martin Larralde <martin.larralde@embl.de>
_name=gb-io
_module=gb_io
pkgname=python-${_name}
pkgver=0.3.3
pkgrel=2
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-setuptools' 'python-build' 'python-installer' 'cargo')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_module-$pkgver.tar.gz")
sha256sums=(5c628ba04e690b7bdb72cc4fb65230a169e0d1ca029f5b07ae3bba84f65d5c47)
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 pyver=$(python -c 'import sys; print("{}{}".format(*sys.version_info[:2]))')
local impl=$(python -c 'import platform; print(platform.python_implementation().lower())')
local machine=$(python -c 'import platform; print(platform.machine())')
cd "${srcdir}/${_module}-${pkgver}/build/lib.linux-${machine}-${impl}-${pyver}"
python -c "import ${_module}"
}
package() {
local abitag=$(python -c 'import sys; print(*sys.version_info[:2], sep="")')
local machine=$(python -c 'import platform; print(platform.machine())')
python -m installer --destdir="$pkgdir" "${srcdir}/${_module}-${pkgver}/dist/${_module}-${pkgver}-cp${abitag}-cp${abitag}-linux_${machine}.whl"
install -Dm644 ${srcdir}/${_module}-${pkgver}/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
|