macports

Guides MacPorts Portfile creation, testing, debugging, and upstream PR submission workflows.

Updated Oct 16, 2020
One-click install
npx skills add https://github.com/trodemaster/blakeports --skill macports-trodemaster
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: macports
Source: https://github.com/trodemaster/blakeports/tree/main/.claude/skills/macports
Command: npx skills add https://github.com/trodemaster/blakeports --skill macports-trodemaster

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? MacPorts port development involves many error-prone steps—writing Portfiles, updating checksums, debugging build failures, and following strict upstream submission rules. This Skill codifies the entire workflow so ports are built, tested, and submitted correctly the first time. ## Core Features & Use Cases - Portfile Authoring & Updates: Create new ports from a template, bump versions, and update checksums using the keep-old-checksums workflow, with helper scripts like check-updates.sh and bump-go-port.sh. - Testing & Debugging: Run the standard lint/clean/install test sequence, inspect build logs and work directories, and apply a catalog of common upstream build fixes (-Werror, missing includes, DESTDIR issues). - Upstream Submission Compliance: Enforce MacPorts commit message format, single-commit PRs, the official PR template, and mandatory user approval before committing or opening PRs. - Use Case: A maintainer needs to update a GitHub-hosted port to a new release—run check-updates.sh to detect it, update the version and checksums, test with test-port.sh, then draft a compliant commit message and PR for macports-ports. ## Quick Start Use the macports skill to update the netatalk4 port to the latest upstream release and prepare a compliant MacPorts pull request.

Frequently Asked Questions about macports

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update a MacPorts port to a new version?

Update the version field in the Portfile while keeping the old checksums, then run sudo port checksum <portname>. MacPorts fails and prints the correct checksums, which you paste into the Portfile and verify by running the checksum command again.

How do I test a MacPorts Portfile before submitting?

Run portindex, then port lint --nitpick <portname>, followed by sudo port clean --dist, uninstall, and sudo port install -sv. The test-port.sh script automates this full sequence, and lint must pass with zero errors and zero warnings.

Why does my MacPorts patch fail with 'No file to patch'?

MacPorts applies patches with patch -p0, so diffs must not contain a/ and b/ path prefixes. Regenerate patches from git using git diff --no-prefix, or set patch.pre_args-replace -p0 -p1 if carrying a -p1 patch verbatim.

What commit message format does MacPorts require for PRs?

The subject line lists modified ports followed by a colon in 50-55 characters, with a blank line and a body wrapped at 72 characters. PRs must contain exactly one commit, and checksum updates or revision numbers should never be mentioned.

How do I find missing dependencies in a MacPorts build?

Run sudo port -vst destroot <portname> to use trace mode, which reports every file the build touched outside declared dependencies. You can also run otool -L on built binaries and map libraries back to ports with port provides.

When should I bump the revision in a MacPorts Portfile?

In macports-ports submissions, bump revision when a change alters the installed binary without a version change, such as adding a dependency or patch. Build fixes for broken ports do not need a revbump, and revision resets to 0 when version increases.