Skip to content

Development and packaging

Part Path
Headless Rust core and CLI crates/clamui-core
Tauri 2 desktop shell desktop/src-tauri
React/TypeScript frontend desktop/
Docs website (Starlight) website/

Python is not a build or runtime dependency. The v0.4.1 tag preserves the historical Python release; current work is on master.

You need WebKitGTK 4.1 and GTK 3 development libraries, stable Rust from rustup, and Bun.

Debian / Ubuntu
sudo apt update
sudo apt install build-essential pkg-config libssl-dev libgtk-3-dev \
libwebkit2gtk-4.1-dev librsvg2-dev libxdo-dev curl wget file \
flatpak-builder
Check the toolchain
rustc --version && cargo --version && bun --version
Get the source
git clone https://github.com/linx-systems/clamui.git
cd clamui
Flatpak SDK for local Flatpak builds

The Flatpak recipes use GNOME Platform/SDK 51 and build for your native architecture (x86_64 or aarch64):

Terminal window
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install --user --arch="$(flatpak --default-arch)" flathub \
org.gnome.Sdk//51 \
org.freedesktop.Sdk.Extension.node24//26.08 \
org.freedesktop.Sdk.Extension.rust-stable//26.08

From the repository root, install the locked frontend dependencies and start Tauri:

Terminal window
( cd desktop && bun install --frozen-lockfile )
bun run --cwd desktop tauri dev

Use the Tauri command for desktop development; do not substitute direct cargo run. Tauri development uses its configured build.devUrl, while the native custom-protocol production binary embeds frontendDist.

The GUI runs through Tauri/WebKitGTK. For the headless core CLI, use the native binary directly; this route must not initialize a WebKit window:

Terminal window
cargo run -p clamui-core --bin clamui-cli -- help
cargo run -p clamui-core --bin clamui-cli -- scan --help
cargo run -p clamui-core --bin clamui-scheduled-scan -- --dry-run

The clamui command preserves seven subcommands: scan, quarantine, profile, status, history, help, and install-privileged-helper. Keep their flags, JSON/text output, standard streams, and exit semantics compatible. clamui-scheduled-scan remains a separate executable.

The CLI accepts conventional bundled scan flags and compatible attached history arguments. Use -- before a target whose name looks like an option, for example clamui scan -- --virustotal; this keeps it a scan target rather than treating it as a flag.

The command-line reference explains how the installed binary chooses between CLI commands and graphical scans. Common commands:

Terminal window
clamui scan /path/to/target
clamui quarantine list --json
clamui profile list --json
clamui status --json
clamui history --limit 20 --json
clamui help scan
sudo clamui install-privileged-helper
clamui-scheduled-scan --dry-run

install-privileged-helper is the manual native/source-host path. Its real installation requires root and stages the co-bundled compiled helper with its canonical polkit policy; retain it for mutable source hosts. On supported Debian-family and Fedora hosts, a missing helper in native packages, AppImages, source builds, or Flatpak may show explicit in-app setup from the local capability check. Automatic setup requires an exact matching signed published package; before graphical Polkit authorization, it validates that package’s signature, identity, version, size, digest, and compatible architecture, otherwise failing safely without authorization. Debian alone can use its signed same-version architecture-independent fallback only when the release explicitly provides it and no exact-architecture helper exists. Fedora Atomic contributors must use verified RPM layering and reboot for manual repair, never this source installer against immutable /usr. The Flatpak rejects this host command, so do not use sudo flatpak.

For source-host development, build only the headless binaries, then use the non-privileged staging mode in a directory you own:

Terminal window
cargo build --locked -p clamui-core --bins
stage_dir="$(mktemp -d)"
./target/debug/clamui-cli install-privileged-helper --prefix "$stage_dir"

On a mutable native host, the actual installation is a separate, privileged action; do not run Cargo as root:

Terminal window
sudo ./target/debug/clamui-cli install-privileged-helper

Use structured Rust logging while starting the desktop:

Terminal window
RUST_LOG=clamui=debug bun run --cwd desktop tauri dev

Use the Tauri/WebKit developer tools for frontend state and the terminal for Rust/core diagnostics. Never replace native IPC with a browser filesystem, shell, or process permission. The only frontend request boundary is Tauri’s allowlisted request command and clamui-event event stream.

Work against the real XDG layout (locations), never project-local data. Preserve atomic settings writes, unknown keys, existing JSON/SQLite schemas, privacy migrations, restrictive file modes, and profile import compatibility. The core stays independent of GTK widgets and Tauri so everything also works through the CLI.

  • ClamUI uses host clamscan, freshclam, and for daemon mode clamd/clamdscan. Flatpak calls cross flatpak-spawn --host. Never bundle or emulate ClamAV.
  • Protected config changes go through the protocol-v4 helper /usr/bin/clamui-apply-preferences and the io.github.linx_systems.ClamUI.policy polkit policy. Keep its allowlists, PKEXEC_UID validation, exit codes, and compatibility with installed helpers.
  • Missing trust or authorization must fail without changes. User-facing behavior: privileged helper.
Run from the repository root
bun run --cwd desktop check
bun run --cwd desktop build # before clippy: Tauri embeds desktop/dist
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

Beyond unit tests, exercise the real CLI: clean scan, EICAR, cancellation, clamui-scheduled-scan --dry-run, helper rejection, and CLI output compatibility. For desktop work, check startup, navigation, native dialogs, tray, and file-argument forwarding by hand.

