feat: bundle KneronPLUS wheels in repo for all platforms

Add installer/wheels/{windows,macos,linux}/ with platform-specific
KneronPLUS SDK wheels so any machine can build installers without
needing external wheel files.

- Windows: KneronPLUS v3.1.2 (3.6 MB, with .dll)
- macOS: KneronPLUS v2.0.0 (151 KB, with .dylib)
- Linux: KneronPLUS v2.0.0 (159 KB, with .so)

Updated all build scripts (Makefile, build-installer.ps1,
build-installer-linux.sh) to source wheels from the repo instead
of external directories. Updated installer/app.go to look for
Linux wheels in scripts/linux/ subdirectory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jim800121chen 2026-03-25 19:50:39 +08:00
parent 0c540b5a35
commit d7982554fa
6 changed files with 13 additions and 28 deletions

View File

@ -130,21 +130,19 @@ installer-payload: build-server-tray ## Stage payload files for GUI installer
cp scripts/kneron_detect.py installer/payload/scripts/
cp server/scripts/firmware/KL520/*.bin installer/payload/scripts/firmware/KL520/
cp server/scripts/firmware/KL720/*.bin installer/payload/scripts/firmware/KL720/
@# Copy KneronPLUS wheels if available (Windows from local_service_win, macOS from Downloads)
@if ls ../local_service_win/KneronPLUS*.whl 1>/dev/null 2>&1; then \
cp ../local_service_win/KneronPLUS*.whl installer/payload/scripts/; \
@# Copy KneronPLUS wheels from repo (installer/wheels/{platform}/)
@if ls installer/wheels/windows/KneronPLUS*.whl 1>/dev/null 2>&1; then \
cp installer/wheels/windows/KneronPLUS*.whl installer/payload/scripts/; \
echo " KneronPLUS Windows wheel bundled."; \
fi
@mkdir -p installer/payload/scripts/macos
@MACOS_WHL="$$(find ~/Downloads/KL520Web/package/macos -name 'KneronPLUS*.whl' 2>/dev/null | head -1)"; \
if [ -n "$$MACOS_WHL" ]; then \
cp "$$MACOS_WHL" installer/payload/scripts/macos/; \
@if ls installer/wheels/macos/KneronPLUS*.whl 1>/dev/null 2>&1; then \
cp installer/wheels/macos/KneronPLUS*.whl installer/payload/scripts/macos/; \
echo " KneronPLUS macOS wheel bundled."; \
fi
@mkdir -p installer/payload/scripts/linux
@LINUX_WHL="$$(find ~/Downloads/KL520Web/package/ubuntu -name 'KneronPLUS*.whl' 2>/dev/null | head -1)"; \
if [ -n "$$LINUX_WHL" ]; then \
cp "$$LINUX_WHL" installer/payload/scripts/linux/; \
@if ls installer/wheels/linux/KneronPLUS*.whl 1>/dev/null 2>&1; then \
cp installer/wheels/linux/KneronPLUS*.whl installer/payload/scripts/linux/; \
echo " KneronPLUS Linux wheel bundled."; \
fi
@# Copy WinUSB driver files (for Windows installer)

View File

@ -111,27 +111,14 @@ cp scripts/kneron_detect.py installer/payload/scripts/
cp server/scripts/firmware/KL520/*.bin installer/payload/scripts/firmware/KL520/ 2>/dev/null || true
cp server/scripts/firmware/KL720/*.bin installer/payload/scripts/firmware/KL720/ 2>/dev/null || true
# Copy KneronPLUS wheel if available (Linux-specific)
# Copy KneronPLUS wheel (Linux-specific, from repo)
mkdir -p installer/payload/scripts/linux
kp_wheel=""
# Search order: KL520Web ubuntu package → kneron_plus source zip extract → repo root
for search_dir in \
"$HOME/Downloads/KL520Web/package/ubuntu" \
"$REPO_ROOT/kneron_plus/python/package/ubuntu" \
"$REPO_ROOT"; do
found=$(find "$search_dir" -maxdepth 1 -name 'KneronPLUS*.whl' 2>/dev/null | head -1)
if [ -n "$found" ]; then
kp_wheel="$found"
break
fi
done
kp_wheel=$(find installer/wheels/linux -name 'KneronPLUS*.whl' 2>/dev/null | head -1)
if [ -n "$kp_wheel" ]; then
cp "$kp_wheel" installer/payload/scripts/linux/
info "KneronPLUS wheel bundled: $(basename "$kp_wheel")"
else
warn "KneronPLUS wheel not found, skipping."
warn " Expected in: ~/Downloads/KL520Web/package/ubuntu/"
warn "KneronPLUS wheel not found in installer/wheels/linux/, skipping."
fi
file_count=$(find installer/payload -type f | wc -l)

View File

@ -85,13 +85,13 @@ if (Test-Path $libusbSrc) {
Write-Host " libusb-1.0.dll not found, skipping." -ForegroundColor Yellow
}
# Copy KneronPLUS wheel if available
$kpWheel = Get-ChildItem (Join-Path $repoRoot "local_service_win") -Filter "KneronPLUS*.whl" -ErrorAction SilentlyContinue | Select-Object -First 1
# Copy KneronPLUS wheel from repo
$kpWheel = Get-ChildItem "installer\wheels\windows" -Filter "KneronPLUS*.whl" -ErrorAction SilentlyContinue | Select-Object -First 1
if ($kpWheel) {
Copy-Item $kpWheel.FullName installer\payload\scripts\
Write-Host " $($kpWheel.Name) bundled." -ForegroundColor Green
} else {
Write-Host " KneronPLUS wheel not found, skipping." -ForegroundColor Yellow
Write-Host " KneronPLUS wheel not found in installer\wheels\windows\, skipping." -ForegroundColor Yellow
}
# Copy WinUSB driver files (INF + co-installers)