Skip to content

MacPorts Utility 0.9

Latest

Choose a tag to compare

@Zittersplitter Zittersplitter released this 22 Mar 10:40
· 2 commits to main since this release
b339ab1

Release Date: March 22, 2026
Author: Marcel Hartmann
Platform: macOS 14.0 (Sonoma) or later
Swift: 5.9+


Overview

MacPorts Utility v0.9 is the first public pre-release of a native macOS GUI for managing MacPorts packages. It provides a full-featured interface for searching, installing, uninstalling, and updating ports — replacing common command-line workflows with an intuitive SwiftUI experience.


Features

Search & Discovery

  • Full-text port search via the MacPorts CLI (port search) with real-time results
  • Category-based browsing across 16 categories (Development, Networking, Python, Ruby, Java, Databases, Web, Graphics, Audio, Video, Security, Sysutils, Text Processing, Editors, Perl, and All)
  • Category dropdown filter in the search tab — select a category to list all ports; type to narrow results by prefix
  • Port detail view with version info, description, category tags (FlowLayout), installed/update status, and on-demand port info loading

Install Queue

  • Persistent install queue stored in UserDefaults — survives app restarts
  • Cross-category selection — select ports from different categories and they remain queued
  • Sidebar queue panel with drag-to-reorder, per-item removal, clear all, and batch install
  • Global install queue bar at the bottom of the search view — collapsible, shows queued port count and names, with inline install and clear actions
  • Batch installation with a single admin authentication prompt (chained && commands)

Installed Ports Management

  • Installed ports list with version display
  • Text filter and sort (by name or version)
  • Select all / batch uninstall with single privilege escalation
  • Context menu support — right-click to uninstall or update individual ports
  • Summary bar showing port count

Updates

  • Outdated port detection via port outdated
  • Update badge on the sidebar with outdated port count
  • Individual, selected, or all-at-once updates
  • Select all toggle for batch update operations
  • Version comparison display (old version → new version)
  • Sync Port Tree (port selfupdate) accessible from toolbar and menu bar

User Interface

  • NavigationSplitView with collapsible sidebar
  • Split-pane detail views (45% list / 55% detail) in Search & Installed tabs
  • Appearance mode switching — System, Light, or Dark — persisted via @AppStorage
  • Full dark mode support with adaptive colors using NSColor appearance callbacks
  • Custom theme system with brand colors, semantic colors, adaptive surfaces, gradients, spacing scale, corner radius scale, and shadow system
  • Three custom button styles: Primary (gradient), Secondary (outlined), Accent (orange gradient)
  • Card and panel header view modifiers for consistent styling
  • Status bar with colored indicator dot (green = idle, amber = busy, red = error) and activity spinner
  • Console panel — toggleable, auto-scrolling, monospaced log output with timestamps; clearable via button or Cmd+K
  • Empty state views (ContentUnavailableView) for no search results, no installed ports, and up-to-date states
  • Hover-reveal action buttons on port rows
  • Alternating row backgrounds in list views
  • Category-based color coding — 14 distinct colors mapped to port categories
  • Category-based SF Symbol icons per port category
  • Drag and drop support on port rows and queue items
  • Animated transitions for console panel and UI interactions

Menu Bar

  • Custom About window with app icon, version, build number, author, and GitHub link
  • Install MacPorts menu item (Cmd+Shift+I) — links to macports.org download
  • Appearance submenu with checkmark indicators
  • Help menu — MacPorts Guide, MacPorts Website, GitHub Repository
  • Refresh Ports (Cmd+R), Sync Port Tree (Cmd+Shift+S), Clear Console (Cmd+K)

Graceful Degradation

  • MacPorts detection — if /opt/local/bin/port is not found, a full-screen overlay card prompts the user to download and install MacPorts
  • MacPorts version display in the sidebar Info section
  • Concurrency guard — prevents overlapping operations with a user-facing message

Security

  • Input validation: Port names validated against a strict character whitelist ([a-zA-Z0-9._\-+]) before any shell execution — prevents injection attacks
  • Shell escaping: shellQuoted() method escapes backslashes and double quotes for AppleScript command strings
  • Single-quoted arguments: Port names wrapped in single quotes inside do shell script commands
  • Hardcoded executable path: /opt/local/bin/port — no user-controlled path injection
  • AppleScript privilege escalation: Admin operations use do shell script ... with administrator privileges for proper macOS authorization (supports Touch ID where configured)
  • Hardcoded trusted URLs: All external links point exclusively to macports.org and github.com
  • Entitlement: com.apple.security.automation.apple-events for AppleScript execution
  • Partial failure detection: After batch operations, verifies actual install/uninstall state and reports discrepancies

Accessibility

  • accessibilityLabel on toolbar buttons, queue management buttons, console toggle, port selection checkboxes, action buttons, and refresh buttons
  • accessibilityHint on Sync button and console toggle
  • Text selection enabled on port info and console output

Logging & Diagnostics

  • OSLog integration — all operations logged with Logger (subsystem: bundle identifier, category: "PortsManager")
  • Console output — timestamped entries with operation details, capped at 50,000 characters to prevent memory growth
  • Error alerts — user-facing error dialog via lastError binding
  • Stderr filtering — known non-critical warnings suppressed from error output

Architecture

Layer Component Description
App Entry MacPortsUtilityApp Window configuration, menus, appearance
Models Port, PortCategory, PortOperationState, NavigationItem Data types and state machine
Services PortsManager Core service — CLI integration, state, queue, logging
Services SearchState Per-window search state with category filtering
Views ContentView, SearchView, InstalledView, UpdatesView, PortDetailView, PortRowView, AboutView UI layer
Theme AppTheme Design tokens, colors, gradients, button styles

Known Limitations

  • Requires MacPorts to be installed at /opt/local/bin/port
  • Admin operations require user authentication for each batch (system limitation)
  • No port dependency visualization
  • No port file/variant selection during install
  • No automatic update checking on launch

Requirements

  • macOS 14.0 (Sonoma) or later
  • MacPorts installed at the default location
  • Xcode 15+ to build from source

MacPorts Utility is not affiliated with the MacPorts Project.