MacPorts package manager development workflow including Portfile creation, updates, testing, debugging build failures, and port command usage. Use when working with MacPorts ports, Portfiles, port testing, version updates, checksum updates, dependency management, build debugging, or any MacPorts development tasks.
Comprehensive guide for MacPorts port development workflows: creating and updating Portfiles, testing ports, debugging build failures, and mastering the port command-line tool.
Check if any GitHub-hosted or SVN-hosted ports have new versions available:
scripts/check-updates.sh # Check all ports in current directory
The script will:
Supported sources:
Script available: scripts/check-updates.sh automates version checking.
Standard test sequence for any port modification:
portindex # Regenerate port index
port lint --nitpick <portname> # Strict compliance check
sudo port uninstall <portname> # Remove existing installation
sudo port clean --dist <portname> # Clear downloaded files
sudo port install -sv <portname> # Install with verbose output
Script available: scripts/test-port.sh <portname> automates this sequence.
When bumping version number:
version field in Portfilesudo port checksum <portname>sudo port checksum <portname> again to verifyWhy keep old checksums: MacPorts needs them present to fetch the new file and calculate correct checksums.
Script available: scripts/update-checksums.sh <portname> guides this workflow.
# 1. Create directory structure
mkdir -p category/portname
cd category/portname
# 2. Create Portfile (use template from assets/Portfile.template)
# 3. Generate checksums
portindex
sudo port checksum portname
# 4. Test
port lint --nitpick portname
sudo port install -sv portname
Template available: assets/Portfile.template provides standard structure.
CRITICAL REQUIREMENTS:
gh pr create — always show the full PR description to the user and wait for explicit approval. This is a strict rule with no exceptions.--nitpick)Subject line (50-55 characters, max 60):
Examples: