Somewhat similar to the build + install process for Haiku, the script linux-setup.sh provides a means of building and installing the haiku-format tool on an apt-based Linux system such as Debian or Ubuntu. See the main README.md file for general background about haiku-format.
The haiku-format files will be installed at /opt/haiku-format. The following files are installed;
| Files | Description |
|---|---|
bin/haiku-format |
the haiku-format native binary |
bin/git-haiku-format |
a git command to launch haiku-format |
The haiku-format binary is statically linked, which means it does not depend on any dynamic libraries part of LLVM/clang to run.
git clone https://github.com/owenca/haiku-formatcd "haiku-format"./linux-setup.sh buildsudo ./linux-setup.sh install
The installation's bin directory must be included in the PATH env-var. The following additional line at the end of your ${HOME}/.profile will ensure that this is configured;
export PATH="/opt/haiku-format/bin:${PATH}"
Restart your session and ensure that haiku-format can be executed by running;
haiku-format -h
If you would like to build again from scratch or would like to clean the build resources run;
./linux-setup.sh clean
sudo ./linux-setup.sh uninstall
You can format a source file by running;
haiku-format src/apps/haikudepot/model/Model.cpp
From a clone of the Haiku source code you can get a diff between a commit and the current state with;
git haiku-format f7d2fc176e09b850909d6608ac60e9b9a6f1bcbc --diff
Find out more about other options with git haiku-format -h.