Ports use the same category/port layout as the OpenBSD ports tree,
including nested subports grouped under a shared directory
(category/group/port, like sysutils/uutils/awk).
The categories currently present are databases, devel, editors,
games, graphics, mail, misc, multimedia, net, security,
shells, sysutils, textproc, www and x11.
List the installable paths without checking out or changing anything:
./fetch-ports.ksh --listPorts creating daemon accounts also need their entries from user.list.
The copy helper merges these entries into the cloned tree, preserving
upstream entries and refusing conflicting IDs or account names. Do not
overwrite a newer tree's complete registry with this repository's snapshot.
Configure the ports tree in the usual OpenBSD way:
- set
WRKOBJDIR - set
DISTDIR - set
PACKAGE_REPOSITORY - use
doasorsudoas your privilege helper
Use --copy-only to install ports into an existing CVS or Git checkout.
It does not check out a tree, create system accounts or change host
configuration. Omit the port arguments to copy all ports:
doas ./fetch-ports.ksh --copy-only /usr/ports net/simplexmq net/simplex-chat
doas ./fetch-ports.ksh --copy-only /usr/portsEach port is copied to its existing category, never over the complete
category directory. Replaced ports are saved under
TREE/.wip-backups/category-port.XXXXXXXX/port (the category slashes are
replaced by underscores for a nested subport); nested CVS metadata is
preserved. Before the swap the script records the files that are about to
be removed and added in TREE/.wip-changes/category-port.created.txt and
TREE/.wip-changes/category-port.deleted.txt (one path per line, relative
to the port root, CVS metadata excluded), so cvs add, cvs remove and a
later cvs diff can be driven from them. Copying a nested subport also
installs the files its group shares with the subports, for example
Makefile.inc, without touching any sibling port. Stale patches are not
carried into the new copy. Paths that name categories, traverse parents or
use symlinked port roots are rejected. The local account entries from
user.list are merged as well. Files become readable by the ports build
user even when the Git checkout is private.
Without arguments the script retains its interactive OpenBSD bootstrap
workflow, which replaces the ports checkout and configures the host.
Use --copy-only when you already have a checkout. Use --no-provision
to keep the interactive workflow but skip creating the user account
and configuring doas:
doas ./fetch-ports.ksh --no-provisionEvery patch has one target file and an Index: header. Dependency
sources requiring LF conversion are normalized with dos2unix before
dependency patches.
From the port directory:
make clean
make fetch
make makesum
make patch
make configure
make build
make fake
make update-plist
make port-lib-depends-check
make packageNot every target is always useful for every port, but this is the standard order when you are refreshing or validating a port.
Ports that use devel/cargo, lang/go or devel/cabal keep generated
dependency data next to the Makefile:
editors/mseditusesdevel/cargoandcrates.inc.sysutils/uutilsis a group of subports (coreutils,findutils,diffutils,grep,sed,awk,tar); each builds one project and keeps its owncrates.inc.devel/checkmake,devel/crush,devel/github-cli,devel/gum,devel/sequin,devel/shfmt,devel/soft-serve,net/wishlist,net/xd-torrentand the other Charm CLI/TUI ports underdatabases,graphics,mail,misc,multimedia,securityandtextprocuselang/goandmodules.inc.devel/fourmolu,net/simplexmqandnet/simplex-chatusedevel/cabalandcabal.inc.
Never edit these files by hand. Regenerating them needs network access, while the regular build must stay offline. The short form for each module:
# devel/cargo, for example editors/msedit
make clean
make makesum
make extract
make modcargo-gen-crates > /tmp/crates.inc
cp /tmp/crates.inc crates.inc
make clean
make makesum
make modcargo-gen-crates-licenses > /tmp/crates.inc
mv /tmp/crates.inc crates.inc
# lang/go, for example net/xd-torrent
make clean
make modgo-gen-modules > modules.inc
make makesum
# devel/cabal, for example net/simplexmq
make clean
make makesum
make cabal-inc
make makesumEach sysutils/uutils subport builds a single project from a single
Cargo.lock, so the regular make modcargo-gen-crates sequence above
applies inside its directory. Refresh the pinned revision in the
subport Makefile first: GH_TAGNAME for the released projects, and
AWK_COMMIT/INDEXMAP_COMMIT or TAR_COMMIT/UUCORE_COMMIT plus the
matching DIST_TUPLE entries for the unreleased ones.
UPDATE.md has the complete procedure: which version variables to bump, how to refresh patches, and how to validate the result.
The Monero port is a CMake-based C++ port.
Recommended workflow:
cd /usr/ports/net/monero
make clean
make fetch
make makesum
make patch
make configure
make build
make fake
make update-plist
make port-lib-depends-check
make packageNotes:
make configureis the first useful gate for CMake dependency problems.make port-lib-depends-checkcatches missing or extra shared-library deps.make update-plistshould be run afterfakewhenever installed files change.- The current OpenBSD port disables Monero stack-trace detection via
the
DEPENDSCMake path, soconfigureshould not try to resolve a standalonelibunwindpackage on this tree.
The XD torrent port is a Go port and uses modules.inc for vendored
module metadata.
Recommended workflow:
cd /usr/ports/net/xd-torrent
make clean
make fetch
make makesum
make patch
make configure
make build
make fake
make update-plist
make port-lib-depends-check
make packageWhen upstream go.mod or go.sum changes:
make modgo-gen-modules > modules.inc
make makesumNotes:
modules.incis the file that records the module list and replacement module hashes used by the OpenBSD Go ports infrastructure.make port-lib-depends-checkis still worth running because the final binary may link against native libraries even when the source is Go.make update-plistis needed if the binary set or installed symlinks change.- See UPDATE.md before bumping the version; it covers the
full
modules.incregeneration and module checksum workflow.
The MS Edit port is a Rust port that uses the devel/cargo module and
records its crate set in crates.inc.
Recommended workflow:
cd /usr/ports/editors/msedit
make clean
make fetch
make makesum
make patch
make configure
make build
make fake
make update-plist
make port-lib-depends-check
make packageNotes:
crates.incis generated withmake modcargo-gen-cratesandmake modcargo-gen-crates-licenses; see UPDATE.md for the update procedure.MODCARGO_INSTALLisNo; theeditbinary and the license file are installed by the port's owndo-installtarget.- ICU is loaded with
dlopen();MODCARGO_ENVpins the library sonames and disables upstream's renaming auto-detection. - The port defines its own
do-testtarget that exercises theedit,lshandstdextcrates.
The SimpleXMQ port uses the devel/cabal module and builds two
servers as well as a Haskell client library. It pins several vendored
GitHub dependencies via DIST_TUPLE and patches them from files/.
The cabal.inc file is generated by the cabal-inc target (run
manually when the port is refreshed). The target uses cabal-bundler
from Hackage to produce the MODCABAL_MANIFEST.
A dedicated _simplexmq user and group are created for running the
servers. See pkg/README for server initialization instructions.
XFTP server initialization requires --sign-algorithm ED25519 because
LibreSSL does not export ED448. The ED448 fallback is documented in
pkg/README and in the rc.d scripts.
When upstream releases are updated or MODCABAL_MANIFEST drifts:
cd /usr/ports/net/simplexmq
make clean
make makesum
make cabal-inc
make makesumThe first make makesum records the new upstream and DIST_TUPLE
checksums; cabal-inc then rewrites cabal.inc; the second one adds
the Hackage tarballs from the new manifest to distinfo. See
UPDATE.md for the complete version-bump procedure.
cd /usr/ports/net/simplexmq
make do-testThis runs the upstream test suite (simplexmq-test) using
cabal v2-test. The test target uses allow-newer: * from the
patched cabal.project to resolve dependency bounds. Network access
is required on the first test run to download test-only dependencies.
Build time (reference): ~2 hours on amd64 with 4 jobs.
The SimpleX Chat port is a client-only build that depends on a
patched, vendored copy of the simplexmq library. It uses the
devel/cabal module.
The client port vendors the same simplexmq commit through DIST_TUPLE
and applies a subset of the same patches. The server-side patches
(keepalive, warp, server mains, web embedding) are not needed for the
client and are omitted.
The client links against databases/sqlcipher at runtime. The build
uses the vendored direct-sqlcipher and sqlcipher-simple Haskell
bindings. LIB_DEPENDS on sqlcipher ensures the native library is
available when the binary starts.
cd /usr/ports/net/simplex-chat
make clean
make makesum
make cabal-inc
make makesumSee UPDATE.md for the version variables and patch sets to refresh when upstream moves.
cd /usr/ports/net/simplex-chat
make do-testThis runs the upstream test suite (simplex-chat-test) using
cabal v2-test with the same allow-newer: * bound relaxation.
The suite is run without the CI environment variable. The examples that are
inherently wall-clock sensitive or need an interactive terminal were made
deterministic by the port patches (larger TTLs, synchronous expiry and bounded
polling) or are skipped explicitly; see the comments in
patches/patch-tests_*.
Save query plans compares the SQLite EXPLAIN QUERY PLAN output collected
during the run with the checked-in files, which are platform-specific. On
OpenBSD they must be regenerated once and installed from files/:
cd /usr/ports/net/simplex-chat
make do-test SIMPLEX_UPDATE_QUERY_PLANS=1
cp /usr/obj/ports/simplex-chat-*/simplex-chat-*/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt files/
cp /usr/obj/ports/simplex-chat-*/simplex-chat-*/src/Simplex/Chat/Store/SQLite/Migrations/agent_query_plans.txt files/
make clean && make do-testSIMPLEX_UPDATE_QUERY_PLANS=1 makes the test write the plans without
asserting them. Until the OpenBSD files are installed from files/, the
example only writes the plans and does not assert, so the default
make do-test is green. Once files/chat_query_plans.txt and
files/agent_query_plans.txt exist, post-patch installs them and the
example verifies them (SIMPLEX_QUERY_PLANS_PLATFORM=1).
After packaging, the important checks are:
make update-plistif the installed file list changed.make port-lib-depends-checkif shared-library dependencies changed.make packageto verify the final package assembly.
For a quick smoke test, install the package and run the main binaries
manually. For Monero, that usually means starting monerod or
checking the CLI binaries. For XD, confirm that XD and the
XD-CLI symlink are present and start with a known config file.
For SimpleXMQ servers, run
doas -u _simplexmq /usr/local/bin/smp-server init and then
doas rcctl start smp_server. For the SimpleX Chat client, run
/usr/local/bin/simplex-chat directly.