installing cube

spinning cube (and the other platonic solids) for your terminal

gentoo
emerge --ask app-eselect/eselect-repository
eselect repository add nburch git https://github.com/noahburchell/nburch-overlay.git
emaint sync --repo nburch
emerge --ask app-misc/cube
cube --help
nix

run it without installing anything:

nix run github:noahburchell/cube
nix run github:noahburchell/cube -- --icosahedron

install it into your profile:

nix profile install github:noahburchell/cube

or add it to a flake:

{
  inputs.cube.url = "github:noahburchell/cube";

  # then, in your config:
  #   environment.systemPackages = [ inputs.cube.packages.${pkgs.system}.default ];
  # or, with the overlay:
  #   nixpkgs.overlays = [ inputs.cube.overlays.default ];
  #   environment.systemPackages = [ pkgs.cube ];
}
brew (macos)

you need xcode 16.3+ (apple clang 17).

brew install noahburchell/cube/cube
source

you need make (gmake on the bsds) and gcc 14+ or clang 19+.

get the source

grab the release tarball:

curl -LO https://github.com/noahburchell/cube/archive/refs/tags/v1.2.tar.gz
tar xf v1.2.tar.gz
cd cube-1.2

or clone the repo:

git clone --depth 1 https://github.com/noahburchell/cube.git
cd cube
linux
make -j"$(nproc)"
sudo make install
cube --help

make install puts the binary in /usr/bin. if you don't have root, or you just don't want it there:

make install PREFIX="$HOME/.local" # make sure its in path
macos

you need xcode 16.3+ (apple clang 17). older xcode accepts -std=gnu23 but has no c23 constexpr, so the build will fail. if that happens:

brew install llvm
make CC="$(brew --prefix llvm)/bin/clang"

homebrew gcc works too. then:

make -j"$(sysctl -n hw.ncpu)"
sudo make install
cube --help
bsd
gmake -j"$(sysctl -n hw.ncpu)"
sudo gmake install
cube --help

freebsd 14.2+ has a new enough clang in base. on openbsd and netbsd, install one from packages/pkgsrc and the makefile will find it on its own: it looks for clang19, clang20, gcc14, gcc15 and egcc on path.

usage
usage: cube [option]

options:
  -h, --help          show this help

shapes:
  -c, --cube          (default)
  -t, --tetrahedron
  -o, --octahedron
  -d, --dodecahedron
  -i, --icosahedron

q or esc quits