Two recipes (Milestone 13): packaging/arch-bin/PKGBUILD (moonkale-bin) installs a release tarball in seconds — what to send friends, see Install — and packaging/arch/PKGBUILD (moonkale-git) builds from source, for the AUR. Background: Packaging Overview. System prerequisites for running it: Linux Desktop Setup.
what the binary links; xdotool provides libxdo.so (P-038)
makedepends
git cargo rust dioxus-cli pkgconf
dioxus-cli is in the AUR (dioxus-cli, or dioxus-cli-bin for a prebuilt); must be ≥ 0.7.10
How the PKGBUILD works
pkgver() — 0.1.0.r<commits>.g<sha> from git (it’s a -git package; a tagged release becomes a plain moonkale package with a tarball source and real checksums).
prepare() — cargo fetch --locked so build() needs no network (makepkg runs builds offline in a clean chroot with extra-x86_64-build).
build() — dx build --release --platform desktop --features desktop in packages/desktop, then dx build --release --platform server in packages/web. dx, not cargo, because only dx collects the hashed assets. CARGO_TARGET_DIR is pinned so package() knows where the output is (target/dx/moonkale/release/linux/app, target/dx/web/release/web/server).
package() — install to the layout the asset resolver expects:
Test without pushing: MOONKALE_GIT_URL="file:///path/to/Moonkale" makepkg -f (the source line honours it).
Build and install
cd packaging/archmakepkg -si # builds in-place and installs# or, the proper way, in a clean chroot:# extra-x86_64-buildnamcap PKGBUILD moonkale-git-*.pkg.tar.zst # lint
The proof that packaging is right (not just the build): after pacman -U, run moonkale from a different directory than the source tree and open a file — if the editor shows “Loading editor…” forever, the CodeMirror asset was not found → the lib/Moonkale/assets layout or the product name is wrong.
No icon yet (bundle.icon in Dioxus.toml, hicolor install line commented out).
dioxus-cli in the AUR may lag the workspace’s dioxus version; if so, cargo install dioxus-cli --version 0.7.10 --locked in prepare() is not allowed by AUR rules — pin the AUR package version in makedepends instead ('dioxus-cli>=0.7.10').
Reproducibility: dx’s asset hashes are content-based, so two builds of the same commit produce the same file names — good for pacman diffs.
LadybugDB is linked statically like the other drivers. Its bundled zstd/SimSIMD are made local at build time (LBUG_LOCALIZE_BUNDLED_SYMBOLS=1 from the repo’s .cargo/config.toml, lbug ≥ 0.21; P-144), so no extra source or library is installed. The Linux packages (Arch, Debian, tarball, Nix) include it; macOS/Windows do not.