Files
NexusOS/install-macos.sh
Athena KaminskyandClaude Opus 5 93d78c0ad3 feat(macos): native install path via Homebrew
install-macos.sh mirrors install.sh's split: every portable step - git pull,
venv, pip with the right overlay, npm build - stays in bin/sync.py, shared
with Linux and Windows. The script only does what sync.py cannot do for
itself on a bare Mac, which is install the Homebrew packages needed before a
Python exists to run sync.py with.

Two stages had to learn about darwin. ensure_exec_bits() keyed off
`os.name == "nt"`, which is false on macOS, so it ran the Linux path; and
requirements() had no darwin branch. linux_stage() now no-ops there, which is
what makes skipping the Ollama fetch correct rather than an omission:
bin/fetch-ollama.sh only ships a Linux x86-64 binary, and _ollama_bin() in
synapse/ollama_manager.py already prefers the bundled copy and falls back to
whatever `ollama` is on PATH. On macOS that is the brewed one, with Metal
acceleration and no flags needed.

The XFCE desktop branding is Linux-only and was already gated off macOS the
same way, so there is nothing to install for it here.

install-macos.sh joins the shell-parse list in bin/check.sh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 08:18:47 -05:00

44 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# NexusOS installer, macOS. One painless command:
#
# git clone <repo> nexus-core && cd nexus-core && ./install-macos.sh
#
# Mirrors install.sh's philosophy: every portable step - git pull, venv, pip
# with the right overlay, npm build - lives in bin/sync.py, shared with Linux
# and Windows. This script only does what sync.py can't do for itself on a
# bare Mac: install the Homebrew packages needed before Python even exists to
# run sync.py with. Re-run any time to update; --check dry-runs it.
#
# Ollama itself is *not* fetched here - bin/fetch-ollama.sh only ships a Linux
# x86-64 binary, and linux_stage() in bin/sync.py already no-ops on macOS, so
# that stage is skipped entirely. The Homebrew `ollama` installed below is
# picked up automatically instead: synapse/ollama_manager.py prefers the
# bundled Linux binary and falls back to whatever `ollama` it finds on PATH,
# which on macOS is this one - with full Metal GPU acceleration, no flags
# needed. The XFCE desktop branding (theme/panel/splash) is Linux-only and
# already gated off macOS the same way; nothing to install for it here.
set -euo pipefail
cd "$(dirname "$0")"
if ! command -v brew >/dev/null; then
echo "Homebrew is required (it installs Python/Node/git/Ollama)." >&2
echo "Install it, then re-run this script: https://brew.sh" >&2
exit 1
fi
echo "Installing/checking system packages (python@3.12, node, git, ollama)..."
brew install python@3.12 node git ollama
py="$(brew --prefix python@3.12)/bin/python3.12"
if [ ! -x "$py" ]; then
echo "python3.12 not found at $py after brew install - check 'brew doctor'." >&2
exit 1
fi
# Prefer the venv interpreter once it exists, same as install.sh; the brewed
# interpreter above is only the bootstrap case on a fresh clone. sync.py is
# stdlib-only either way.
[ -x "Promethean/bin/python" ] && py="Promethean/bin/python"
exec "$py" bin/sync.py restore "$@"