Build Hangar
Hangar is written in Golang.
You can follow the below instructions to build hangar executable binary.
Building in a container
-
Requirements:
- Ensure
docker
,curl
,make
installed. - Hangar only supports Linux & Unix systems.
- Ensure
-
Clone the source code.
git clone https://github.com/hangar.git && cd hangar
-
Build hangar in container by executing
make
commands:# Get help information
make help
# Build hangar in container
make build -
The built binary file is available in
bin
directory.
Building without a container
-
Install following build dependencies:
- Golang >=
1.22.2
# Arch Linux
sudo pacman -S base-devel gpgme device-mapper btrfs-progs
# Ubuntu/Debian
sudo apt install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config gcc
# macOS
brew install gpgme
# openSUSE
sudo zypper install libgpgme-devel device-mapper-devel libbtrfs-devel glib2-devel
# Fedora
sudo dnf install gpgme-devel libassuan-devel btrfs-progs-devel device-mapper-devel - Golang >=
-
Clone the source code.
git clone https://github.com/hangar.git && cd hangar
-
Build hangar by execute build scripts manually:
./scripts/build.sh
-
The built binary file is available in the
bin
directory.
Disable CGO
You can add DISABLE_CGO=1
environment variable when building hangar with CGO disabled.
note
Keep in mind that the resulting binary is unsupported and might crash randomly. Only use if you know what you're doing!