python-rjieba
LOW
maintainer Smoolak
0 votes
scanned 2026-11-01 18:01:05.785766
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Smoolak <smoolak@gmail.com>
2
3
pkgname=python-rjieba
4
pkgver=0.2.2
5
pkgrel=1
6
pkgdesc="Fast Chinese text segmentation with jieba-rs Python bindings"
7
arch=('x86_64')
8
url="https://github.com/messense/rjieba-py"
9
license=('MIT')
10
_commit=8cc8808dbae251afc50a88f11ba8143283a6c6b1
11
depends=('python' 'gcc-libs' 'glibc')
12
makedepends=('python-installer' 'python-maturin' 'rust')
13
checkdepends=('python-pytest')
14
options=('!lto')
15
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
16
sha256sums=('ed593aeca6208584d0ee60d1b3078ad1614d40b210f0b22191e49eb3698322df')
17
18
prepare() {
19
cd "rjieba-py-$_commit"
20
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
21
}
22
23
build() {
24
cd "rjieba-py-$_commit"
25
maturin build --release --locked --offline --strip
26
}
27
28
check() {
29
cd "rjieba-py-$_commit"
30
python -m venv --system-site-packages --without-pip "$srcdir/check-env"
31
"$srcdir/check-env/bin/python" -m installer target/wheels/*.whl
32
cd "$srcdir"
33
"$srcdir/check-env/bin/python" -m pytest -v \
34
"rjieba-py-$_commit/tests" --junitxml="$srcdir/pytest-results.xml"
35
}
36
37
package() {
38
cd "rjieba-py-$_commit"
39
python -m installer --destdir="$pkgdir" target/wheels/*.whl
40
41
# Keep Maturin's SBOM references reproducible and its RECORD hashes valid.
42
python - "$pkgdir" "$srcdir/rjieba-py-$_commit" "$url/tree/$_commit" <<'PYRECORD'
43
import base64
44
import csv
45
import hashlib
46
from pathlib import Path
47
import sys
48
import sysconfig
49
50
site = Path(sys.argv[1]) / sysconfig.get_path("purelib").lstrip("/")
51
for record in site.glob("*.dist-info/RECORD"):
52
changed = {}
53
for sbom in record.parent.glob("sboms/*.json"):
54
original = sbom.read_text()
55
rewritten = original.replace("path+file://" + sys.argv[2], sys.argv[3])
56
if rewritten == original:
57
continue
58
sbom.write_text(rewritten)
59
data = sbom.read_bytes()
60
digest = base64.urlsafe_b64encode(hashlib.sha256(data).digest()).rstrip(b"=").decode()
61
changed[str(sbom.relative_to(site))] = ["sha256=" + digest, str(len(data))]
62
if changed:
63
with record.open(newline="") as stream:
64
rows = list(csv.reader(stream))
65
for row in rows:
66
if row[0] in changed:
67
row[1:] = changed[row[0]]
68
with record.open("w", newline="") as stream:
69
csv.writer(stream, lineterminator="\n").writerows(rows)
70
PYRECORD
71
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
72
}
73
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-01 18:01:05 | Low | 1 |