kato/INSTALL.md

2.3 KiB

Building and installing kato

There are three supported ways to build kato: using the rust-lang.org reference Rust compiler either through make(1) or with the standard Cargo-based build system, or using mrustc with minicargo.

If you are familiar with conventions around *nix software distribution and are building kato for your local unix-like system, you'll likely want to use make(1). Otherwise, you should probably choose Cargo.

Acquiring lexopt (if not building with Cargo)

Kato requires at least lexopt version 0.3.2. The makefile and minicargo expect to find it at vendor/lexopt.

Kato's git repository includes lexopt as a submodule at the correct location. If you have cloned the repository using git clone --recurse, you are already set up. If you cloned the repository without the --recurse option, you'll need to run git submodule update --init.

If you are building kato from a source archive, you'll need to choose one of the other options.

Download lexopt from crates.io using Cargo

cargo vendor

Download & extract lexopt release tarball

wcurl https://github.com/blyxxyz/lexopt/archive/refs/tags/v0.3.2.tar.gz &&
printf '%s  %s\n' \
   0280dbb7b4738dc550a169dd91cb5b865860e862f3121146f96d9fa1216c5006 \
   v0.3.2.tar.gz | sha256sum -c - &&
tar -xf v0.3.2.tar.gz &&
mkdir -p vendor &&
mv lexopt-0.3.2/ vendor/lexopt

Manually git clone lexopt into vendor/lexopt

git clone --revision=f52c6a620b59dcadb01701c039cd4b270e2d5966 \
   https://github.com/blyxxyz/lexopt vendor/lexopt

You can check the correct commit with git cat-file -p HEAD:vendor and the correct repository URL in .gitmodules.

Building and installing

make(1)

make
PREFIX=~/.local make install

Cargo

cargo build --release
cargo install --path .

cargo install will not install the manual page. You'll need to place kato.1 into the correct man directory yourself.

minicargo

MRUSTC_TARGET_VER=1.90 /usr/lib/rust/mrustc-0.12.0/bin/minicargo . \
   -L /usr/lib/rust/mrustc-0.12.0/lib/rustlib/x86_64-unknown-linux-gnu/lib

minicargo will produce an executable in output/kato. You'll need to install both it and kato.1 yourself.