MacBook with MacPorts

Set up an Intel-chip MacBook as developer machine using MacPorts as package manager.

Introduction

This document covers how to set up an Intel-chip (x64) Macbook as a developer machine, using MacPorts as the package manager.

This is intended for old Macbooks whose OS has dropped out of Homebrew Tier 1 support. For example, when macOS Tahoe was released, Ventura dropped to Homebrew Tier 3 support. A 2017 Macbook Pro cannot upgrade beyond Ventura, so it has to use MacPorts. Since Tahoe is the last macOS that supports x64, eventually all Intel-chip Macbooks have to use MacPorts instead of Homebrew.

All commands on this page should be executed from the user’s home directory.

See MacBook with Homebrew for setting up an ARM64 MacBook using Homebrew as the package manager.

Install xcode command line tools

xcode-select --install

Install macports

Use the GUI installer downloaded from the MacPorts website. Choose to use the “default prefix” during installation.

Use the macOS default Terminal app. Add the following line to both ~/.zshrc and ~/.bash_profile. Restart terminal.

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"

Perform initial selfupdate.

sudo port selfupdate

Use the latest version of bash

sudo port install bash bash-completion

Put bash inside /usr/local/bin and add it to /etc/shells.

pushd /usr/local/bin
sudo ln -s /opt/homebrew/bin/bash
popd
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells

Change the default shell for human admin user to /usr/local/bin/bash.

chsh -s /usr/local/bin/bash

Change the default shell for root to /bin/bash.

sudo chsh -s /bin/bash

Restart computer for the default shell change to take effect.

Install ghostty

Go to the download page. Download the package installer and use it.

From now on perform all CLI operations in Ghostty.

Install essential utilities

sudo port install curl jq yq fzf bat tree

Install coding tools

When coding, run NeoVim inside Tmux sessions.

sudo port install git neovim ripgrep lua-luarocks tmux pre-commit

Install go

sudo port install go

Install uv

sudo port install uv

Install fnm

fnm is a Node versions manager that doesn’t cause a noticeable slow down at activation. The CLI interface is largely similar to that of nvm.

sudo port install fnm

Install aws cli v2

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
rm AWSCLIV2.pkg

Install github cli

For authentication against GitHub, the most convenient option is to use the GitHub CLI. To install, run the following commands.

sudo port install gh

Login immediately.

gh auth login

Install shellcheck

sudo port install shellcheck

Set up GPG to sign git commits

Install gnupg and pinentry-mac. The former is the GPG software while the latter is a GUI for prompting for passphrases.

sudo port install gnupg2 pinentry-mac
echo "pinentry-program $(which pinentry-mac)" >>  ~/.gnupg/gpg-agent.conf

Restart gpg-agent.

gpg-connect-agent reloadagent /bye

Enter GPG interactive mode by gpg --card-edit, and then enter the fetch and quit command in order. The outputs would be something like below.

gpg/card> fetch
gpg: requesting key from 'https://github.com/kxue43.gpg'
gpg: key C9EED408F4B6D021: "Sato Seinosuke (kxue43.github.io) <kxue43@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

gpg/card> quit

Then use gpg --list-secret-keys to confirm that the keys have been fetched. The outputs should be something like below.

[keyboxd]
---------
sec>  rsa4096 2025-12-24 [SC]
      5EF2BE73370DCE7E808814DBC9EED408F4B6D021
      Card serial no. = 0006 27538718
uid           [ unknown] Sato Seinosuke (kxue43.github.io) <kxue43@gmail.com>
ssb>  rsa4096 2025-12-24 [E]

Install go executables

go install github.com/kxue43/cli-toolkit/cmd/toolkit@latest
go install github.com/kxue43/cli-toolkit/cmd/toolkit-assume-role@latest
go install github.com/kxue43/cli-toolkit/cmd/toolkit-serve-static@latest
go install github.com/kxue43/cli-toolkit/cmd/toolkit-show-md@latest
go install mvdan.cc/sh/v3/cmd/shfmt@latest
go install golang.org/x/tools/cmd/godoc@latest
go install golang.org/x/pkgsite
go install github.com/air-verse/air@latest

Install rust executables

cargo install --locked tree-sitter-cli

Install claude code

brew install --cask claude-code

Set up personal platform

mkdir -p ~/.config
git clone https://github.com/kxue43/substance ~/.config/substance
~/.config/substance/set-up.sh

Restart the terminal so that Bash start-up files take effect. Then open up nvim and run :MasonInstallAll, :TSInstallAll, :checkhealth.