blob: de1cca67f85da225f27d39709ac828824bf6e3c7 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# Maintainer: Butui Hu <hot123tea123@gmail.com>
pkgname=python-torchtext
_pkgname=text
pkgver=0.18.0
pkgrel=1
epoch=1
pkgdesc='Data loaders and abstractions for text and NLP'
arch=('x86_64')
url='https://github.com/pytorch/text'
license=('BSD-3-Clause')
depends=(
glibc
gcc-libs
python-filelock
python-numpy
python-pytorch
python-requests
python-tqdm
)
optdepends=(
python-nltk
python-revtok
"python-sacremoses: Moses tokenizer port in SacreMoses"
"python-spacy: English tokenizer from SpaCy"
)
makedepends=(
cmake
git
numactl
patchelf
python-build
python-installer
python-setuptools
python-sympy
python-wheel
)
source=("${_pkgname}::git+https://github.com/pytorch/text.git#tag=v${pkgver}"
"0001-add-GLOG_USE_GLOG_EXPORT-definition.patch"
)
sha512sums=('696404634cca1d535a5cf19105e4727fe441e47ecfab7e88fbdf0066abfe69b39103addd148cbca1d74471e89a74a1b6ea6e02e71e06e9cc8d9bac4414d36554'
'8d5faf99d3e82039ebf0daffb1f15e5e6195141a79e1809006d75597bd322bfd6495ae63d4396dbe9ec7a007b0986bf92e66b87cf2f4e062f5732d3675343b5f')
prepare() {
cd "${_pkgname}"
git submodule update --init --recursive
# fix glog issue
patch -p1 -i "${srcdir}/0001-add-GLOG_USE_GLOG_EXPORT-definition.patch"
}
build() {
cd "${_pkgname}"
CMAKE_GENERATOR="Unix Makefiles" \
python -m build --wheel --no-isolation
}
package() {
cd "${_pkgname}"
python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
# fix rpath
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
patchelf --set-rpath '$ORIGIN/lib' "${pkgdir}${site_packages}/torchtext/_torchtext.so"
}
# vim:set ts=2 sw=2 et:
|