python-pywhispercpp-cuda

LOW
maintainer spinualexandru 0 votes scanned 2026-08-31 00:19:57.373659
View on AUR
Why flagged

The package builds from a legitimate project source with a SKIP'd checksum due to a git source, which is normal for AUR packages; it patches Python detection for build compatibility but does not execute untrusted remote code or install malicious payloads.

Triggered rules

Low AI review downgraded a static finding llm_review

The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The package builds from a legitimate project source with a SKIP'd checksum due to a git source, which is normal for AUR packages; it patches Python detection for build compatibility but does not execute untrusted remote code or install malicious payloads.

1 higher static finding superseded - not the current verdict (shown for transparency)
Medium Recently orphaned & re-adopted orphaned_readopted

This package was orphaned and re-adopted within the last 30 days — a window where ownership transfers can introduce malicious changes.

PKGBUILD

1# Maintainer: goodroot <hyprwhspr@goodroot.ca>
2
3pkgname=python-pywhispercpp-cuda
4pkgver=1.4.0
5pkgrel=11
6pkgdesc="Python bindings for whisper.cpp with CUDA support (NVIDIA GPU)"
7arch=('x86_64')
8url="https://github.com/Absadiki/pywhispercpp"
9license=('MIT')
10options=('!strip')
11depends=(
12 'python'
13 'python-numpy'
14 'python-requests'
15 'python-tqdm'
16 'python-platformdirs'
17 'cuda'
18)
19makedepends=(
20 'cmake'
21 'ninja'
22 'python-build'
23 'python-installer'
24 'python-wheel'
25 'python-setuptools'
26 'python-setuptools-scm'
27 'git'
28 'cuda'
29 'patchelf'
30)
31optdepends=(
32 'python-sounddevice: run pywhispercpp examples that capture audio'
33 'python-webrtcvad: run VAD-based examples'
34 'python-pyqt5: run GUI example'
35)
36provides=('python-pywhispercpp')
37conflicts=('python-pywhispercpp' 'python-pywhispercpp-cpu' 'python-pywhispercpp-rocm')
38source=("git+https://github.com/Absadiki/pywhispercpp.git#commit=4ab96165f84e8eb579077dfc3d0476fa5606affe")
39sha256sums=('SKIP')
40
41prepare() {
42 cd "$srcdir/pywhispercpp"
43 git submodule update --init --recursive
44
45 # Fix CMake Python interpreter detection: use system Python instead of isolated env
46 # The isolated build environment's Python can't be executed by CMake
47 python << 'EOF'
48import re
49_system_python = "/usr/bin/python" # System Python path
50with open("setup.py", "r") as f:
51 content = f.read()
52# Replace sys.executable with system Python path
53content = re.sub(
54 r'f"-DPYTHON_EXECUTABLE=\{sys\.executable\}"',
55 f'f"-DPYTHON_EXECUTABLE={_system_python}"',
56 content
57)
58with open("setup.py", "w") as f:
59 f.write(content)
60EOF
61}
62
63build() {
64 cd "$srcdir/pywhispercpp"
65 # Set CUDA environment variables for GPU acceleration
66 export GGML_CUDA=ON
67 export PATH="/opt/cuda/bin:$PATH"
68 export CUDACXX="${CUDACXX:-/opt/cuda/bin/nvcc}"
69
70 # Detect CUDA version and set architectures accordingly
71 # CUDA 13.0+ only supports 7.5+ (removed Pascal 6.0, Volta 7.0)
72 # CUDA 12.x supports 6.0+ (Pascal through Hopper)
73 local cuda_version
74 cuda_version=$("${CUDACXX:-nvcc}" --version | grep -oP 'release \K[0-9]+\.[0-9]+' | head -1 || echo "13.0")
75 local cuda_major
76 cuda_major=$(echo "$cuda_version" | cut -d. -f1)
77
78 local cuda_archs
79 if [ "$cuda_major" -ge 13 ]; then
80 # CUDA 13.0+: 7.5 (Turing), 8.0 (Ampere), 8.6 (Ada), 8.9 (Blackwell), 9.0 (Hopper)
81 cuda_archs="75;80;86;89;90"
82 else
83 # CUDA 12.x and earlier: include older architectures for compatibility
84 cuda_archs="70;75;80;86;89;90"
85 fi
86
87 # Force CMake to use system Python (patch sets PYTHON_EXECUTABLE, but FindPython still searches PATH)
88 export CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python -DPython3_EXECUTABLE=/usr/bin/python -DCMAKE_CUDA_ARCHITECTURES=$cuda_archs"
89 python -m build --wheel
90}
91
92package() {
93 cd "$srcdir/pywhispercpp"
94
95 python -m installer --destdir="$pkgdir" dist/*.whl
96
97
98
99 # Figure out where site-packages landed
100
101 local _python_version
102
103 _python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
104
105 local _site_packages="$pkgdir/usr/lib/python$_python_version/site-packages"
106
107 local _libs_dir="$_site_packages/pywhispercpp.libs"
108
109 local _binary_so="$_site_packages/_pywhispercpp.cpython-*-linux-gnu.so"
110
111
112
113 # 1) Remove bundled libcuda*.so* (we must use system libcuda.so.1)
114
115 if [ -d "$_libs_dir" ]; then
116
117 find "$_libs_dir" -name "libcuda*.so*" -type f ! -name "libcudart*" -delete 2>/dev/null || true
118
119 find "$_site_packages" -maxdepth 1 -name "libcuda*.so*" -type f ! -name "libcudart*" -delete 2>/dev/null || true
120
121 fi
122
123
124
125 # 2) Fix any DT_NEEDED entries that still reference private libcuda-*.so
126
127 local f needed
128
129 for f in $_binary_so "$_libs_dir"/*.so*; do
130
131 [ -f "$f" ] || continue
132
133 for needed in $(patchelf --print-needed "$f" 2>/dev/null || true); do
134
135 case "$needed" in
136
137 libcuda-*.so* )
138
139 echo "Patching $f: replace-needed $needed -> libcuda.so.1"
140
141 patchelf --replace-needed "$needed" "libcuda.so.1" "$f" 2>/dev/null || true
142
143 ;;
144
145 esac
146
147 done
148
149 done
150
151
152
153 # 3) Ensure RPATH includes /usr/lib (optional but harmless)
154
155 for f in $_binary_so; do
156
157 [ -f "$f" ] || continue
158
159 local _current_rpath
160
161 _current_rpath=$(patchelf --print-rpath "$f" 2>/dev/null || echo "")
162
163 if [ -n "$_current_rpath" ]; then
164
165 if [[ "$_current_rpath" != *"/usr/lib"* ]]; then
166
167 patchelf --set-rpath "$_current_rpath:/usr/lib" "$f" 2>/dev/null || true
168
169 fi
170
171 else
172
173 patchelf --set-rpath "/usr/lib" "$f" 2>/dev/null || true
174
175 fi
176
177 done
178
179}
180
181

Scan history

Scanned at (UTC)SeverityRules
2026-08-31 00:19:57 Low 2
2026-08-30 23:44:22 Medium 1
2026-06-18 16:11:54 Clean 0

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion