Skip to content

Commit 0deb713

Browse files
committed
python3.11-tokenizers: rebuild
1 parent 2cd2913 commit 0deb713

File tree

1 file changed

+12
-7
lines changed
  • tur-pypi-311/python3.11-tokenizers

1 file changed

+12
-7
lines changed

tur-pypi-311/python3.11-tokenizers/build.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://github.com/huggingface/tokenizers
22
TERMUX_PKG_DESCRIPTION="Fast State-of-the-Art Tokenizers optimized for Research and Production"
33
TERMUX_PKG_LICENSE="Apache-2.0"
44
TERMUX_PKG_MAINTAINER="@termux-user-repository"
5-
TERMUX_PKG_VERSION="0.21.0"
5+
TERMUX_PKG_VERSION="0.20.4"
66
TERMUX_PKG_SRCURL=https://github.com/huggingface/tokenizers/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz
7-
TERMUX_PKG_SHA256=841279ad797d575ed3cf31fc4f30e09e37acbd35028d30c51fc0879ef7ed4094
7+
TERMUX_PKG_SHA256=c7dd77a63d95113add5f4c85a41f117cbf41d2cbc7f6609b72650e14c7f42f31
88
TERMUX_PKG_AUTO_UPDATE=true
99
TERMUX_PKG_DEPENDS="libc++, python3.11"
1010
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel"
@@ -56,17 +56,22 @@ termux_step_make_install() {
5656

5757
build-python -m maturin build --release --skip-auditwheel --target $CARGO_BUILD_TARGET -Z build-std
5858

59-
# Fix wheel name for arm
59+
local _pyver="${TERMUX_PYTHON_VERSION/./}"
60+
# Fix wheel name, although it it built with tag `cp39-abi3`, but it is linked against `python3.x.so`
61+
# so it will not work on other pythons.
6062
if [ "$TERMUX_ARCH" = "arm" ]; then
61-
mv ./target/wheels/tokenizers-$TERMUX_PKG_VERSION-cp311-cp311-linux_armv7l.whl \
62-
./target/wheels/tokenizers-$TERMUX_PKG_VERSION-py311-none-any.whl
63+
mv ./target/wheels/tokenizers-$TERMUX_PKG_VERSION-cp39-abi3-linux_armv7l.whl \
64+
./target/wheels/tokenizers-$TERMUX_PKG_VERSION-py$_pyver-none-any.whl
65+
else
66+
mv ./target/wheels/tokenizers-$TERMUX_PKG_VERSION-cp39-abi3-linux_$TERMUX_ARCH.whl \
67+
./target/wheels/tokenizers-$TERMUX_PKG_VERSION-cp$_pyver-cp$_pyver-linux_$TERMUX_ARCH.whl
6368
fi
6469

6570
pip install --no-deps ./target/wheels/*.whl --prefix $TERMUX_PREFIX
6671

6772
# Fix wheel name for arm
6873
if [ "$TERMUX_ARCH" = "arm" ]; then
69-
mv ./target/wheels/tokenizers-$TERMUX_PKG_VERSION-py311-none-any.whl \
70-
./target/wheels/tokenizers-$TERMUX_PKG_VERSION-cp311-cp311-linux_armv7l.whl
74+
mv ./target/wheels/tokenizers-$TERMUX_PKG_VERSION-py$_pyver-none-any.whl \
75+
./target/wheels/tokenizers-$TERMUX_PKG_VERSION-cp$_pyver-cp$_pyver-linux_armv7l.whl
7176
fi
7277
}

0 commit comments

Comments
 (0)