3 if command -v doas >/dev/null 2>&1; then
5 elif command -v sudo >/dev/null 2>&1; then
8 echo "Neither doas nor sudo found." >&2
12 # Manually specify package manager:
15 # Autodetect package manager:
16 elif command -v dnf >/dev/null 2>&1; then
18 elif command -v yay >/dev/null 2>&1; then
20 elif command -v paru >/dev/null 2>&1; then
22 elif command -v pacman >/dev/null 2>&1; then
24 elif command -v xbps-install >/dev/null 2>&1; then
26 elif command -v pkg_add >/dev/null 2>&1; then
28 elif command -v pkg >/dev/null 2>&1; then
30 elif command -v brew >/dev/null 2>&1; then
32 elif command -v port >/dev/null 2>&1; then
34 elif command -v zypper >/dev/null 2>&1; then
36 elif command -v nix-env >/dev/null 2>&1; then
38 elif command -v spack >/dev/null 2>&1; then
40 elif command -v conda >/dev/null 2>&1; then
42 elif command -v apt >/dev/null 2>&1; then
45 echo "Unsupported package manager" >&2
51 apt) $SUDO apt install libgc-dev libunistring-dev binutils libgmp-dev ;;
52 dnf) $SUDO dnf install gc-devel libunistring-devel binutils gmp-devel ;;
53 pacman) $SUDO pacman -S gc libunistring binutils gmp ;;
54 yay|paru) $PKG_MGR -S gc libunistring binutils gmp ;;
55 xbps) $SUDO xbps-install -S gc libunistring binutils gmp ;;
56 pkg_add) $SUDO pkg_add boehm-gc libunistring binutils gmp ;;
57 freebsd-pkg) $SUDO pkg install boehm-gc libunistring binutils gmp ;;
58 brew) brew install bdw-gc libunistring binutils llvm gmp ;;
59 macports) $SUDO port install boehm-gc libunistring binutils gmp ;;
60 zypper) $SUDO zypper install gc-devel libunistring-devel binutils gmp-devel ;;
61 nix) nix-env -iA nixpkgs.boehmgc.dev nixpkgs.libunistring nixpkgs.binutils nixpkgs.nixpkgs.gmp ;;
62 spack) spack install boehm-gc libunistring binutils gmp ;;
63 conda) conda install boehm-gc libunistring binutils gmp ;;
65 echo "Unknown package manager: $PKG_MGR" >&2