Skip to Content
enquadre

Building

Build Enquadre from source and preview the editor on Linux.

Enquadre is one Rust crate. Install Rust with rustup, then run:

git clone https://github.com/Microck/enquadre.git
cd enquadre
cargo build --release --locked
cargo test --release

Windows

Use the x64 MSVC toolchain and the Windows SDK. The GPUI dependencies are large, so set CARGO_TARGET_DIR to a drive with free space. The build links the C runtime statically.

$env:CARGO_TARGET_DIR = 'D:\enquadre-build'
cargo build --release --locked --target x86_64-pc-windows-msvc

macOS

The Xcode command line tools are enough.

  1. Build the binary with cargo build --release --target aarch64-apple-darwin. For Intel, use x86_64-apple-darwin.
  2. Run packaging/macos/bundle.sh <version> arm64, or x64 for Intel. The script builds Enquadre.app and its disk image.

When the signing variables are set, bundle.sh signs the app with the Developer ID certificate and notarizes the disk image. Without them, the script signs the app ad hoc. The variables are MACOS_CERTIFICATE, MACOS_CERTIFICATE_PASSWORD, APPLE_API_KEY, APPLE_API_KEY_ID, and APPLE_API_ISSUER.

Linux

Install the libraries that GPUI and the tray need. These are the Debian and Ubuntu package names:

sudo apt-get install libxkbcommon-x11-dev libxcb1-dev libxcb-randr0-dev libxcb-shm0-dev \
  libwayland-dev libdbus-1-dev libpipewire-0.3-dev libgbm-dev libegl-dev libfontconfig-dev \
  libfreetype-dev libvulkan-dev libxdo-dev libssl-dev clang

GPUI 0.2.2 depends on xattr 0.2.3, which reads libc::ENOATTR. Current libc does not define ENOATTR on Linux, where it equals ENODATA. Patch a copy of xattr and point Cargo at the copy:

cargo fetch
cp -r ~/.cargo/registry/src/*/xattr-0.2.3 /tmp/xattr-0.2.3
sed -i 's/::libc::ENOATTR;/::libc::ENODATA;/' /tmp/xattr-0.2.3/src/sys/mod.rs
cargo build --release --config 'patch.crates-io.xattr.path="/tmp/xattr-0.2.3"'

Because cargo install cannot apply this patch, Enquadre is not published on crates.io.

Preview the editor on Linux

scripts/linux-preview.sh <input.png> <screenshot.png> [steps...] opens the editor on an image and saves a screenshot of the window. The script does these things:

  1. It builds Enquadre --preview.
  2. It opens the image under Xvfb with the Mesa software Vulkan driver.
  3. It runs each optional xdotool step, such as "key 1" or "mousemove 100 300 mousedown 1 mousemove 300 420 mouseup 1". Coordinates are in window pixels.
  4. It saves the screenshot.

A "shot <file.png>" step saves the window at that point. The script lists the packages it needs.

Timing

With ENQUADRE_TRACE=1 set, Enquadre prints timestamps to stderr at four points: the shortcut arrives, the desktop capture finishes, the capture screen appears, and the capture screen paints.

Releases

To publish a release:

  1. Set the version in Cargo.toml.
  2. Add the version to CHANGELOG.md and to the AppStream file in packaging/linux/.
  3. Push a tag named v<version>.

The release workflow, .github/workflows/release.yml, rejects a tag that does not match Cargo.toml. For a matching tag, the workflow does these things:

  • It tests and builds Enquadre on every platform.
  • It packages the Windows installer and portable zip with NSIS from packaging/windows/.
  • It signs, notarizes, and packages the macOS disk images.
  • It packages the Linux AppImage, Flatpak, and tarball with packaging/linux/package.sh.
  • It writes SHA256SUMS.txt, the Scoop manifest, and the Homebrew cask.
  • It publishes a GitHub release with every file.

On this page