zub is a Zig-native installer for Zig binaries published in the ZUB registry.
Its job is simple:
- install
zvmby default - detect the Zig version required by a package
- provision that Zig version automatically
- build the package
- place the resulting executable in
$HOME/.local/bin
The registry source is:
https://zub.javanile.org/packages.json
The intended bootstrap flow is:
curl -fsSL https://yafb.net/zub.zig/install.sh | bashThe published installer is stored at docs/install.sh in this repository.
The installer:
- installs
zvmif it is missing - installs a bootstrap Zig version
- builds
zub - installs
zubinto$HOME/.local/bin
Install a package from the registry:
zub install pbmSearch packages in the registry:
zub search httpWhat zub does under the hood:
- downloads the package index from
https://zub.javanile.org/packages.json - resolves the package repository from the registry entry
- clones or updates the source in the local cache
- reads
build.zig.zonto detectminimum_zig_versionwhen available - uses
zvmto install that Zig version - runs
zig build - copies the produced executable into
$HOME/.local/bin
- binary install dir:
$HOME/.local/bin - source cache:
$HOME/.cache/zub/src - temp build cache:
$HOME/.cache/zub/tmp
zubcurrently assumes registry package URLs follow the GitHub pattern/packages/<owner>/<repo>/.- if a package does not expose
minimum_zig_version,zubfalls back tomaster - build output resolution prefers
zig-out/bin/<package-name>and otherwise picks a single executable found inzig-out/bin
Build locally:
zig buildRun:
./zig-out/bin/zub