MKPKG.CONF(5) File Formats Manual MKPKG.CONF(5)

mkpkg.conf — build and install configuration

/etc/mkpkg.conf

mkpkg.conf is read in three ways. mkpkg -g names another file for the first two.

Anything a shell script can set. The shipped file sets, among others:

, CXX
The compilers, clang and clang++.
, CXXFLAGS, CPPFLAGS, LDFLAGS
Compiler and linker flags.
Where pkgconf looks.
Flags for make(1), such as -j$(nproc).
, GOPATH
Caches for cargo and Go, set below SRC so they are part of the work directory.

Directory for downloaded sources, exported to the hooks as PKGMK_SOURCE_DIR. Default: the port directory.
Directory for built packages. Default: the port directory.
Work directory. Default: work in the port directory. An absolute path that does not end in /work, such as /dev/shm, is a place for work directories: each build uses its own mkpkg_pid below it.
A directory the full lockbox may write to; see lockbox(7). Default: /dev/shm.
The signify(1) secret key to sign ports with. Only port maintainers need it. Default: /etc/ports/keys/rawnix.sec.
Package compression: gz, xz, zst, bz2 or lz. It is also the file name extension. Parallel compressors are used when installed: pigz for gz, lbzip2 or pbzip2 for bz2, plzip for lz; xz and zst use all threads. Default: gz.
Like mkpkg -ic.
Like mkpkg -if.
Like mkpkg -is.
Do not strip binaries.

The last four are on for yes or 1, and off otherwise.

If yes, addpkg(8) installs a package that has files its .footprint does not list. Otherwise it refuses. Default: no.

/etc/mkpkg.conf
This file.

export CC=clang
export CXX=clang++
export CFLAGS="-O2 -pipe -march=x86-64-v3 -fstack-protector-strong"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-Wl,-O1 -Wl,--as-needed"
export MAKEFLAGS="-j$(nproc)"
export CARGO_HOME="$SRC/.cargo"

# build in RAM
MKPKG_WORK_DIR=/dev/shm
MKPKG_COMPRESSION_MODE=zst

IGNORE_NEW=no

MAKEPKG(5), addpkg(8), mkpkg(8)

An unknown MKPKG_COMPRESSION_MODE is compressed with gzip but still used as the extension.

September 27, 2026 mkpkg 1.6.0