Install otok
otok is one program with no dependencies of its own. The tools the recipes need to build (CMake, Ninja, Python, Meson, make and others) are built or downloaded by their own recipes, so you install only what builds for your target: Xcode, Visual Studio, the Android NDK or a Linux compiler.
With Homebrew:
brew install otok-dev/tap/otokThe Apple target builds with the Xcode that xcode-select -p shows; install Xcode from the App Store and open it
once to accept its license. otok fetches sources with git, which Xcode’s command line tools provide.
Windows
Section titled “Windows”With Scoop:
scoop bucket add otok https://github.com/otok-dev/scoop-bucketscoop install otokThe Windows target builds with Visual Studio 2022 or 2026 and its Desktop development with C++ workload
(otok finds the newest installation by itself). otok needs git on the PATH (scoop install git).
Builds run in an AppContainer, the sandbox of Windows, which needs no administrator rights. Keep otok-sandbox.dll
beside otok.exe (Scoop and the release archive have both): otok puts it in every process of a build, so that the
build tools run unchanged in the container (what it does, and why).
A toolchain elsewhere than Program Files, such as an NDK on another drive, must be made readable to the container
once (how).
The build tools of Windows fail on paths longer than 260 characters, whatever LongPathsEnabled says, and a library’s
sources, its dependencies and the cache add up to that quickly. So builds see the cache and their work directories
through short drive letters, such as P:\lz4-windows-x86_64\: the first free letters, mapped for otok and the
processes of its builds only, never for the rest of the system, and gone when otok exits. Paths in a build’s log are
written with them; its first lines name the directory behind each letter, one for the cache and one for the work
directories of the builds:
otok: O: is C:/Users/me/AppData/Local/otok/cacheotok: P: is C:/Users/me/AppData/Local/otok/cache/tmp/12345-1f2e3d4c/buildSo P:\lz4-windows-x86_64\build\ further down the log is
C:\Users\me\AppData\Local\otok\cache\tmp\12345-1f2e3d4c\build\lz4-windows-x86_64\build\. These lines are notes for
the reader, not commands: the letters exist before the build starts. --no-virtual-paths (or
virtual-paths = false in config.toml) gives builds the real paths.
One command installs the latest release in ~/.local/bin, and updates it when run again:
curl -fsSL https://otok-dev.github.io/install.sh | shThe release binary is static, with musl built in: it loads no library, so it runs on every
distribution, old or new, whatever its C library (glibc, or musl as on Alpine). There are binaries for x86-64 and
ARM64; on other architectures, or on a system older than its kernel needs (Linux 3.x),
build otok from source. otok finds the certificates of the common distributions by itself; where
yours keeps them elsewhere, SSL_CERT_FILE names the file. The script checks the download against the release’s
.sha256; --version 0.5.0 installs another release,
--dir /usr/local/bin another directory (sh -s -- --version 0.5.0). By hand: download
otok-<version>-linux-x64.tar.gz (or -linux-arm64) from the latest release
and put otok on your PATH:
tar -xzf otok-0.5.18-linux-x64.tar.gzinstall -m 755 otok-0.5.18-linux-x64/otok ~/.local/bin/otokHomebrew works on Linux too and builds otok from source: brew install otok-dev/tap/otok.
The libraries otok builds are your system’s, not otok’s: they are compiled by its GCC or Clang against its C library,
so on Alpine they link musl. otok runs every build in bubblewrap, so
bwrap must be on the PATH:
sudo apt install git build-essential bubblewrapWithout it otok stops before the first build; --no-sandbox (or sandbox = false in
config.toml) builds unisolated, in a container that is itself the isolation, for example.
Android
Section titled “Android”The Android target needs the NDK on any of the three systems. otok
takes the newest NDK of the Android SDK (as Android Studio installs it), or the one ANDROID_NDK_HOME names, or
android-ndk of config.toml.
Build from source
Section titled “Build from source”On macOS, Homebrew already does: the formula builds otok from the release’s source archive on your Mac. Elsewhere, or to check a release binary, build it yourself.
The source. Every release has otok-<version>.tar.gz with its
.sha256, the complete source with its submodule; or clone the tag:
git clone --recurse-submodules --branch v0.5.18 https://github.com/otok-dev/otokWhat it needs. A C++23 compiler (Visual Studio 2026, or the GCC and Clang of a current Linux, or Xcode’s Clang),
CMake 3.25 or later with Ninja, and a checkout of vcpkg, from which otok’s
dependencies (libcurl, libarchive, toml++ and others) are built and linked statically. The versions of the
dependencies are pinned by the baseline in vcpkg-configuration.json.
As the releases are built
Section titled “As the releases are built”The scripts that build the release binaries are in the source, tools/release/; GitHub Actions runs them at every
release tag (.github/workflows/release.yml). Run the one of your system, with VCPKG_ROOT naming your vcpkg:
VCPKG_ROOT=~/vcpkg tools/release/linux.sh # Linux, on Alpine: build/release-linux/VCPKG_ROOT=~/vcpkg tools/release/macos-universal.sh # macOS: build/release-macos/$env:VCPKG_ROOT = "C:\vcpkg"; tools\release\windows-x64.ps1 # Windows: build\release-windows\Each builds otok without its tests, checks that it loads only the system’s own libraries (on Linux none: the binary is static), and packs it as the release does.
With CMake
Section titled “With CMake”cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmakecmake --build buildctest --test-dir buildThe tests need no network. -DOTOK_BUILD_TESTS=OFF builds otok alone. On Windows, add
-DVCPKG_OVERLAY_TRIPLETS=triplets -DVCPKG_TARGET_TRIPLET=x64-windows-otok, the triplet of static libraries with the
dynamic CRT that the solution uses too (vcpkg’s default on Windows builds DLLs). vcpkg needs its own prerequisites to
build the dependencies: on Linux git curl zip unzip tar pkg-config and a Perl.
With Visual Studio
Section titled “With Visual Studio”The solution otok.slnx builds otok and its tests with MSBuild. With vcpkg checked out beside the source (..\vcpkg,
or VCPKG_ROOT naming it), install the dependencies once, then open the solution or build it from a developer prompt:
vcpkg-install.cmdmsbuild otok.slnx /p:Configuration=Release /p:Platform=x64build\vs\x64\Release\otok-tests.exeotok.exe is in build\vs\x64\Release\.
otok --versionotok search zlibotok search reads the public index of recipes: if it answers, otok is ready.
© 2026 Alexander A Pototskiy and contributors. Text CC BY 4.0; examplesCC0.