summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3179633f105b5f319b47e9f435daa8250adc95b0 (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: Luis Martinez <luis dot martinez at disroot dot org>

pkgname=python-codon-adaptation-index
pkgver=1.0.2
pkgrel=2
pkgdesc="Implementation of the codon adaptation index"
arch=('any')
url="https://github.com/benjamin-lee/codonadaptationindex"
license=('MIT')
depends=('python-biopython' 'python-click' 'python-scipy')
makedepends=(
	'python-sphinx'
	'python-sphinxcontrib-programoutput'
	'python-setuptools'
	'python-build'
	'python-installer'
	'python-wheel'
	'python-pytest-runner')
checkdepends=('python-pytest')
provides=('python-CAI')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('1ab778e6f9b7a00f0cbaedeb4324609ae78627a2ee19a5c97cd80a964824636e')

prepare() {
	cd "CodonAdaptationIndex-$pkgver"
	sed -i '/use_2to3/d' setup.py
}

build() {
	cd "CodonAdaptationIndex-$pkgver"
	export PYTHONPATH="$PWD"
	python -m build --wheel --no-isolation
	cd docs
	make man
}

check() {
	cd "CodonAdaptationIndex-$pkgver"
	pytest -x --disable-warnings
}

package() {
	export PYTHONHASHSEED=0
	cd "CodonAdaptationIndex-$pkgver"
	python -m installer --destdir="$pkgdir/" dist/*.whl
	install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 paper/paper.{md,bib} -t "$pkgdir/usr/share/doc/$pkgname/"
	install -Dm644 docs/_build/man/cai.1 -t "$pkgdir/usr/share/man/man1/"
}