beetlebug

Install on macOS

This page installs the ztk program on a Mac and checks that it opens a window. Homebrew is the short way.

With Homebrew

brew install beetlebugorg/tap/ztk

Homebrew installs the release program for your Mac, Apple silicon or Intel. brew upgrade ztk gets a new release.

From the release archive

Each release has an archive for each Mac: ztk-VERSION-aarch64-macos.tar.gz for Apple silicon and ztk-VERSION-x86_64-macos.tar.gz for Intel. The archive has the program ztk, the README, and the licenses. Put the program in a folder of your PATH:

tar -xzf ztk-VERSION-aarch64-macos.tar.gz
mkdir -p ~/.local/bin
cp ztk-VERSION-aarch64-macos/ztk ~/.local/bin/

From source

Use the source to get the newest code, or to build the iOS runtime (iOS). You need:

  • Zig 0.17.0.
  • The Xcode command line tools: xcode-select --install.
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. Use it while you change ztk itself.

Check the install

ztk version
ztk examples/platform-gallery.tcl

The second command needs the examples folder of the source. It opens the widget gallery in a window. This check needs no window:

printf 'puts [expr {6 * 7}]\nexit\n' > t.tcl
# Prints 42:
ztk --headless t.tcl

The next page, Develop, runs your own script.