kato/INSTALL.md
Juhani Krekelä 81367d9978 Spellcheck
2026-09-19 02:28:39 +03:00

90 lines
2.7 KiB
Markdown

# Building and installing kato
There are three supported ways to build kato: using the
[rust-lang.org reference Rust compiler](https://rust-lang.org) either
through make(1) or with the standard Cargo-based build system, or using
[mrustc](https://github.com/thepowersgang/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
Kato requires at least [lexopt](https://github.com/blyxxyz/lexopt)
version 0.3.2.
Kato's git repository includes lexopt as a submodule.
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
Change the line at the bottom of Cargo.toml which reads
lexopt = { version = "0.3.2", path = "vendor/lexopt" }
to instead read just
lexopt = "0.3.2"
and add to the section at the bottom of Cargo.lock which reads
[[package]]
name = "lexopt"
version = "0.3.2"
the two lines
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "803ec87c9cfb29b9d2633f20cba1f488db3fd53f2158b1024cbefb47ba05d413"
If you are building with Cargo, you are done.
If you want to instead build with make(1) or minicargo, you'll need to
still run `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 &&
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.