File issues with the issue forms and describe what you actually verified in the pull request template.

Packaging sources: debian/, flathub/, appimage/, rpm/. Use their scripts rather than recreating package logic.

Format Output Architectures
Debian App and helper .deb pair amd64, arm64
Flatpak Bundle or Flathub build x86_64, aarch64 (a local build proves only your own)
AppImage ClamUI-<VERSION>-x86_64.AppImage + .zsync x86_64
Fedora RPM Helper only x86_64, aarch64
Debian and AppImage
./debian/build-deb.sh
# Package binaries built on the Ubuntu 22.04-compatible baseline:
CLAMUI_ARTIFACT_DIR=/absolute/path/to/ubuntu22/target/release ./debian/build-deb.sh dist
UPDATE_INFORMATION='gh-releases-zsync|linx-systems|clamui|latest|ClamUI-*-x86_64.AppImage.zsync' ./appimage/build-appimage.sh

CLAMUI_ARTIFACT_DIR must contain executable clamui, clamui-scheduled-scan, and clamui-apply-preferences from the baseline build.

Fedora helper RPM
./rpm/build-privileged-helper-rpm.sh dist
CLAMUI_ARTIFACT_DIR=/absolute/path/to/ubuntu22/target/release CLAMUI_RPM_ARCH=x86_64 ./rpm/build-privileged-helper-rpm.sh dist

The RPM build needs Cargo, readelf (binutils), rpm/rpmbuild, and for source builds the Rust C toolchain, pkg-config, and GLib headers. A local RPM is unsigned: the in-app installer only accepts the signed published one. CARGO_TARGET_DIR and CARGO_BUILD_TARGET pick a non-default artifact; CLAMUI_RPM_ARCH asserts the helper’s ELF architecture.

Dependabot checks Cargo, the desktop and website Bun projects, and GitHub Actions weekly; minor and patch updates are grouped per project. desktop/bun.lock is canonical; desktop/yarn.lock is only its export for Flatpak’s offline source generator.

Cargo and desktop Dependabot PRs refresh the lockfile export and Flatpak sources automatically once the branch includes current master (comment @dependabot rebase on older PRs). To rerun it:

Terminal window
gh workflow run dependabot-refresh.yml --ref master -f pr_number=123
Refresh by hand
( cd desktop && bun install --frozen-lockfile --yarn )
scripts/generate-flatpak-sources.sh

flathub/io.github.linx_systems.ClamUI.local.yml builds your working tree. It does not install or replace an existing Flatpak:

Terminal window
mkdir -p target
flatpak_workdir="$(mktemp -d "$PWD/target/flatpak.XXXXXX")"
flatpak-builder --user --arch="$(flatpak --default-arch)" \
--state-dir="$flatpak_workdir/state" \
--repo="$flatpak_workdir/repo" \
"$flatpak_workdir/build" \
flathub/io.github.linx_systems.ClamUI.local.yml

The checked-in flathub/io.github.linx_systems.ClamUI.yml uses the same checkout source and is not a release manifest either.

A release needs three inputs: a manifest pinned to a public Git URL and full commit, flathub/cargo-sources.json (from Cargo.lock), and flathub/bun-sources.json (from desktop/bun.lock via its Yarn export). Never hand-edit their checksums. Update one crate at a time with cargo update -p <crate> --precise <version>.

Generate and build a release manifest

Run from a clean checkout whose commit is already public. Needs flatpak-cargo-generator.py and flatpak-node-generator (Python 3.11+):

Terminal window
( cd desktop && bun install --frozen-lockfile --yarn )
release_commit="$(git rev-parse HEAD)"
scripts/generate-flatpak-sources.sh \
--release-url https://github.com/linx-systems/clamui.git \
--release-commit "$release_commit" \
--release-output flathub/io.github.linx_systems.ClamUI.release.yml

Review all three files together. Then build in a fresh directory:

Terminal window
mkdir -p target
flatpak_release_dir="$(mktemp -d "$PWD/target/flatpak-release.XXXXXX")"
flatpak-builder --user --arch="$(flatpak --default-arch)" \
--state-dir="$flatpak_release_dir/state" \
--repo="$flatpak_release_dir/repo" \
"$flatpak_release_dir/build" \
flathub/io.github.linx_systems.ClamUI.release.yml

A local build proves only your architecture. Before submitting, validate offline builds for both x86_64 and aarch64. Store releases go through the separate Flathub repository; GitHub release bundles do not update Flathub. Inspect payloads for the right architecture, command names, helper and policy paths, and no Python runtime.

Docs live in website/src/content/docs/docs/. Use root-relative /docs/.../ links, the existing sidebar, and Starlight components (rename a page to .mdx to use them). README.md and CONTRIBUTING.md stay short pointers; CHANGELOG.md and RELEASE_NOTES.md are rendered on the site.

Build the site
( cd website && bun install --frozen-lockfile )
bun run --cwd website check
bun run --cwd website build

Do not edit generated website/public/ or website/dist/. Catalog workflow: translation.

icons/io.github.linx_systems.ClamUI.svg is the source; icons/io.github.linx_systems.ClamUI.png is its committed 128×128 rendering. Regenerate and commit both when the SVG changes.