mkpkg.conf

build and install configuration for mkpkg

Synopsis

/etc/mkpkg.conf

Description

mkpkg.conf

is sourced as a shell script by mkpkg(8) during the shell(), build(), and post_build() hooks. The extract() and patch() hooks do not source this file. It defines compiler flags, parallel jobs, directory paths, and install-time behaviour.

Variables

Compiler

CC
C compiler. Default: clang .
CXX
C++ compiler. Default: clang++ .

Flags

CFLAGS
C compiler flags.
CXXFLAGS
C++ compiler flags.
LDFLAGS
Linker flags.
CPPFLAGS
Preprocessor flags.
PKG_CONFIG_PATH
Colon-separated list of pkg-config directories.
MAKEFLAGS
Flags passed to make (1). Commonly set to -j $(nproc) for parallel builds.

Build Directories

CARGO_HOME
Rust cargo cache directory. Default: $SRC/.cargo .
GOPATH
Go module directory. Default: $SRC/.go .

mkpkg Directory Settings

These are

not

exported as environment variables. They are parsed directly by mkpkg(8).
MKPKG_SOURCE_DIR
Directory for downloaded source files. Default: port directory.
MKPKG_PACKAGE_DIR
Directory for built package archives. Default: port directory.
MKPKG_WORK_DIR
Build work directory. Default: ./work .
MKPKG_TMP_DIR
Temporary directory for signature verification. Default: /dev/shm .

Compression

MKPKG_COMPRESSION_MODE
Package archive compression. One of: gz, bz2, xz, lz, zst . Default: gz .

Signature Keys

MKPKG_SECRET_KEY
Path to the signify secret key for signing. Only needed by port maintainers. The public key is embedded per-port via the signify() function in each MAKEPKG. See MAKEPKG(5).

Build Options

MKPKG_IGNORE_CHECKSUMS
Skip checksum verification. yes / no . Default: no .
MKPKG_IGNORE_SIGNATURE
Skip signature verification before build. yes / no . Default: no .
MKPKG_NO_STRIP
Disable binary stripping. yes / no . Default: no .

Install Options

IGNORE_NEW
Controls how addpkg(8) handles packages that contain files not listed in the stored .footprint .
no
Block installation and print the new files. Default.
yes
Accept new files silently and install.

Example

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 CPPFLAGS="-I/include"
export PKG_CONFIG_PATH="/lib/pkgconfig:/usr/lib/pkgconfig"
export MAKEFLAGS="-j$(nproc)"

export CARGO_HOME=$SRC/.cargo
export GOPATH=$SRC/.go

#MKPKG_SECRET_KEY="/etc/ports/keys/zorz.sec"
#MKPKG_IGNORE_CHECKSUMS="no"
#MKPKG_IGNORE_SIGNATURE="no"
#MKPKG_NO_STRIP="no"

IGNORE_NEW=no

See Also

LLVM musl libc libressl Independent