Install on Linux
This page installs the ztk program on Linux and checks that it opens a window. The program is one static file, so each way gives the same program.
With Homebrew
brew install beetlebugorg/tap/ztk
Homebrew on Linux installs the release program for x86-64 or arm64. brew upgrade ztk gets a new release.
From the release archive
Each release has ztk-VERSION-x86_64-linux-musl.tar.gz and ztk-VERSION-aarch64-linux-musl.tar.gz. The archive has the program ztk, the README, and the licenses. Put the program in a folder of your PATH:
tar -xzf ztk-VERSION-x86_64-linux-musl.tar.gz
mkdir -p ~/.local/bin
cp ztk-VERSION-x86_64-linux-musl/ztk ~/.local/bin/
The program needs no other package. It opens the Vulkan loader of the system when it exists, and it uses the CPU renderer when it does not.
From source
You need Zig 0.17.0 and glslc, the shader compiler of the Vulkan SDK or of the package shaderc (the package name differs on each distribution).
git clone https://github.com/beetlebugorg/ztk
cd ztk
# Makes zig-out/bin/ztk:
zig build -Doptimize=ReleaseFast
zig build with no -Doptimize makes a Debug program, with each safety check on. On Arch Linux, packaging/arch/ztk-git/PKGBUILD builds the package ztk-git from the main branch with makepkg -si.
Check the install
ztk version
ztk examples/platform-gallery.tcl
The second command needs the examples folder of the source, and a Wayland or an X11 session. It opens the widget gallery. This check needs no display:
printf 'puts [expr {6 * 7}]\nexit\n' > t.tcl
# Prints 42:
ztk --headless t.tcl
With no display, ztk app.tcl stops with the message ztk: no Wayland or X display. Use --headless, or run it in a desktop session.
The next page, Develop, runs your own script.