blob: 18646119ad0cd5273cb6c20f5b2ca279ebe87da8 (
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
|
# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>
# Contributor: Filip GraliĆski <filipg@amu.edu.pl>
: ${CARGO_HOME:=$SRCDEST/cargo-home}
: ${CARGO_TARGET_DIR:=target}
: ${RUSTUP_TOOLCHAIN:=stable}
_module="tokenizers"
_pkgname="python-$_module"
pkgname="$_pkgname"
pkgver=0.20.4
pkgrel=1
pkgdesc='Fast State-of-the-Art Tokenizers optimized for Research and Production'
url="https://github.com/huggingface/tokenizers"
license=('Apache-2.0')
arch=('i686' 'x86_64')
depends=('python')
makedepends=(
'clang'
'rust-bindgen'
'python-build'
'python-installer'
'python-maturin'
'python-setuptools-rust'
'python-wheel'
)
options=('!lto')
_pkgsrc="$_module-$pkgver"
_pkgext="tar.gz"
source=("$_pkgsrc.$_pkgext"::"$url/archive/refs/tags/v$pkgver.$_pkgext")
sha256sums=('c7dd77a63d95113add5f4c85a41f117cbf41d2cbc7f6609b72650e14c7f42f31')
_rust_env() {
export CARGO_HOME CARGO_TARGET_DIR RUSTUP_TOOLCHAIN
export GIT_DIR='.'
}
prepare() (
_rust_env
cd "$_pkgsrc/bindings/python"
# fix typo
sed -E -e 's@defaut@default@' -i Cargo.toml
cargo update
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
)
build() (
_rust_env
cd "$_pkgsrc/bindings/python"
cargo build --frozen --release
python -m build --no-isolation --wheel
)
package() {
cd "$_pkgsrc/bindings/python"
python -m installer --destdir="$pkgdir" dist/*.whl
}
|