summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 180f536bacc2809f99a0c01cd68438b1cadfab5c (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
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Filip GraliƄski <filipg@amu.edu.pl>

pkgname=fairseq
pkgver=0.12.2
pkgrel=1
pkgdesc="Sequence modeling toolkit"
arch=('x86_64')
url="https://github.com/facebookresearch/fairseq"
license=('MIT')
depends=(
	'python>=3.6'
	'python-bitarray'
	'python-cffi'
	'python-hydra-core'
	'python-numpy'
	'python-omegaconf'
	'python-pytorch'
	'python-regex'
	'python-sacrebleu'
	'python-tqdm'
	'python-torchaudio')
optdepends=(
	'cuda: Model training'
	'nccl: Model training'
	'python-apex: Faster training')
makedepends=(
	'cython'
	'python-build'
	'python-installer'
	'python-setuptools'
	'python-wheel')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('b5bb076f8b0d5b06a897b11627da278816752b2202650c34becd8f4240f86961')

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

package() {
	cd "$pkgname-$pkgver"
	PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir" dist/*.whl
	local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	ln -s "$_site/$pkgname-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}