Overview of the BLAKE3 C Implementation
masterpextlib use case within MacPorts.repository·master·Indexed 21 days ago
https://github.com/macports/macports-baseSource code and documentation for the MacPorts command-line client, a package management system for macOS. Includes technical details on the vendored BLAKE3 C implementation (v1.8.4), configuration via macports.conf, and command references for port management such as activate, deactivate, archive, archivefetch, bump, cat, clean, and shell navigation.
pextlib use case within MacPorts.config.h file to manage feature flags (such as BLAKE3_NO_SSE2, BLAKE3_NO_SSE41, etc.). Instead of modifying the upstream headers directly, these defines are injected into the vendored sources using the compiler's -include flag. This ensures the src/ directory remains pristine.Release tarballs are .tar.bz2 and .tar.gz archives of the base repository, named MacPorts-<version>.tar.{bz2,gz}.
Use the top-level Makefile to generate tarballs and checksums. You can automatically sign them with a detached GPG signature using DISTGPGID or generate a signify(1) signature for selfupdate over HTTP using DISTKEY.
Commands:
make dist DISTVER=<version>make dist DISTVER=<version> DISTGPGID=<email_or_hex_id>make dist DISTVER=<version> DISTKEY=<path_to_secret_key># Generate tarballs with GPG signature
make dist DISTVER=2.0.0 DISTGPGID=<handle>@macports.org
# Generate tarballs with signify signature
make dist DISTVER=2.0.0 DISTKEY=/path/to/macports/macports-base-2024.secMacPorts releases include .pkg (flat packages for macOS 10.6+) or .dmg (disk images) installers.
Workflow:
port command to build the package. The Portfile must be updated with the new version and checksums.productsign with a Developer ID Installer certificate..pkg via xcrun notarytool or xcrun altool.xcrun stapler staple.openssl.Validation Checklist:
otool -L to ensure binaries/libraries (like daemondo or Tcl dylibs) do not link against anything outside a vanilla macOS installation + developer tools.file to confirm binaries are universal (e.g., Mach-O universal binary with 2 architectures).${destroot}/opt/local/bin use #!/opt/local/bin/port-tclsh to use the bundled interpreter..dmg mounts in Finder and the .pkg launches Installer.app correctly.# Build packages
sudo port -d pkg MacPorts
sudo port -d dmg MacPorts
# Sign package
productsign --sign "Developer ID Installer: John Doe" unsigned/MacPorts-2.0.0-10.7-Lion.pkg MacPorts-2.0.0-10.7-Lion.pkg
# Notarize (macOS 10.14+)
xcrun notarytool submit MacPorts-2.0.0-10.14-Mojave.pkg \
--apple-id <your-apple-id> --keychain-profile "notarytool" \
--wait
# Staple
xcrun stapler staple MacPorts-2.5.4-10.14-Mojave.pkg
# Generate checksums
for type in -md5 -sha1 -ripemd160 -sha256; do
openssl dgst $type MacPorts-2.0.0-*.{pkg,dmg} >> MacPorts-2.0.0.chk.txt
doneReleases must be tagged to ensure replicability. Use annotated, GPG-signed tags (-a -s).
Tagging Conventions:
v2.0.0-beta2v2.0.0-rc1v2.0.0v2.0.1Steps:
macports-base repository.macports-ports repository to provide a compatible set of ports.Example Workflow:
# Tagging base
git tag -a -s v2.0.0 release-2.0
git push origin v2.0.0
# Tagging ports archive
git clone macports/macports-ports macports-ports
cd macports-ports
git tag -a -s v2.0.0-archive origin/master
git push origin v2.0.0-archivegit tag -a -s v2.0.0 release-2.0
git push origin v2.0.0Before tagging a release, perform the following code updates:
ChangeLog file in both master and the release branch.config/macports_version with the target release number. This file is used by the port command and the selfupdate procedure.config/mp_version and config/dp_version at fixed values (1.800 and 1.710 respectively) if backwards compatibility for old installations is required../autogen.sh to update the autoconf configure script, as it reads from mp_version.Ensure all changes are merged between the release branch and master as necessary.
./autogen.sh
./standard_configure.sh
make -C doc/ clean all \
ASCIIDOC=/opt/local/bin/asciidoc \
XSLTPROC=/opt/local/bin/xsltproc \
DOCBOOK_XSL=/opt/local/share/xsl/docbook-xsl-nons/manpages/docbook.xslIf you need to update the BLAKE3 implementation to a newer version, follow these steps:
src/ with the new upstream files from the c/ directory of the official BLAKE3 repository.patches/ still apply cleanly to the new source; modify them if necessary.README.md file.port usage command to display a brief summary of all possible options for the port command. This output shows the canonical order in which the port command expects arguments and flags, mirroring the SYNOPSIS section of the man port(1) manpage.port usageFor each major release (e.g., 1.9.x, 2.0.x), create a dedicated git branch. This branch will host all alpha, beta, release candidates, and point releases. Only the macports-base repository is branched; the ports tree is handled separately.
To create the branch from master:
origin/master).release-2.0).Note: Once master begins development for the next major version, increase its version in config/macports_version by setting the patch-level to 99 (e.g., 2.0.99) to differentiate it from the release branch.
git branch release-2.0 origin/master
git push origin release-2.0To enable users to receive the new version via selfupdate, you must update the config/RELEASE_URL file in the macports-base repository with the new release tag. This file is used by the mprsyncup job to distribute the code via rsync.
You may also need to purge the CDN cache for distfiles.macports.org/MacPorts/RELEASE_URL to ensure the update propagates quickly.
daemondo is a wrapper program designed to run daemons on macOS. It acts as an adapter between launchd and traditional rc.d style scripts.
It provides the following lifecycle management:
daemondo receives SIGTERM or when a specific --stop-cmd is provided.SIGHUP or when specific system events occur (network changes, power state changes, or notifications).Operational Modes:
--stop-cmd is provided, daemondo executes the --start-cmd asynchronously and tracks the resulting PID. It uses this PID to signal the daemon for stops/restarts.--stop-cmd is provided, both start and stop commands are issued synchronously. In this mode, daemondo does not track a PID but relies on the provided commands to control the daemon.usage: daemondo [-hv] [--version]
--start-cmd prog args... ;
[--stop-cmd prog arg... ;]
[--restart-cmd prog arg... ;]
[--restart-wakeup]
[--restart-netchange]
[--restart-config regex... ;]
[--restart-dist-notify names... ;
[--restart-darwin-notify names... ;]