diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ebcc7c..e7331db 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,6 +64,7 @@ jobs: ./tests/controller.sh ./tests/artifact-helpers.sh ./tests/limine-mkinitcpio-hook.sh + ./tests/voxtype-bin-install.sh pacman -S --noconfirm --quiet rclone >/dev/null ./tests/publish-artifact.sh ' diff --git a/pkgbuilds/voxtype-bin/.omarchy/package.json b/pkgbuilds/voxtype-bin/.omarchy/package.json index 778fbb5..10cfac9 100644 --- a/pkgbuilds/voxtype-bin/.omarchy/package.json +++ b/pkgbuilds/voxtype-bin/.omarchy/package.json @@ -8,6 +8,8 @@ "latest_only": true, "assets": { "x86_64": [ + "voxtype-{pkgver}-linux-x86_64-baseline", + "voxtype-{pkgver}-linux-x86_64-baseline.asc", "voxtype-{pkgver}-linux-x86_64-avx2", "voxtype-{pkgver}-linux-x86_64-avx2.asc", "voxtype-{pkgver}-linux-x86_64-avx512", @@ -66,16 +68,8 @@ "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/README.md", "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/packaging/voxtype-configure.desktop", "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/packaging/scripts/voxtype-configure-launcher", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/shell.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/OsdSurface.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/EnginePicker.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/MeetingControls.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/voxtype-shared/Theme.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/voxtype-shared/StateReader.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/voxtype-shared/AudioBridge.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/voxtype-shared/StyleLoader.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/voxtype-shared/RecipeRenderer.qml", - "https://raw.githubusercontent.com/peteonrails/voxtype/{tag}/quickshell/voxtype-shared/qmldir" + "https://github.com/peteonrails/voxtype/archive/refs/tags/{tag}.tar.gz", + "https://github.com/peteonrails/voxtype/releases/download/{tag}/voxtype-{pkgver}.tar.gz.asc" ] } } diff --git a/pkgbuilds/voxtype-bin/PKGBUILD b/pkgbuilds/voxtype-bin/PKGBUILD index aaea649..c06d09e 100644 --- a/pkgbuilds/voxtype-bin/PKGBUILD +++ b/pkgbuilds/voxtype-bin/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Peter Jackson pkgname=voxtype-bin pkgver=1.1.0 -pkgrel=1 +pkgrel=2 pkgdesc="Push-to-talk voice-to-text for Linux (pre-built binaries)" arch=('x86_64' 'aarch64') url="https://voxtype.io" @@ -21,14 +21,20 @@ optdepends=( 'pipewire: audio server (recommended)' 'pipewire-alsa: ALSA compatibility for PipeWire (required if using PipeWire)' 'pulseaudio: audio server (alternative to PipeWire)' + 'ollama: local AI summarization for meeting mode' + 'gtk4-layer-shell: runtime for the GTK4 on-screen mic visualizer (voxtype-osd-gtk4)' + 'quickshell: Quickshell-based OSD frontend (opt in via [osd] frontend = "quickshell")' +) +# makepkg appends optdepends_$CARCH to optdepends, so accelerator runtimes +# live here: aarch64 has no GPU or OpenVINO build that could use them. +optdepends_x86_64=( 'vulkan-icd-loader: GPU acceleration via Vulkan for Whisper (enable with: voxtype setup gpu --enable)' 'cuda: GPU acceleration via CUDA 13 for ONNX engines (NVIDIA GPUs, requires driver 580+)' 'cuda12.6: GPU acceleration via CUDA 12 for ONNX engines (older NVIDIA setups)' 'rocm-hip-runtime: ROCm runtime (required by migraphx)' 'migraphx: AMD GPU graph optimization for the MIGraphX execution provider — required for AMD GPU acceleration on ONNX engines' - 'ollama: local AI summarization for meeting mode' - 'gtk4-layer-shell: runtime for the GTK4 on-screen mic visualizer (voxtype-osd-gtk4)' - 'quickshell: Quickshell-based OSD frontend (opt in via [osd] frontend = "quickshell")' + 'openvino-genai: OpenVINO GenAI C runtime for the OpenVINO Whisper engine' + 'openvino-intel-npu-plugin: Intel NPU acceleration for the OpenVINO Whisper engine' ) provides=('voxtype') conflicts=('voxtype') @@ -47,8 +53,53 @@ validpgpkeys=( '9CCF7915B750CAE8B095ED1AA3FC9F33FD209279' ) _github="https://github.com/peteonrails/voxtype/releases/download/v$pkgver" + +# Architecture-independent files: config, service unit, shell completions, +# license, docs, desktop entry + launcher, and the signed source archive +# (Quickshell QML tree + OSD style/recipe examples, identical on every arch). +source=( + "config-$pkgver.toml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/config/default.toml" + "voxtype-$pkgver.service::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/systemd/voxtype.service" + "voxtype-$pkgver.bash::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/completions/voxtype.bash" + "voxtype-$pkgver.zsh::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/completions/voxtype.zsh" + "voxtype-$pkgver.fish::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/completions/voxtype.fish" + "LICENSE-$pkgver::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/LICENSE" + "README-$pkgver.md::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/README.md" + # Desktop entry + terminal launcher for `voxtype configure` (TUI surfaced in walker/rofi/etc.) + "voxtype-configure-$pkgver.desktop::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/voxtype-configure.desktop" + "voxtype-configure-launcher-$pkgver::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/scripts/voxtype-configure-launcher" + # Quickshell QML tree, copied wholesale from the signed source archive. + # Hand-listing individual QML files here is how #488, #697, and #762 + # happened: scripts/package.sh tars the whole quickshell/ directory, so + # deb and rpm never drifted, while this PKGBUILD's enumeration silently + # fell behind three times. The auto-generated GitHub archive is signed + # byte-for-byte by CI (see the #415 post-mortem above), so we verify it + # like every binary. + "voxtype-$pkgver.tar.gz::https://github.com/peteonrails/voxtype/archive/refs/tags/v$pkgver.tar.gz" + "voxtype-$pkgver.tar.gz.asc::$_github/voxtype-$pkgver.tar.gz.asc" +) +sha256sums=( + 'f4b2bccd56b31a6a50e1c0a8b6b72383dc1e636f9ccb8cb070442d58b7314579' # config/default.toml + '531c3658e229619e56bb01659fb81f401767b85e1d6e2acd1ac67ee3414a168c' # voxtype.service + '65c95805d9b03ccc2fadb9d63a03ab79974b00091df8457ee8ef290ec6bd5b12' # voxtype.bash + 'e5e63b3c7f48238cf719e4f2ef90c1f9c5c7e8cd25eaebc9f78bdd34b24b6605' # voxtype.zsh + 'f720ddd24ee97c105b448323899c36bca7c63d00c2d42c4a3da70c3d157dccbb' # voxtype.fish + '31123c45b4ff9cb5fd9e01083350fea6ccaf14969013fd48e4c95fdf89e6eb4b' # LICENSE + 'b06ee68e1305174a4f66876750f62d4048d0ebee48e15ee525961a54115ff80d' # README.md + '32144a4a5210092b0aa909f6de7a43ebe8bbf82fa3dfb1f3519787512fdf8e4b' # voxtype-configure.desktop + '044b1f7b52cc610ce57ba624111d882029b0ce4bc3e2c2c360f96d07f69e0e85' # voxtype-configure-launcher + '7d223f1ebee3c3ded8619fb17d20ab43f5a4d7c5f7264890750c176078542a32' # voxtype-$pkgver.tar.gz (source archive) + 'SKIP' # voxtype-$pkgver.tar.gz.asc +) + +# x86_64: full binary set (baseline / AVX2 / AVX-512 / Vulkan Whisper, +# ONNX AVX2 / AVX-512 / CUDA-12 / CUDA-13 / MIGraphX, plus the x86_64 OSD +# binaries and audio-bridge sidecar). source_x86_64=( # Whisper binaries + # baseline: x86-64-v2, for pre-AVX2 CPUs (#612). New in 1.1.0. + "voxtype-$pkgver-baseline::$_github/voxtype-$pkgver-linux-x86_64-baseline" + "voxtype-$pkgver-baseline.asc::$_github/voxtype-$pkgver-linux-x86_64-baseline.asc" "voxtype-$pkgver-avx2::$_github/voxtype-$pkgver-linux-x86_64-avx2" "voxtype-$pkgver-avx2.asc::$_github/voxtype-$pkgver-linux-x86_64-avx2.asc" "voxtype-$pkgver-avx512::$_github/voxtype-$pkgver-linux-x86_64-avx512" @@ -90,7 +141,7 @@ source_x86_64=( # Quickshell OSD frontend launcher + audio-bridge sidecar (new in v0.7.5). # voxtype-osd-quickshell resolves /proc/self/exe and probes its parent dir # plus /usr/share/voxtype/quickshell/ for shell.qml, so the QML files - # shipped further below sit on the lookup path without PATH gymnastics. + # shipped further above sit on the lookup path without PATH gymnastics. # voxtype-audio-bridge is the NDJSON sidecar that streams audio levels # to the Quickshell frontend over a UNIX socket. "voxtype-$pkgver-osd-quickshell::$_github/voxtype-$pkgver-linux-x86_64-osd-quickshell" @@ -98,6 +149,58 @@ source_x86_64=( "voxtype-$pkgver-audio-bridge::$_github/voxtype-$pkgver-linux-x86_64-audio-bridge" "voxtype-$pkgver-audio-bridge.asc::$_github/voxtype-$pkgver-linux-x86_64-audio-bridge.asc" ) +sha256sums_x86_64=( + # Whisper binaries + '1c9d78b4f6805e4f12ba3670949d3c22788269bdbc54215afffa42cafd0b4a7a' # voxtype-baseline + 'SKIP' # voxtype-baseline.asc + 'e7d5de68cc8fc610c3c961c47f879451db9bee4a2df152e9a66f1078072e7f28' # voxtype-avx2 + 'SKIP' # voxtype-avx2.asc + 'bb2da45c7676bc128da998da928cb239ab6eef9fe53c31c9b4a77e819e521715' # voxtype-avx512 + 'SKIP' # voxtype-avx512.asc + 'db2c7938392ff08ec8b50b8afb90f8bd3d0111eccf5943df2f51c40a0368fec2' # voxtype-vulkan + 'SKIP' # voxtype-vulkan.asc + # ONNX CPU binaries + '07ee9863f1d611ee3fc638f9ba766f3bd38783b9a97b276d7eceb9b995a7167b' # voxtype-onnx-avx2 + 'SKIP' # voxtype-onnx-avx2.asc + 'b3fabe0fa67452aaa76ccf3f84cd71a3c23d27354c840128c396690cb3a1c9a6' # voxtype-onnx-avx512 + 'SKIP' # voxtype-onnx-avx512.asc + # ONNX CUDA 12 binary + companion .so + '171869a953b0d85cb36b54c5cb0c64013051317bff2a1afe09297caf67967d01' # voxtype-onnx-cuda-12 + 'SKIP' # voxtype-onnx-cuda-12.asc + 'a8584727d51ba646ac63fc991c2f36ad6cd5b8cc8b1141896e46938700b888d0' # cuda-12.libonnxruntime_providers_cuda.so + '1b028afc079628d76a28d7eb09700a4baead4a27f9634ba82c35398486134114' # cuda-12.libonnxruntime_providers_shared.so + # ONNX CUDA 13 binary + companion .so + dlopen-target libonnxruntime + '06e74651565ed63ab20e8eedd7380ceb658558125d97dfde2bb5eafeeac82c7d' # voxtype-onnx-cuda-13 + 'SKIP' # voxtype-onnx-cuda-13.asc + 'b6cb7744d0efd2faced5c83ead374c13e7f2630b5a249ffaf393cdb1e092c92b' # cuda-13.libonnxruntime_providers_cuda.so + 'c6a12593396095f5670160e284c35d1700b7708cf3037b7042e2a5200ccae772' # cuda-13.libonnxruntime_providers_shared.so + '1aacefdf0b4afa145d410b2381bbc3db3d978c485fb182c42a2b0b09f91f5310' # cuda-13.libonnxruntime.so.1.24.4 + # ONNX MIGraphX binary + companion .so + '4085f24c336ffb0862f9d1022f9d5acafcc4278a5bcd3fd45e6d89692f71d301' # voxtype-onnx-migraphx + 'SKIP' # voxtype-onnx-migraphx.asc + 'ddd67e6193ade819ee21f1706d1b03b9151f1d2d2843701e2d19d8b183631707' # migraphx.libonnxruntime_providers_migraphx.so + '17f7cf47ad0d7b5ac895ae588fd62c7f85a13842588161b6a24c7d480f062be4' # migraphx.libonnxruntime_providers_shared.so + # OSD launcher + GTK4 frontend + '0c9ac447bc236728f355d25b7c500afd464186a4591ccc18f482fcc98b16a928' # voxtype-osd + 'SKIP' # voxtype-osd.asc + '19535f63c69748408199f3fbfe2bb2f786f5bf4faa54d5390895eecae4603dc7' # voxtype-osd-gtk4 + 'SKIP' # voxtype-osd-gtk4.asc + # Quickshell OSD launcher + audio-bridge sidecar + 'b9dc8eca049f21e2507511700108d57ce5704350e5828418753ef9989f86eb08' # voxtype-osd-quickshell + 'SKIP' # voxtype-osd-quickshell.asc + '36333a15e27d13d9988045179582f0daecadc630e3ec01bb0996ab798cb77487' # voxtype-audio-bridge + 'SKIP' # voxtype-audio-bridge.asc +) + +# aarch64: one generic CPU Whisper binary and one generic ONNX binary — no +# AVX2/AVX-512 split exists on this architecture, and no GPU-accelerated +# variant ships yet (#547 tracks it; no mainstream consumer arm64 Vulkan +# hardware to build/test against). Experimental until validated on real +# Pi/Ampere/Graviton/Snapdragon X hardware by external users — see the +# "Experimental aarch64 variants" comment in .github/workflows/build-linux.yml. +# voxtype-bin.install's _set_default_backend()/_set_onnx_cuda_symlink() +# already special-case `uname -m = aarch64`; this just ships the binaries +# those functions expect at /usr/lib/voxtype/voxtype-cpu and voxtype-onnx. source_aarch64=( "voxtype-$pkgver-cpu::$_github/voxtype-$pkgver-linux-aarch64-cpu" "voxtype-$pkgver-cpu.asc::$_github/voxtype-$pkgver-linux-aarch64-cpu.asc" @@ -112,110 +215,31 @@ source_aarch64=( "voxtype-$pkgver-audio-bridge::$_github/voxtype-$pkgver-linux-aarch64-audio-bridge" "voxtype-$pkgver-audio-bridge.asc::$_github/voxtype-$pkgver-linux-aarch64-audio-bridge.asc" ) -source=( - # Architecture-independent config and support files - "config-$pkgver.toml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/config/default.toml" - "voxtype-$pkgver.service::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/systemd/voxtype.service" - "voxtype-$pkgver.bash::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/completions/voxtype.bash" - "voxtype-$pkgver.zsh::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/completions/voxtype.zsh" - "voxtype-$pkgver.fish::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/completions/voxtype.fish" - "LICENSE-$pkgver::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/LICENSE" - "README-$pkgver.md::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/README.md" - # Desktop entry + terminal launcher for `voxtype configure` (TUI surfaced in walker/rofi/etc.) - "voxtype-configure-$pkgver.desktop::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/voxtype-configure.desktop" - "voxtype-configure-launcher-$pkgver::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/packaging/scripts/voxtype-configure-launcher" - # Quickshell QML tree (new in v0.7.5). voxtype-osd-quickshell probes - # /usr/share/voxtype/quickshell/ for shell.qml after the user/runtime - # paths, so shipping these files lets users opt in via - # [osd] frontend = "quickshell" with no manual file copies. The - # voxtype-shared/ subdirectory contains a QML module (Theme, StateReader, - # AudioBridge) registered via qmldir — keep the layout intact. - "quickshell-shell-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/shell.qml" - "quickshell-OsdSurface-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/OsdSurface.qml" - "quickshell-EnginePicker-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/EnginePicker.qml" - "quickshell-MeetingControls-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/MeetingControls.qml" - "quickshell-voxtype-shared-Theme-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/voxtype-shared/Theme.qml" - "quickshell-voxtype-shared-StateReader-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/voxtype-shared/StateReader.qml" - "quickshell-voxtype-shared-AudioBridge-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/voxtype-shared/AudioBridge.qml" - "quickshell-voxtype-shared-StyleLoader-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/voxtype-shared/StyleLoader.qml" - "quickshell-voxtype-shared-RecipeRenderer-$pkgver.qml::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/voxtype-shared/RecipeRenderer.qml" - "quickshell-voxtype-shared-qmldir-$pkgver::https://raw.githubusercontent.com/peteonrails/voxtype/v$pkgver/quickshell/voxtype-shared/qmldir" -) -sha256sums_x86_64=( - 'e7d5de68cc8fc610c3c961c47f879451db9bee4a2df152e9a66f1078072e7f28' - 'fdf2c35826ea7590a703993c5bdf69804672a5a0c76312e66bc4f14399d8f2ce' - 'bb2da45c7676bc128da998da928cb239ab6eef9fe53c31c9b4a77e819e521715' - 'd6158e18ac2446a2ae79b2ae23ed9744c6579eeabfa567b5c3db0a2575f95ac9' - 'db2c7938392ff08ec8b50b8afb90f8bd3d0111eccf5943df2f51c40a0368fec2' - '2b6b6afbaecd0c8adff536db4c5e0ea50b8781ad6f2643344e96c8cba2ea672a' - '07ee9863f1d611ee3fc638f9ba766f3bd38783b9a97b276d7eceb9b995a7167b' - 'b5e15277f49f52ffd99bb0cc3ef91548841d83ed3787a3ff7809d4fba596327e' - 'b3fabe0fa67452aaa76ccf3f84cd71a3c23d27354c840128c396690cb3a1c9a6' - 'b2da321a562d7de459881be305626a1f68942786939c534360757efe686802e7' - '171869a953b0d85cb36b54c5cb0c64013051317bff2a1afe09297caf67967d01' - '24df2a2e1f1505c5ea3118ad354770f4ff1106a82b63e63fb62f3bf5e07fb448' - 'a8584727d51ba646ac63fc991c2f36ad6cd5b8cc8b1141896e46938700b888d0' - '1b028afc079628d76a28d7eb09700a4baead4a27f9634ba82c35398486134114' - '06e74651565ed63ab20e8eedd7380ceb658558125d97dfde2bb5eafeeac82c7d' - '050438373390c779967a23ec4acbcd701cf3ac7e6ae9746c4eb06d999a44f810' - 'b6cb7744d0efd2faced5c83ead374c13e7f2630b5a249ffaf393cdb1e092c92b' - 'c6a12593396095f5670160e284c35d1700b7708cf3037b7042e2a5200ccae772' - '1aacefdf0b4afa145d410b2381bbc3db3d978c485fb182c42a2b0b09f91f5310' - '4085f24c336ffb0862f9d1022f9d5acafcc4278a5bcd3fd45e6d89692f71d301' - '3c8d3eb1ad6db8881c59b3d25a317ea4bbadedab4388811b085920c21321d654' - 'ddd67e6193ade819ee21f1706d1b03b9151f1d2d2843701e2d19d8b183631707' - '17f7cf47ad0d7b5ac895ae588fd62c7f85a13842588161b6a24c7d480f062be4' - '0c9ac447bc236728f355d25b7c500afd464186a4591ccc18f482fcc98b16a928' - '5844758469bd89b56c864e4934b783870cf0118b3b06d0fc9af9f3f348f85af6' - '19535f63c69748408199f3fbfe2bb2f786f5bf4faa54d5390895eecae4603dc7' - '3757b039b9a09c53b54c81e518222a1e44b4e50ba100084c6ab088aea31f7070' - 'b9dc8eca049f21e2507511700108d57ce5704350e5828418753ef9989f86eb08' - '57e6e3c8de2307d17c1c45b498e2c92eec77cdefa818ab28aa0abfcd476e15fc' - '36333a15e27d13d9988045179582f0daecadc630e3ec01bb0996ab798cb77487' - 'cf48b19667ea235460d9e7391a04e57b2bc2b9e361eef380196a2c51693fde81' -) sha256sums_aarch64=( - '2fcf0945d424a116c1947ea738da1afa9f83abbae66cebb53f06189111a6f392' - '13c78d392751957631645c45668dca5b798b648e6cefb5dbb33e25ba80e713bf' - '49ecde9a394492c9a34e764911d98258c495ed2f0ced386e6974bccf3f9f164f' - '0b5f1e64e16086a68f9ac4f5be06e9c0937bd328eab6f257a2894bbb616a2081' - '34d83a7edb73ae2e15dabc0638d39f2c30ddb3af8f2565400ff043ef6558dc2b' - '9c86d7e11e60e143e68a398b8b3f25ebeaf3225478e3ceb15f84970df5dd76b4' - '4d730a6677342158c1861bfb73f1cb86da05afeb74fdf737134df5c8ad9a1eb1' - '00a3bd82bd457b6b43bf832c2342a4ee99bed3eb38c70e8e156052a9a46bc7c6' - '365c1b5223329604001fe591398d3c308120048567c7f3171d2602005661d594' - '2d0a8b55ba20efbb9c273b03ec042d434d6336fdc8bc822363e8b0f128dfa425' - '39c4a186ac8a95f7236cfdd46255207f143f76363a5f758eb127509b163d5172' - 'f2348ab4b25e19a75f5442355c2ae7e250779814a524f09a41a59237aa495430' -) -sha256sums=( - 'f4b2bccd56b31a6a50e1c0a8b6b72383dc1e636f9ccb8cb070442d58b7314579' - '531c3658e229619e56bb01659fb81f401767b85e1d6e2acd1ac67ee3414a168c' - '65c95805d9b03ccc2fadb9d63a03ab79974b00091df8457ee8ef290ec6bd5b12' - 'e5e63b3c7f48238cf719e4f2ef90c1f9c5c7e8cd25eaebc9f78bdd34b24b6605' - 'f720ddd24ee97c105b448323899c36bca7c63d00c2d42c4a3da70c3d157dccbb' - '31123c45b4ff9cb5fd9e01083350fea6ccaf14969013fd48e4c95fdf89e6eb4b' - 'b06ee68e1305174a4f66876750f62d4048d0ebee48e15ee525961a54115ff80d' - '32144a4a5210092b0aa909f6de7a43ebe8bbf82fa3dfb1f3519787512fdf8e4b' - '044b1f7b52cc610ce57ba624111d882029b0ce4bc3e2c2c360f96d07f69e0e85' - 'd3d0b0b24a3fc3e252623a6fad898c7d1d147fb8c2e49de90fbf452e95de63ab' - '70a611fd4eabde43189aee0619899827de21e36695191648dc36470d4c333de6' - '4d6eef505ec161080ca92ae6a355ca00dcc7bb05d5b190534a1851fcbb726e55' - '54271a8f0e4b52f40505f32801f4c78399ac356ed1e80906ca8a068ecb7ee734' - 'aaa011682b92d8e25863a9ea34a469b897bac15ad939292d8144b012fa05b209' - '74345f9d8b77de3f1d6d08a759e52506c606e8af3d04a97a5bfe7954d0f64604' - '2ad530f92f13fc7f1100e6f6c9910878c35d911e91dc60feb902c2542b619230' - '45180488129f16a0568c217c743ce7e45831acb0cb287346d6da5b2fc097717b' - 'd5e9a86946dc8dc2afabdcd00d79d973181e51b2e5e8aea2772960aaf1ff2283' - '41b894baa1487e47db5f9ec4baeea9c02b6a76d3c8198b4700a88e2cb7ec0b62' + '2fcf0945d424a116c1947ea738da1afa9f83abbae66cebb53f06189111a6f392' # voxtype-cpu + 'SKIP' # voxtype-cpu.asc + '49ecde9a394492c9a34e764911d98258c495ed2f0ced386e6974bccf3f9f164f' # voxtype-onnx + 'SKIP' # voxtype-onnx.asc + '34d83a7edb73ae2e15dabc0638d39f2c30ddb3af8f2565400ff043ef6558dc2b' # voxtype-osd + 'SKIP' # voxtype-osd.asc + '4d730a6677342158c1861bfb73f1cb86da05afeb74fdf737134df5c8ad9a1eb1' # voxtype-osd-gtk4 + 'SKIP' # voxtype-osd-gtk4.asc + '365c1b5223329604001fe591398d3c308120048567c7f3171d2602005661d594' # voxtype-osd-quickshell + 'SKIP' # voxtype-osd-quickshell.asc + '39c4a186ac8a95f7236cfdd46255207f143f76363a5f758eb127509b163d5172' # voxtype-audio-bridge + 'SKIP' # voxtype-audio-bridge.asc ) package() { - if [[ "$CARCH" == aarch64 ]]; then + if [ "$CARCH" = "aarch64" ]; then + # One generic CPU Whisper binary, one generic ONNX binary — matches + # what voxtype-bin.install's _set_default_backend() installs + # unconditionally on this arch (no AVX2/AVX-512 split, no GPU EP). install -Dm755 "$srcdir/voxtype-$pkgver-cpu" "$pkgdir/usr/lib/voxtype/voxtype-cpu" install -Dm755 "$srcdir/voxtype-$pkgver-onnx" "$pkgdir/usr/lib/voxtype/voxtype-onnx" else # Install Whisper CPU binaries to /usr/lib/voxtype/ + install -Dm755 "$srcdir/voxtype-$pkgver-baseline" "$pkgdir/usr/lib/voxtype/voxtype-baseline" install -Dm755 "$srcdir/voxtype-$pkgver-avx2" "$pkgdir/usr/lib/voxtype/voxtype-avx2" install -Dm755 "$srcdir/voxtype-$pkgver-avx512" "$pkgdir/usr/lib/voxtype/voxtype-avx512" @@ -226,60 +250,61 @@ package() { install -Dm755 "$srcdir/voxtype-$pkgver-onnx-avx2" "$pkgdir/usr/lib/voxtype/voxtype-onnx-avx2" install -Dm755 "$srcdir/voxtype-$pkgver-onnx-avx512" "$pkgdir/usr/lib/voxtype/voxtype-onnx-avx512" - # GPU-using ONNX binaries each live in their own subdirectory alongside - # the EP companion shared libs they dlopen at runtime. ort 2.0.0-rc.12's - # CUDA/MIGraphX EPs resolve their .so files via /proc/self/exe; if they - # aren't co-located, EP registration fails and ort silently falls back - # to CPU. /proc/self/exe follows symlinks, so the user-facing names at - # /usr/lib/voxtype/voxtype-onnx-* are symlinks into these subdirs. + # GPU-using ONNX binaries each live in their own subdirectory alongside + # the EP companion shared libs they dlopen at runtime. ort 2.0.0-rc.12's + # CUDA/MIGraphX EPs resolve their .so files via /proc/self/exe; if they + # aren't co-located, EP registration fails and ort silently falls back + # to CPU. /proc/self/exe follows symlinks, so the user-facing names at + # /usr/lib/voxtype/voxtype-onnx-* are symlinks into these subdirs. - # ONNX CUDA 12 (locked to libcudart.so.12 ABI) - install -Dm755 "$srcdir/voxtype-$pkgver-onnx-cuda-12" \ - "$pkgdir/usr/lib/voxtype/cuda-12/voxtype-onnx-cuda-12" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-12.libonnxruntime_providers_cuda.so" \ - "$pkgdir/usr/lib/voxtype/cuda-12/libonnxruntime_providers_cuda.so" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-12.libonnxruntime_providers_shared.so" \ - "$pkgdir/usr/lib/voxtype/cuda-12/libonnxruntime_providers_shared.so" - ln -sf "cuda-12/voxtype-onnx-cuda-12" \ - "$pkgdir/usr/lib/voxtype/voxtype-onnx-cuda-12" + # ONNX CUDA 12 (locked to libcudart.so.12 ABI) + install -Dm755 "$srcdir/voxtype-$pkgver-onnx-cuda-12" \ + "$pkgdir/usr/lib/voxtype/cuda-12/voxtype-onnx-cuda-12" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-12.libonnxruntime_providers_cuda.so" \ + "$pkgdir/usr/lib/voxtype/cuda-12/libonnxruntime_providers_cuda.so" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-12.libonnxruntime_providers_shared.so" \ + "$pkgdir/usr/lib/voxtype/cuda-12/libonnxruntime_providers_shared.so" + ln -sf "cuda-12/voxtype-onnx-cuda-12" \ + "$pkgdir/usr/lib/voxtype/voxtype-onnx-cuda-12" - # ONNX CUDA 13 (locked to libcudart.so.13 ABI, requires driver 580+). - # v0.7.3+: dlopens ORT at runtime. Install Microsoft's libonnxruntime - # under its SONAME plus a libonnxruntime.so symlink that ort/load-dynamic - # expects (resolved relative to /proc/self/exe, see ort src/lib.rs:96-109). - install -Dm755 "$srcdir/voxtype-$pkgver-onnx-cuda-13" \ - "$pkgdir/usr/lib/voxtype/cuda-13/voxtype-onnx-cuda-13" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-13.libonnxruntime_providers_cuda.so" \ - "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime_providers_cuda.so" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-13.libonnxruntime_providers_shared.so" \ - "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime_providers_shared.so" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-13.libonnxruntime.so.1.24.4" \ - "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime.so.1.24.4" - ln -sf "libonnxruntime.so.1.24.4" \ - "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime.so" - ln -sf "cuda-13/voxtype-onnx-cuda-13" \ - "$pkgdir/usr/lib/voxtype/voxtype-onnx-cuda-13" + # ONNX CUDA 13 (locked to libcudart.so.13 ABI, requires driver 580+). + # v0.7.3+: dlopens ORT at runtime. Install Microsoft's libonnxruntime + # under its SONAME plus a libonnxruntime.so symlink that ort/load-dynamic + # expects (resolved relative to /proc/self/exe, see ort src/lib.rs:96-109). + install -Dm755 "$srcdir/voxtype-$pkgver-onnx-cuda-13" \ + "$pkgdir/usr/lib/voxtype/cuda-13/voxtype-onnx-cuda-13" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-13.libonnxruntime_providers_cuda.so" \ + "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime_providers_cuda.so" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-13.libonnxruntime_providers_shared.so" \ + "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime_providers_shared.so" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-cuda-13.libonnxruntime.so.1.24.4" \ + "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime.so.1.24.4" + ln -sf "libonnxruntime.so.1.24.4" \ + "$pkgdir/usr/lib/voxtype/cuda-13/libonnxruntime.so" + ln -sf "cuda-13/voxtype-onnx-cuda-13" \ + "$pkgdir/usr/lib/voxtype/voxtype-onnx-cuda-13" - # ONNX MIGraphX (AMD GPU EP, replaces ROCm in v0.7.0) - install -Dm755 "$srcdir/voxtype-$pkgver-onnx-migraphx" \ - "$pkgdir/usr/lib/voxtype/migraphx/voxtype-onnx-migraphx" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-migraphx.libonnxruntime_providers_migraphx.so" \ - "$pkgdir/usr/lib/voxtype/migraphx/libonnxruntime_providers_migraphx.so" - install -Dm644 "$srcdir/voxtype-$pkgver-onnx-migraphx.libonnxruntime_providers_shared.so" \ - "$pkgdir/usr/lib/voxtype/migraphx/libonnxruntime_providers_shared.so" - ln -sf "migraphx/voxtype-onnx-migraphx" \ - "$pkgdir/usr/lib/voxtype/voxtype-onnx-migraphx" + # ONNX MIGraphX (AMD GPU EP, replaces ROCm in v0.7.0) + install -Dm755 "$srcdir/voxtype-$pkgver-onnx-migraphx" \ + "$pkgdir/usr/lib/voxtype/migraphx/voxtype-onnx-migraphx" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-migraphx.libonnxruntime_providers_migraphx.so" \ + "$pkgdir/usr/lib/voxtype/migraphx/libonnxruntime_providers_migraphx.so" + install -Dm644 "$srcdir/voxtype-$pkgver-onnx-migraphx.libonnxruntime_providers_shared.so" \ + "$pkgdir/usr/lib/voxtype/migraphx/libonnxruntime_providers_shared.so" + ln -sf "migraphx/voxtype-onnx-migraphx" \ + "$pkgdir/usr/lib/voxtype/voxtype-onnx-migraphx" - # Compatibility symlink for users with scripts referencing the old - # voxtype-onnx-rocm name. The AMD GPU EP changed from ROCm to MIGraphX - # in v0.7.0; ship one release with both names to soften the transition. - # Drop in v0.8.0. + # Compatibility symlink for users with scripts referencing the old + # voxtype-onnx-rocm name. The AMD GPU EP changed from ROCm to MIGraphX + # in v0.7.0; ship one release with both names to soften the transition. + # Drop in v0.8.0. ln -sf "voxtype-onnx-migraphx" "$pkgdir/usr/lib/voxtype/voxtype-onnx-rocm" fi # /usr/bin/voxtype symlink and the unversioned voxtype-onnx-cuda symlink # are created by the .install script's post_install/post_upgrade hooks - # so they can pick the right CUDA variant for the host. + # so they can pick the right CUDA variant for the host (a no-op on + # aarch64, where _set_onnx_cuda_symlink() short-circuits). # OSD launcher + GTK4 frontend. The launcher resolves /proc/self/exe and # probes its parent directory, so it finds /usr/lib/voxtype/voxtype-osd-gtk4 @@ -301,26 +326,25 @@ package() { # voxtype-shared/ subdirectory holds a QML module (Theme, StateReader, # AudioBridge) registered via qmldir — keep the layout intact or # `import voxtype-shared 1.0` fails to resolve. - install -Dm644 "$srcdir/quickshell-shell-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/shell.qml" - install -Dm644 "$srcdir/quickshell-OsdSurface-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/OsdSurface.qml" - install -Dm644 "$srcdir/quickshell-EnginePicker-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/EnginePicker.qml" - install -Dm644 "$srcdir/quickshell-MeetingControls-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/MeetingControls.qml" - install -Dm644 "$srcdir/quickshell-voxtype-shared-Theme-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/voxtype-shared/Theme.qml" - install -Dm644 "$srcdir/quickshell-voxtype-shared-StateReader-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/voxtype-shared/StateReader.qml" - install -Dm644 "$srcdir/quickshell-voxtype-shared-AudioBridge-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/voxtype-shared/AudioBridge.qml" - install -Dm644 "$srcdir/quickshell-voxtype-shared-StyleLoader-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/voxtype-shared/StyleLoader.qml" - install -Dm644 "$srcdir/quickshell-voxtype-shared-RecipeRenderer-$pkgver.qml" \ - "$pkgdir/usr/share/voxtype/quickshell/voxtype-shared/RecipeRenderer.qml" - install -Dm644 "$srcdir/quickshell-voxtype-shared-qmldir-$pkgver" \ - "$pkgdir/usr/share/voxtype/quickshell/voxtype-shared/qmldir" + # Copy the whole tree so a QML file added upstream can never be missed + # here (the #697/#762 failure class). Mirrors scripts/package.sh exactly. + install -d "$pkgdir/usr/share/voxtype" + cp -a "$srcdir/voxtype-$pkgver/quickshell" "$pkgdir/usr/share/voxtype/" + find "$pkgdir/usr/share/voxtype/quickshell" -type f -exec chmod 644 {} + + find "$pkgdir/usr/share/voxtype/quickshell" -type d -exec chmod 755 {} + + + # OSD style packages and recipes. The style resolver searches + # /usr/share/voxtype/osd/ after the user paths, so shipping the + # example packages gives [osd] style = "" something to resolve out + # of the box; a user copy in ~/.config or ~/.local/share still shadows + # them. Whole trees from the same source tarball, no extra sources. + install -d "$pkgdir/usr/share/voxtype/osd" "$pkgdir/usr/share/voxtype/osd-recipes" + cp -a "$srcdir/voxtype-$pkgver/examples/osd-packages/." "$pkgdir/usr/share/voxtype/osd/" + find "$pkgdir/usr/share/voxtype/osd" -type f -exec chmod 644 {} + + find "$pkgdir/usr/share/voxtype/osd" -type d -exec chmod 755 {} + + cp -a "$srcdir/voxtype-$pkgver/examples/osd-recipes/." "$pkgdir/usr/share/voxtype/osd-recipes/" + find "$pkgdir/usr/share/voxtype/osd-recipes" -type f -exec chmod 644 {} + + find "$pkgdir/usr/share/voxtype/osd-recipes" -type d -exec chmod 755 {} + # Desktop entry for the TUI configure command, surfaced in walker/rofi/fuzzel/etc. # The launcher discovers a terminal emulator and runs `voxtype configure` inside it. diff --git a/pkgbuilds/voxtype-bin/voxtype-bin.install b/pkgbuilds/voxtype-bin/voxtype-bin.install index a790fa3..8dbfe6e 100644 --- a/pkgbuilds/voxtype-bin/voxtype-bin.install +++ b/pkgbuilds/voxtype-bin/voxtype-bin.install @@ -52,6 +52,10 @@ _install_active_binary() { esac } +_cpu_has() { + grep -q "$1" /proc/cpuinfo 2>/dev/null +} + _set_default_backend() { # aarch64 ships one generic CPU binary — no AVX2/AVX-512 split exists on # that architecture, so there's nothing to detect. @@ -61,13 +65,17 @@ _set_default_backend() { return fi - # Set the default CPU backend based on CPU capabilities - if grep -q avx512f /proc/cpuinfo 2>/dev/null; then + # Set the default CPU backend based on CPU capabilities. The baseline + # binary supports x86-64-v2 hosts that lack AVX2. + if _cpu_has avx512f; then _install_active_binary /usr/lib/voxtype/voxtype-avx512 echo "avx512" - else + elif _cpu_has avx2; then _install_active_binary /usr/lib/voxtype/voxtype-avx2 echo "avx2" + else + _install_active_binary /usr/lib/voxtype/voxtype-baseline + echo "baseline" fi } @@ -101,6 +109,13 @@ _preserve_or_set_backend() { target="/usr/lib/voxtype/cuda-${cuda_major}/voxtype-onnx-cuda-${cuda_major}" ;; esac + # Before 1.1.0 a CPU without AVX2 was given voxtype-avx2 anyway, so a + # saved CPU build the host cannot run is picked again, not restored. + case "$target" in + */voxtype-avx512) _cpu_has avx512f || target="" ;; + */voxtype-avx2) _cpu_has avx2 || target="" ;; + esac + if [ -f "$target" ]; then _install_active_binary "$target" # Strip the /usr/lib/voxtype/[/]voxtype- prefix for the echo @@ -273,7 +288,10 @@ pre_upgrade() { post_upgrade() { echo "" - echo "==> Voxtype upgraded to 1.0.0" + # pacman passes the new full version (pkgver-pkgrel) as $1; strip the + # pkgrel. Hardcoding the number here is how an upgrade to 1.1.0 once + # announced itself as 1.0.0. + echo "==> Voxtype upgraded to ${1%%-*}" echo "" BACKEND=$(_preserve_or_set_backend) @@ -287,49 +305,35 @@ post_upgrade() { fi echo "" - echo " What's new in v1.0.0:" - echo " * Every setting is reachable from a script:" - echo " voxtype config schema --json" - echo " voxtype config get output.mode" - echo " voxtype config set audio.pause_media true" - echo " Plus voxtype info engines/models/devices/accel/variants" - echo " for the read-only side." - echo " * Graphical settings panel for Omarchy 4, generated from" - echo " the config schema. See omarchy-plugin/ in the source tree." - echo " * voxtype record stop --wait blocks until a dictation" - echo " finishes and reports the outcome, so a script no longer" - echo " polls the transcript file and guesses." - echo " * Media pausing talks D-Bus directly. playerctl is no" - echo " longer needed, which matters on Omarchy Quattro." - echo " * Notifications replace the previous one on KDE instead of" - echo " stacking (#532)." - echo " * setup gpu --status reports the backend the daemon is" - echo " actually running, and warns when a GPU provider cannot" - echo " load instead of claiming acceleration that is not there." - echo " * Model downloads are atomic. An interrupted download no" - echo " longer leaves a truncated model that reports as installed." - echo " * voxtype setup --download --model small fetches Whisper" - echo " small. It was shadowed by SenseVoice." - echo " * The package installs voxtype-osd, voxtype-osd-gtk4," - echo " voxtype-osd-quickshell and voxtype-audio-bridge (#488)." - echo " * Soniox is compiled into every binary, no feature flag." - echo "" - echo " Known issues:" - echo " * The Quickshell overlay captures pointer events across the" - echo " whole screen (#440). The default [osd] frontend = \"gtk4\"" - echo " is unaffected and Quickshell stays opt-in." - echo " * onnx-migraphx builds: the ONNX Runtime MIGraphX provider" - echo " corrupts the heap, which used to abort the daemon on exit" - echo " and write a 1.9 GB core dump. The daemon now exits without" - echo " running that teardown, so the symptom is gone. The bug is" - echo " upstream in ORT. Nothing is lost either way: it happened" - echo " after shutdown was already complete." + echo " What's new in v1.1.0:" + echo " * New openvino engine: Whisper on Intel CPU, iGPU, and the" + echo " Core Ultra NPU. Needs Intel's OpenVINO GenAI runtime;" + echo " loaded only when the engine is selected." + echo " * [text] replacements and spoken punctuation now apply on" + echo " every output path, including streaming and" + echo " voxtype transcribe. If you use replacements with a" + echo " streaming engine, your output changes with this release." + echo " * The Quickshell OSD follows Omarchy theme switches live," + echo " and takes style packages and recipes:" + echo " voxtype info styles" + echo " voxtype config set osd.style " + echo " Example styles land in /usr/share/voxtype/osd and recipes" + echo " in /usr/share/voxtype/osd-recipes." + echo " * New baseline binary for CPUs without AVX2 (x86-64-v2," + echo " Nehalem 2008+), OSD included:" + echo " voxtype setup variant --to baseline" + echo " * A panicked transcription recovers on every engine, not" + echo " just Whisper." + echo " * A config with one bad value loads everything else and" + echo " names the bad section in the log instead of stopping the" + echo " daemon." + echo " * The GTK4 OSD dmabuf crash on AMD iGPUs is fixed (#656)." echo "" echo " Restart the daemon to apply updates:" echo " systemctl --user restart voxtype" echo "" echo " Full release notes:" - echo " https://github.com/peteonrails/voxtype/releases/tag/v1.0.0" + echo " https://github.com/peteonrails/voxtype/releases/tag/v1.1.0" echo "" } diff --git a/tests/voxtype-bin-install.sh b/tests/voxtype-bin-install.sh new file mode 100755 index 0000000..5f69149 --- /dev/null +++ b/tests/voxtype-bin-install.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# voxtype-bin.install: a host gets a Whisper CPU build it can run, on a fresh +# install and on an upgrade from a release that had no baseline build. +set -euo pipefail + +REPO_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..") +INSTALL_SCRIPT="$REPO_ROOT/pkgbuilds/voxtype-bin/voxtype-bin.install" +TEST_ROOT=$(mktemp -d) +SAVED="$TEST_ROOT/backend-upgrade" +trap 'rm -rf "$TEST_ROOT"' EXIT + +fail() { + echo "not ok - $1" >&2 + exit 1 +} +pass() { + echo "ok - $1" +} + +# shellcheck source=/dev/null +source "$INSTALL_SCRIPT" + +# The hook keeps upgrade state in /tmp, where a real upgrade's could be; move +# it into the test directory. +eval "$(declare -f _preserve_or_set_backend | sed 's|/tmp/\.voxtype-backend-upgrade|${SAVED}|')" +declare -f _preserve_or_set_backend | grep -qF '${SAVED}' || + fail "the hook no longer keeps its upgrade state at /tmp/.voxtype-backend-upgrade" + +cpu_flags="" +_cpu_has() { [[ " $cpu_flags " == *" $1 "* ]]; } +_install_active_binary() { printf '%s\n' "$1" >"$TEST_ROOT/active"; } +uname() { echo x86_64; } + +# What an earlier release left behind: its saved backends are real files. +mkdir -p "$TEST_ROOT/lib" +touch "$TEST_ROOT/lib/voxtype-avx2" "$TEST_ROOT/lib/voxtype-avx512" "$TEST_ROOT/lib/voxtype-vulkan" + +fresh() { + local flags=$1 backend=$2 description=$3 out + cpu_flags=$flags + out=$(_set_default_backend) + [[ $out == "$backend" && $(<"$TEST_ROOT/active") == "/usr/lib/voxtype/voxtype-$backend" ]] || + fail "$description: got $out -> $(<"$TEST_ROOT/active")" + pass "$description" +} + +upgrade() { + local flags=$1 saved=$2 backend=$3 active=$4 description=$5 out + cpu_flags=$flags + printf '%s\n' "$saved" >"$SAVED" + out=$(_preserve_or_set_backend) + [[ $out == "$backend" && $(<"$TEST_ROOT/active") == "$active" ]] || + fail "$description: got $out -> $(<"$TEST_ROOT/active")" + pass "$description" +} + +fresh "sse4_2" baseline "a fresh install without AVX2 gets the baseline build" +fresh "sse4_2 avx2" avx2 "a fresh install with AVX2 gets the AVX2 build" +fresh "sse4_2 avx2 avx512f" avx512 "a fresh install with AVX-512 gets the AVX-512 build" + +upgrade "sse4_2" "$TEST_ROOT/lib/voxtype-avx2" baseline /usr/lib/voxtype/voxtype-baseline \ + "an upgrade without AVX2 moves off the AVX2 build an older release picked" +upgrade "sse4_2 avx2" "$TEST_ROOT/lib/voxtype-avx512" avx2 /usr/lib/voxtype/voxtype-avx2 \ + "an upgrade without AVX-512 moves off the AVX-512 build" +upgrade "sse4_2 avx2" "$TEST_ROOT/lib/voxtype-avx2" avx2 "$TEST_ROOT/lib/voxtype-avx2" \ + "an upgrade keeps a CPU build the host can run" +upgrade "sse4_2" "$TEST_ROOT/lib/voxtype-vulkan" vulkan "$TEST_ROOT/lib/voxtype-vulkan" \ + "an upgrade keeps a GPU build the user chose"