Files
voculinux/packaging/native/nfpm.yaml
T
4b7d57c077 feat(packaging): build thin .deb and .rpm and attach them to releases (#913)
* feat(packaging): build thin .deb and .rpm with nfpm and attach them to releases

Adds packaging/native: an nfpm config that produces a .deb and an .rpm
from the release wheel. The packages stay thin - Python, GTK, PyGObject
and the typelibs are distro Depends; only pywhispercpp and pynput are
vendored because the first is unpackaged on both distros and the second
is missing on Fedora. The Debian 12 build image and the nfpm download
are pinned in tool_checksums.txt.

just native-packages builds both in the pinned container, and
native-smoke installs the built package per distro: debian:12 and
ubuntu:24.04 exercise the .deb, fedora:42 the .rpm, then each runs
vocalinux --version plus an import smoke of the app and the vendored
extension. unified-pipeline.yml gates on the same three-distro matrix,
and release.yml attaches both arches to the release and covers them in
SHA256SUMS and the provenance manifest.

Refs #600

* fix(packaging): preserve launcher args and document Wayland input group

The launcher joined $* into an unquoted exec, re-splitting file paths
that contain spaces before argparse saw them. Exec "$@" directly and
re-quote each argument for the inner shell of 'sg input -c'.

On Wayland the packages could not grant the 'input' group membership
evdev hotkeys need; name the usermod step and its caveat in INSTALL.md
and the release notes.

* test(packaging): add return types to the native packaging tests

---------

Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>
2026-10-07 17:10:00 -07:00

109 lines
3.5 KiB
YAML

# One nfpm config for both the .deb and the .rpm.
#
# Do not run nfpm on this file directly: build.sh assembles the payload tree
# this config expects (./payload and ./pkg-doc next to the directory it runs
# nfpm from) and sets the VOCA_* variables the fields below expand.
#
# Packaging stays thin on purpose (#600): the interpreter, GTK, PyGObject and
# the gi typelibs come from the distribution, and so do every Python
# dependency the distros package. Only pywhispercpp and pynput are vendored —
# pywhispercpp is not packaged by Debian or Fedora at all, and pynput is
# missing from Fedora — both under /usr/lib/vocalinux/vendor/, on sys.path via
# the launcher in /usr/bin/vocalinux. Vendoring the pywhispercpp wheel per
# supported CPython is what keeps the package free of a bundled interpreter.
#
# Version: VOCA_VERSION is the tag without its leading v and without a
# prerelease suffix; VOCA_PRERELEASE carries that suffix (empty for stable).
# nfpm maps a prerelease to 0.19.0~beta-1, which orders before the stable
# 0.19.0-1 in both formats.
name: vocalinux
arch: ${VOCA_ARCH}
platform: linux
version: ${VOCA_VERSION}
release: 1
prerelease: ${VOCA_PRERELEASE}
section: utils
priority: optional
maintainer: "Jatin K Malik <jatinkrmalik@gmail.com>"
description: |
Free, offline voice dictation for Linux. Hold the push-to-talk key,
transcribe speech locally (whisper.cpp by default), and type into the
focused window. GTK, PyGObject and the interpreter come from the
distribution; pywhispercpp and pynput are vendored under
/usr/lib/vocalinux/vendor because neither distro packages them.
homepage: https://github.com/VocaHQ/vocalinux
license: AGPL-3.0-only
contents:
# The staged payload tree: /usr/lib/vocalinux/{app,vendor}, the launchers in
# /usr/bin, the desktop file and the hicolor icon. build.sh writes it.
- src: ./payload/
dst: /
type: tree
# License placement differs between the formats: Debian policy wants the
# copyright file under /usr/share/doc, Fedora marks /usr/share/licenses.
- src: ./pkg-doc/LICENSE
dst: /usr/share/doc/vocalinux/copyright
packager: deb
- src: ./pkg-doc/LICENSE
dst: /usr/share/licenses/vocalinux/LICENSE
packager: rpm
overrides:
deb:
depends:
- python3 (>= 3.11)
- python3-gi
- python3-gi-cairo
- gir1.2-gtk-3.0
- gir1.2-ayatanaappindicator3-0.1
- python3-numpy
- python3-requests
- python3-tqdm
- python3-platformdirs
- python3-psutil
- python3-evdev
- python3-pyaudio
- python3-xlib
recommends:
# Host tools the injectors fall back through; install.d documents the
# same set for install.sh. The app runs without them on degraded paths.
- xdotool
- wtype
- ydotool
- wl-clipboard
- xclip
- xsel
# IBus engine (Wayland text injection): typelib plus the daemon itself.
- gir1.2-ibus-1.0
- ibus
# Desktop notifications.
- gir1.2-notify-0.7
rpm:
depends:
- python3 >= 3.11
- python3-gobject
- python3-cairo
- gtk3
- libayatana-appindicator-gtk3
- python3-numpy
- python3-requests
- python3-tqdm
- python3-platformdirs
- python3-psutil
- python3-evdev
- python3-pyaudio
- python3-xlib
recommends:
- xdotool
- wtype
- ydotool
- wl-clipboard
- xclip
- xsel
# ibus carries the IBus-1.0 typelib itself on Fedora.
- ibus
- libnotify