Skip to content

Installation

Aziz edited this page Nov 11, 2024 · 56 revisions

Looking to build from source? Follow me.

Runtime dependencies

You may choose to install the following optional dependencies:

Linux:

  • wmctrl

NetBSD:

  • wmctrl

Pkgsrc

pkgin install macchina

openSUSE Tumbleweed

zypper in macchina

Homebrew

brew install macchina

Termux

pkg install macchina

Windows

scoop install macchina

Nix

nix-env -iA <channel>.macchina

<channel> can either be nixpkgs or nixos

Guix

guix install macchina

Arch Linux

pacman -S macchina

Cargo

cargo install macchina

Building from source

Build dependencies

The following are required dependencies if you're building from source or installing through cargo:

Quicklinks:


Build for Android

Make sure to replace the --target value with the corresponding toolchain for your Android device.

git clone --recurse-submodules https://github.com/macchina-cli/macchina
cd macchina
cross build --target aarch64-linux-android --release

You can push the executable to your Android device using adb (Android Debug Bridge).


Build for OpenWrt

Make sure to replace the --target value with the corresponding toolchain for your OpenWrt device.

git clone --recurse-submodules https://github.com/macchina-cli/macchina
cd macchina
cross build --target mipsel-unknown-linux-musl --features=openwrt --release
scp target/mipsel-unknown-linux-musl/release/macchina root@192.168.1.1:~/

Build for everything else

  1. Clone:
git clone --recurse-submodules https://github.com/grtcdr/macchina
cd macchina
  1. Build:

For normal usage, we recommend building an optimized binary. If you plan to work on macchina, then go with unoptimized. The performance difference between the two is very noticeable, but so is the compilation time.

  • To produce an optimized binary, run:
# macchina's binary will be placed in target/release/
cargo build --release
# the produced binary is quite huge, consider stripping it to reduce its size
strip target/release/macchina
# place the binary in your PATH, or run it through cargo.
cargo run --release
  • To produce an unoptimized binary, run:
# macchina's binary will be placed in target/debug/
cargo build
# place the binary in your PATH, or run it through cargo.
cargo run