MKPKG.CONF

build 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, and directory paths for the build system.

Variables

Compiler

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

Flags

CFLAGS
C compiler flags.
CXXFLAGS
C++ compiler flags. Typically set to $CFLAGS .
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 the mkpkg binary.
MKPKG_SOURCE_DIR
Directory for downloaded source files. Default: the port directory.
MKPKG_PACKAGE_DIR
Directory for built package archives. Default: the port directory.
MKPKG_WORK_DIR
Build work directory. If set to an absolute path not ending in /work , mkpkg appends /pkgmk_ PID for unique tmpfs builds. 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 maintainers who sign ports. Default: /etc/ports/keys/opentux.sec .
The public key is no longer configured here. It is embedded in each MAKEPKG via the signify() function. See MAKEPKG(5).

Build Options

MKPKG_IGNORE_FOOTPRINT
Skip footprint check. yes / no . Default: no .
MKPKG_IGNORE_NEW
Treat new files in footprint as OK. yes / no . Default: no .
MKPKG_IGNORE_CHECKSUMS
Skip checksum verification. yes / no . Default: no .
MKPKG_IGNORE_SIGNATURE
Skip signature verification. yes / no . Default: no .
MKPKG_NO_STRIP
Disable binary stripping. yes / no . Default: no .

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_IGNORE_NEW="yes"
MKPKG_IGNORE_SIGNATURE="yes"

# Secret key for signing (maintainers only)
#MKPKG_SECRET_KEY="/etc/ports/keys/opentux.sec"

See Also

Pure LLVM musl libc Source-Based Independent