PORT-MODULES(5)
๐ธ port-modules ๐
okay so welcome to port-modules(5), straight out of the File Formats Manual section โ this is the page that explains how the OpenBSD Ports framework splits itself up so it doesn't become one unhinged mega-file, and bestie, it's a lot, but we're gonna get through it together ๐ซถ
โจ DESCRIPTION โจ
So the OpenBSD Ports framework is built on top of one absolutely gigantic makefile named bsd.port.mk(5). Like, gigantic gigantic. ๐
And to curb that unwieldy growth, the parts of the framework that aren't always needed got set apart into optional files called port modules, which get pulled in as needed through the MODULES variable of bsd.port.mk(5).
Some of these modules are just basic mechanisms that you don't always need โ think GNU autoconf, or perl5.
And for convenience? Setting CONFIGURE_STYLE in a port's main Makefile is enough to get you perl5 or autoconf support. But lowkey the plot twist is: gnu, imake and perl5 are actually modules, and there's some glue in bsd.port.mk(5) that magically adds the required module in that case. โจ
โ ๏ธ But that magic does not work when parsing modules. For instance, if you setCONFIGURE_STYLE=gnuin a module, you also need toMODULES += gnu. no cap, it will not do it for you.
Other modules are basically shortcuts for using some other ports as dependencies without needing to hardcode too much โ the qt ports are the classic example.
๐ THE MODULES LOOK-UP MECHANISM ๐
The variable MODULES should contain a list of module names. Some core modules are a single word; all other modules should be ${PKGPATH}.
So if the module is some/dir/portname, the ports framework will go looking for a file named ${PORTSDIR}/some/dir/portname/portname.port.mk and include it. that's the whole vibe check ๐
Most modules should conform to this syntax. The historic practice of having a redirection file directly under ${PORTSDIR}/infrastructure/mk is deprecated for new modules โ so like, don't do that, bestie.
Modules may refer to each other, and the modules mechanism has specific recursion handling such that adding MODULES += foo/bar to a module will work as expected. ๐
๐ท๏ธ NAMING CONVENTIONS ๐ท๏ธ
Since there's no actual scope in makefiles, everything you define inside a module will be global to the ports framework โ which means it may interfere with other ports. Yes, everything. It's giving "one big group chat, no private DMs." ๐ญ
As far as possible, all variables and targets belonging to a module named some/dir/foo should be named MODFOO_* and modfoo_*.
Following the same conventions as bsd.port.mk(5), internal variables and targets that aren't meant for user consumption should be named _MODFOO_* and _modfoo_*. (the leading underscore is the "do not perceive me" marker ๐)
For instance, if a module wants some value to be available for the rest of the world, it should define MODFOO_VARNAME, with a name matching the basic infrastructure as far as possible. That is: a port that defines specific dependencies will usually define MODFOO_WANTLIB, MODFOO_LIB_DEPENDS, and MODFOO_RUN_DEPENDS, as appropriate.
And here's the exception to the naming mechanism ๐ โ some ports have several distinct versions in the ports tree, say x11/qt5 and x11/qt6. Instead of using the namespace MODQT5*, variables will usually drop the version suffix and be simply called MODQT_*, so that a port using the module can be switched from version to version without needing to change everything.
It is highly desirable to define names in both namespaces for such ports โ for example, to define both MODQT4_LIB_DEPENDS and MODQT_LIB_DEPENDS. Normal client ports will use MODQT_LIB_DEPENDS, but a port may exceptionally import both modules with MODULES += x11/qt5 x11/qt6 and differentiate between qt5 and qt6 needs with MODQT5_LIB_DEPENDS and MODQT6_LIB_DEPENDS. See print/poppler for an example. ๐ฆ
๐ช OVERRIDING TARGET BEHAVIOR ๐ช
The main framework contains several hooks that let ports override normal behavior. This evolved as an ad-hoc framework, where only hooks that turned out to be needed were added. And if several modules define the same hook, hook behaviors will be invoked in sequence. one after another, slay ๐
๐งฉ extract
There's a post-extract hook that can be activated by defining MODFOO_post-extract. It will be run right after post-extract.
๐ฉน patch
There's a post-patch hook that can be activated by defining MODFOO_post-patch. It will be run right after post-patch.
โ๏ธ gen
There's a gen hook that can be activated by defining MODFOO_gen. It will be run right after do-gen and before REORDER_DEPENDENCIES touches things.
๐๏ธ configure
There's a pre-configure hook that can be activated by defining MODFOO_pre-configure. It will be run right after pre-configure. The normal do-configure behavior is to invoke all MODFOO_configure contents that are defined in CONFIGURE_STYLE. By default, configure will do nothing.
Some CONFIGURE_STYLE values โ namely perl, gnu, imake, and autoconf โ will automatically import the correct module. User-defined modules must both add to CONFIGURE_STYLE and import the correct module to override behavior.
๐จ Contrary to other hooks, module behavior is not invoked in addition todo-configureโ it is the normal configure process. So ifdo-configureis overridden, normal hook processing will not happen. periodt.
๐ญ fake
There's a pre-fake hook that can be activated by defining MODFOO_pre-fake. This will be invoked right after mtree(8), and before the normal pre-fake behavior.
This can occasionally be used for ports that require some specific fake installation setup that will be provided by runtime dependencies.
๐ฆ install
There's a post-install hook that can be activated by defining MODFOO_post-install. This will be invoked at the end of install, right after the normal post-install behavior.
Some targets, such as do-build or do-install, can't be overridden simply. A module that, for instance, requires specific do-build behavior should do so in two steps:
- Define a variable named
MODFOO_BUILD_TARGETthat contains the commands necessary fordo-build:
MODFOO_BUILD_TARGET = cmd1; cmd2
- Override
do-buildonly if it's not already defined by the port proper:
.if !target(do-build)
do-build:
@${MODFOO_BUILD_TARGET}
.endif
That way, if several modules require specific actions for those targets, the end user can choose the appropriate order in which to run the actions:
do-build:
@${MODBAR_BUILD_TARGET}
@${MODFOO_BUILD_TARGET}
...
๐ง OVERRIDING VARIABLE BEHAVIOR ๐ง
Some variables can be overridden by modules. Be very cautious, because this can make the module difficult to use, or interact badly with other modules. ๐ฌ
As a rule, always provide the override as:
VARIABLE ?= value
and provide a module-specific variable with the same value:
MODFOO_VARIABLE = value.
The following variables can be overridden in a relatively safe fashion: ALL_TARGET, CONFIGURE_SCRIPT, DESTDIRNAME, DIST_SUBDIR, DISTNAME, DISTFILES, EXTRACT_SUFX, FAKE_FLAGS, FETCH_MANUALLY, HOMEPAGE, IGNORE, IS_INTERACTIVE, LIBTOOL_FLAGS, MAKE_FILE, MULTI_PACKAGES, NO_BUILD, NO_TEST, PATCH_LIST, PKG_ARCH, PKGNAME*, PREFIX, TEST_TARGET, TEST_IS_INTERACTIVE, REORDER_DEPENDENCIES, SEPARATE_BUILD, SITES, USE_GMAKE, USE_LIBTOOL.
The following variables can be added to in a relatively safe fashion: BUILD_DEPENDS, CATEGORIES, CONFIGURE_ARGS, CONFIGURE_ENV, ERRORS, FAKE_FLAGS, FLAVOR, FLAVORS, INSTALL_TARGET, LIB_DEPENDS, MAKE_ENV, MAKE_FLAGS, PKG_ARGS, PSEUDO_FLAVORS, TEST_DEPENDS, REORDER_DEPENDENCIES, RUN_DEPENDS, SUBST_VARS, WANTLIB.
๐ SPECIFIC MODULE INTERACTIONS ๐
Some modules correspond to extra ports that will be used mostly as BUILD_DEPENDS or RUN_DEPENDS. Such modules can safely append values directly to the BUILD_DEPENDS, RUN_DEPENDS, LIB_DEPENDS, and WANTLIB variables โ as long as they also define module-specific variables for all runtime dependencies. โ
Simple client ports will use the module directly, and thus inherit extra build and runtime dependencies.
More sophisticated ports can use MULTI_PACKAGES to select specific behavior: build-time dependencies will always be needed. Runtime dependencies will be selected on a subpackage basis, since runtime dependencies such as LIB_DEPENDS-sub do not inherit the default LIB_DEPENDS value. The client port's author must only bear in mind that external modules may add values to the default WANTLIB, LIB_DEPENDS, and RUN_DEPENDS, and thus that it is not safe to inherit from it blindly. ๐
Modules are imported during:
.include <bsd.port.mk>
Thus they can be affected by user choices such as setting a variable to Yes or No. Modules may make decisions based on documented MODFOO_BEHAVIOR values.
When modules are processed, only a few bsd.port.mk(5) variables are already defined. Modules may depend upon the following variables already having a sane value: DISTDIR, LOCALBASE, NO_DEPENDS, PKGPATH, PORTSDIR, X11BASE and all arch-dependent constants from bsd.port.arch.mk(5), such as PROPERTIES or LP64_ARCHS.
๐ก Note that this is only relevant for tests. It is perfectly okay to define variables or targets that depend on the basic ports framework without having to care whether that variable is already defined, since make(1) performs lazy evaluation. iconic behavior, honestly.
๐ง CORE MODULES DOCUMENTATION ๐ง
The following modules are available.
๐ cpan
For perl ports coming from CPAN. It's a wrapper around the normal perl module that fetches the file from the correct location depending on DISTNAME, and sets a default PKGNAME. It also affects TEST_DEPENDS, CONFIGURE_STYLE, PKG_ARCH, and CATEGORIES.
Some CPAN modules are only indexed by author, so set CPAN_AUTHOR=ID to locate the right directory. ๐ต๏ธ
If no HOMEPAGE is defined, it will default to:
http://search.cpan.org/dist/${DISTNAME:C/-[^-]*$//}/
User settings: set CPAN_REPORT to Yes, CPAN_REPORT_DB to a valid directory, and CPAN_REPORT_FROM to a valid email address to automate the reporting of regression tests to CPAN. ๐ฎ
If MODCPAN_EXAMPLES is set, the following variables will be set. MODCPAN_EXAMPLES_DIST will hold the default directory in the distfile with example scripts. MODCPAN_EXAMPLES_DIR will be set to the standard installation directory for examples. Sets the post-install target if none has been defined to install the examples, otherwise MODCPAN_POST_INSTALL should be used as such:
post-install:
...
${MODCPAN_POST_INSTALL}
and that's the cpan module โ but bestie we are so not done, there's more modules coming โจ
databases/mariadb ๐ฌ
Okay bestie, this one's the whole framework for testing ports that need a running MariaDB. It defines MODMARIADB_TEST_TARGET, which is quite literally the actual commands that get run in the do-test target. If you didn't define that target yourself, don't worry โ it gets added automatically. Slay.
Want to pick your own test command? Drop it in MODMARIADB_TEST_CMD. If you don't, the default is similar to what bsd.port.mk(5) runs itself. ๐
Here's the cute part: the MariaDB server that gets started listens on a UNIX domain socket only, so it barely touches your running system at all โ minimizing impact, as the cool kids say. The path to that socket is recorded in MODMARIADB_TEST_SOCKET. And any local user can connect without a password. ๐
- If
MODMARIADB_TEST_DBNAMEis set, a database with that name gets set up before the actual test command runs. - Otherwise (that's the default), the test itself is responsible for calling
mysqladmin(1)if it needs to. You're on your own, girl.
Heads up: databases/mariadb,-server gets added to TEST_DEPENDS, but not to any other *_DEPENDS. And MODMARIADB_CLIENT_ARGS and MODMARIADB_ADMIN_ARGS hold the arguments for mysql(1) and mysqladmin(1) respectively โ use those arg lists in your test scripts to connect to the test server if the environment isn't giving you what you need. ๐ซถ
databases/postgresql ๐
Same energy, different database. This adds a small framework for testing ports that require a running Postgres. It defines MODPOSTGRESQL_TEST_TARGET, which holds the actual commands to run in the do-test target โ and if that target isn't defined, it gets added automatically. Iconic.
MODPOSTGRESQL_TEST_CMDlets you specify the actual test command. Default is similar to whatbsd.port.mk(5)runs itself.
The server that gets started listens on a UNIX domain socket only โ again, minimal impact on your running system, love that for you. The directory where that socket gets created is set by MODPOSTGRESQL_TEST_PGHOST, which defaults to ${WRKDIR}. Any local user can connect without a password. ๐
- If
MODPOSTGRESQL_TEST_DBNAMEis set, a database with that name gets set up before the actual test command runs. - Otherwise (default), the test is responsible for calling
initdb(1)itself. No hand-holding.
And databases/postgresql,-server gets added to TEST_DEPENDS, but not to any other *_DEPENDS. Periodt.
devel/cmake ๐ง
Bestie, this is a big one. It adds devel/cmake to BUILD_DEPENDS and fills up CONFIGURE_ARGS, CONFIGURE_ENV and MAKE_ENV. It sets up the configure target. If CONFIGURE_STYLE wasn't set before, it sets it to cmake. It flips SEPARATE_BUILD to Yes by default because modern CMake requires out-of-source builds anyway (no cap). And it changes TEST_TARGET to test, since that's just the standard for CMake projects.
Also it's got knobs, and we love knobs:
MODCMAKE_DEBUGโ if set toYes, CMake produces a debug build instead of a release build. The exact effects on the build process depend on the settings in the CMake config files. Default isNo.MODCMAKE_LDFLAGSโ if set, the value gets passed to CMake via theLDFLAGSenvironment variable during configuration. CMake only uses this on the first configuration, to setCMAKE_EXE_LINKER_FLAGS_INIT,CMAKE_SHARED_LINKER_FLAGS_INIT, andCMAKE_MODULE_LINKER_FLAGS_INIT. Default is empty.MODCMAKE_VERBOSEโ if set toYes, CMake prints details during the configure and build stages about the exact command being run, etc. Should not be used in ports Makefiles. Default isYes.MODCMAKE_WANTCOLORโ if set toYes, CMake colorizes its output. ๐ Should not be used in ports Makefiles. Default isNo.USE_NINJAโ if set toYes, useninja(1)as the build system instead ofmake(1), and adddevel/ninjatoBUILD_DEPENDS. If set toNo, it uses the Unix Makefiles generator and adds'nojunk'toDPB_PROPERTIES. Default isYes.
โจ when it plays nice with other modules
When used together with other modules, the appropriate variables get passed to CMake automatically โ it's giving teamwork:
javaโJAVA_HOMEis set inCONFIGURE_ENVandMAKE_ENV.lang/pythonโ the Python executable, library, and include paths are set forFindPython,FindPython3, andFindPythonNmodules.lang/luaโ the Lua include directory and library path are set forFindLua.lang/rubyโ the Ruby executable is set forFindRuby.lang/tclโ the Tcl version, include and library directories, and library name are set inCONFIGURE_ENV.x11/tkโ the Tk version, include and library directories, and library name are set inCONFIGURE_ENV.
Also: the environment variable MODCMAKE_PORT_BUILD is automatically set to yes in CONFIGURE_ENV and MAKE_ENV. What does that do? It disables CMake's default optimization flags (so ports stay in control of them) and prevents network operations (file DOWNLOAD/UPLOAD) during the build. Safety first, babe. ๐ก๏ธ
devel/cabal ๐ฆ
Go read cabal-module(5) for porting Haskell applications. That's the whole entry, iykyk.
devel/cargo ๐ฆ
See cargo-module(5). Short and sweet.
devel/dconf โ๏ธ
Sets CONFIGURE_ARGS, BUILD_DEPENDS and RUN_DEPENDS. This module is for ports installing gsettings schemas under ${PREFIX}/share/glib-2.0/schemas/. And your PLIST must contain this:
@tag glib-compile-schemas
No exceptions, bestie. ๐
devel/gconf2 ๐
So a link from gconftool-2(1) to true(1) gets put at the front of the PATH โ sneaky but effective. It sets CONFIGURE_ARGS, BUILD_DEPENDS and RUN_DEPENDS. According to the values of MODGCONF2_LIBDEP, it also sets LIB_DEPENDS.
User settings: set MODGCONF2_SCHEMAS_DIR to the directory name under ${LOCALBASE}/share/schemas/ where the schemas files will be installed. ๐ธ
devel/meson ๐ ๏ธ
Adds devel/meson and devel/ninja to BUILD_DEPENDS. Sets up the configure target. If CONFIGURE_STYLE wasn't set before, it sets it to meson. Flips SEPARATE_BUILD to Yes by default because meson requires out-of-source builds. And if CONFIGURE_STYLE is 'meson', then MODMESON_CONFIGURE_ARGS and MODMESON_CONFIGURE_ENV add their default values to CONFIGURE_ARGS and CONFIGURE_ENV.
Now, storytime: to figure out some dependencies, meson(1) uses pkg-config(1) and then falls back to cmake(1). But we do not want to force a dependency on devel/cmake/core, so dpb(1) might junk it if it finds it. That could create a race between finding foo.cmake and junking cmake(1) at configure time. ๐ญ To prevent this, unless devel/cmake/core is explicitly part of BUILD_DEPENDS, cmake(1) gets disabled by creating a link to false in ${WRKDIR}/bin/. Problem solved, diva.
This module supports one knob:
MODMESON_WANTCOLORโ if set toYes, meson colorizes its output. Should not be used in ports Makefiles. Default isNo.
devel/qmake ๐จ
See qmake-module(5). That's it, that's the entry.
devel/scons ๐
Adds devel/scons to BUILD_DEPENDS. Sets MODSCONS_BIN and MODSCONS_ENV. It also defines an overridable MODSCONS_FLAGS. Then it provides do-build and do-install targets that you can override in the port Makefile. Chef's kiss. ๐
font ๐ค
This one's for ports that primarily install fonts. It affects PKG_ARCH and EXTRACT_SUFX, and appends to CATEGORIES.
When MODFONT_FAMILY is set in combination with MODFONT_VERSION, it sets PKGNAME. Set MODFONT_FAMILY to the name of the font family โ that's the whole point. It then sets MODFONT_FONTDIR, MODFONT_DOCDIR, and MODFONT_WEBDIR using said family name.
A do-install target is provided if the port itself doesn't provide one. This installs fonts from WRKSRC in the distribution. Here's the deets:
- If one or more filenames (relative to
WRKSRC) are listed inMODFONT_FONTFILES, they get installed toMODFONT_FONTDIR. - Otherwise,
otffiles inWRKSRCget installed, with a fallback tottf. - If filenames (relative to
WRKSRC) are listed inMODFONT_DOCFILES, they get installed toMODFONT_DOCDIR. - If filenames (relative to
WRKSRC) are listed inMODFONT_WEBFILES, they get installed toMODFONT_WEBDIR. โ ๏ธ Ports that setMODFONT_WEBFILESmust also declare a-websubpackage inMULTI_PACKAGES.
fortran ๐งฎ
Sets MODFORTRAN_LIB_DEPENDS, MODFORTRAN_WANTLIB, and MODFORTRAN_BUILD_DEPENDS. Set MODFORTRAN_COMPILER to gfortran or flang, depending on what your port requires โ default is gfortran. The dependencies get chosen according to whatever MODFORTRAN_COMPILER is set to. Simple as that. โจ
gcc4 ๐๏ธ
If COMPILER_VERSION is not gcc4 (that's defined by /usr/share/mk/bsd.own.mk), and the architecture is in MODGCC4_ARCHS, then the gcc4 compilers get put at the front of the path.
By default, only C language support comes with this module. Need other languages? List them in MODGCC4_LANGS (e.g. c++, fortran). The MODGCC4_VERSION variable changes the version of gcc โ default is gcc 4.9. And if MODGCC4_LANGS contains c++, this module provides MODGCC4_CPPLIBDEP and MODGCC4_CPPWANTLIB. ๐ซถ
gnu ๐
This module is documented in the main bsd.port.mk(5) manpage. Go check it out there, bestie.
imakeโ honestly this one's just a vibe, the real tea is in the mainbsd.port.mk(5)manpage ๐javaโ okay so setMODJAVA_VER=x.yif you want exactly JDK x.y, orMODJAVA_VER=x.y+if any x.y-or-newer version is fine ๐ซถ. And setMODJAVA_JRERUN=Yeswhen the port only needs the JRE at runtime.
This module sets JAVA_HOME, ONLY_FOR_ARCHS, MODJAVA_RUN_DEPENDS, MODJAVA_SHARE_DIR, MODJAVA_JAR_DIR, MODJAVA_EXAMPLE_DIR and MODJAVA_DOC_DIR. It appends to BUILD_DEPENDS, RUN_DEPENDS, CATEGORIES and SUBST_VARS.
If MODJAVA_BUILD=ant then this module provides MODJAVA_BUILD_DIR, MODJAVA_BUILD_FILE and MODJAVA_BUILD_TARGET_NAME, plus a do-build target (only if one isn't already defined, bestie). It heeds NO_BUILD.
lang/clangโ similar to thegcc4module. If the architecture is inMODCLANG_ARCHS, the Clang compilers get put at the front of the path โจ. By default only C language support is included by this module โ if you need other languages they must be listed inMODCLANG_LANGS(e.g.c++). SetsMODCLANG_VERSIONwhich is also appended toSUBST_VARS.lang/erlangโ no extra lore here ๐lang/goโ seego-module(5)๐lang/luaโ this one setsMODLUA_BIN,MODLUA_DATADIR,MODLUA_DEP,MODLUA_DEP_VERSION,MODLUA_DOCDIR,MODLUA_EXAMPLEDIR,MODLUA_INCL_DIR,MODLUA_LIB,MODLUA_LIBDIR,MODLUA_VERSION,MODLUA_WANTLIB. It appends toCATEGORIES.
Also appends to BUILD_DEPENDS, unless NO_BUILD has been set to Yes. Also appends to RUN_DEPENDS, unless MODLUA_RUNDEP is set to No. Then it appends MODLUA_VERSION, MODLUA_LIB, MODLUA_INCL_DIR, MODLUA_EXAMPLEDIR, MODLUA_DOCDIR, MODLUA_LIBDIR, MODLUA_DATADIR, MODLUA_DEP, MODLUA_DEP_VERSION, MODLUA_BIN to SUBST_VARS.
MODLUA_DEFAULT_VERSION is set to 5.1. MODLUA_VERSION is set to MODLUA_DEFAULT_VERSION by default. Ports can be built with several lua versions ๐ฅ. If no FLAVOR is set, it defaults to MODLUA_DEFAULT_VERSION. Otherwise FULLPKGNAME is adjusted, if MODLUA_SA is not set. In order to set a build, run or test dependency on a lua port, use MODLUA_BUILD_DEPENDS, MODLUA_TEST_DEPENDS, MODLUA_RUN_DEPENDS โ these propagate the currently used flavor ๐ง
lang/monoโ setsMODMONO_ONLY_FOR_ARCHS,CONFIGURE_ENV,MAKE_FLAGS,MODMONO_BUILD_DEPENDSandMODMONO_RUN_DEPENDS. IfMODMONO_DEPSis set toYes,lang/monois appended toBUILD_DEPENDSandRUN_DEPENDS.DLLMAP_FILESdefines in which files the module will substitute hardcoded shared library versions using apost-configuretarget.lang/ocamlโ appends toBUILD_DEPENDSandMAKE_ENV. Appends toRUN_DEPENDSunlessMODOCAML_RUNDEPis set toNo, or set toif-not-nativeand native compilation is supported on this architecture ๐ฆ. Including this module selects a%%native%%plist fragment andocaml_nativeproperty depending on whether the architecture supports native compilation. If dynamic linking is supported on the native architecture, the%%dynlink%%plist fragment andocaml_native_dynlinkproperty is set. WhenCONFIGURE_STYLEis set tooasis, overrides for thedo-build,do-install, anddo-testtargets are added.lang/phpโ used for ports using PHP in some way: either extensions to PHP, or software written in PHP ๐. SetsMODPHP_RUN_DEPENDS,MODPHP_LIB_DEPENDS,MODPHP_WANTLIB,MODPHP_BIN,MODPHP_PHPIZE,MODPHP_PHP_CONFIG,MODPHP_INCDIRandMODPHP_LIBDIR. Adds toRUN_DEPENDSunlessMODPHP_RUNDEPis set toNo. Adds toBUILD_DEPENDSifMODPHP_BUILDDEPis set toYes. IfMODPHP_DO_PHPIZEis set, prepares a build environment for extensions that usephpize.
Ports using PDO for database connectivity often have a choice of dependencies (pdo_sqlite, pdo_mysql, pdo_pgsql and others). The module constructs MODPHP_PDO_DEPENDS from the PDO types listed in MODPHP_PDO_ALLOWED (defaulting to "sqlite mysql pgsql"). This can be added to RUN_DEPENDS and allows any of these PDO packages to satisfy the dependency, with MODPHP_PDO_PREF (sqlite by default) chosen if none are installed. Chef's kiss choice logic ๐
lang/php/peclโ used for ports for PHP PECL extensions. Sets defaultSITES,HOMEPAGE,EXTRACT_SUFX,DESTDIRNAME,MODPHP_DO_SAMPLE,MODPHP_DO_PHPIZE,AUTOCONF_VERSION,AUTOMAKE_VERSION,LIBTOOL_FLAGS. Provides a defaultTEST_TARGETandTEST_FLAGSunlessNO_TESTor ado-testtarget is defined. Adds common dependencies toRUN_DEPENDSandBUILD_DEPENDS. Sets a defaultPKGNAMEand appends toCATEGORIES.lang/pythonโ seepython-module(5)๐lang/rubyโ seeruby-module(5)๐lang/rustโ ports using Rust must use this module so a rebuild can be triggered viaSYSTEM_VERSION-ruston updates of thelang/rustport or changes to the Rust standard library ๐ฆ. SetsMODRUST_WANTLIBas appropriate for the architecture so it can be added toWANTLIB. It addslang/rustto theBUILD_DEPENDSunlessMODRUST_BUILDDEPis set to anything butโyesโ.lang/tclโ setsMODTCL_VERSION,MODTCL_BIN,MODTCL_INCDIR,MODTCL_LIBDIR,MODTCL_BUILD_DEPENDS,MODTCL_RUN_DEPENDS,MODTCL_LIB_DEPENDS, andMODTCL_LIB.MODTCL_VERSIONis the default version used by all Tcl ports and may be overridden. ProvidesMODTCL_TCLSH_ADJandMODTCL_WISH_ADJshell fragments to patch the interpreter path in executable scripts. Also affectsCATEGORIES.perlโ documented in the mainbsd.port.mk(5)manpage ๐ชsecurity/heimdalโ a link from${LOCALBASE}/heimdal/bin/krb5-configtokrb5-config(1)will be put at the front of the path. SetsLIB_DEPENDSandWANTLIBaccording to the values ofMODHEIMDAL_LIB_DEPENDS, andMODHEIMDAL_WANTLIB.textproc/intltoolโ setsMODINTLTOOL_OVERRIDE.textproc/intltoolis added toBUILD_DEPENDS.MODINTLTOOL_OVERRIDEchanges the paths ofINTLTOOL_EXTRACT,INTLTOOL_MERGEandINTLTOOL_UPDATEto use the installed versions ofintltool-extract,intltool-mergeandintltool-update, instead of the version's packages into the distfile of the port using this module ๐. Also affectsCONFIGURE_ENV,MAKE_ENVandMAKE_FLAGSby appendingMODINTLTOOL_OVERRIDEto them.www/mozillaโ setsPKGNAME,HOMEPAGE,SITES,DISTNAME,USE_GMAKE, andONLY_FOR_ARCHS.EXTRACT_SUFXdefaults to.tar.bz2๐ฆ
Adds common dependencies to LIB_DEPENDS, WANTLIB, RUN_DEPENDS and BUILD_DEPENDS. Sets common CONFIGURE_ARGS, MAKE_ENV and CONFIGURE_ENV. Sets MOB variable as source directory and MOZ as target directory within do-install.
Individual port Makefile must set MOZILLA_PROJECT, MOZILLA_CODENAME, MOZILLA_VERSION, MOZILLA_BRANCH, MOZILLA_LIBS and MOZILLA_DATADIRS variables. Port can also append values to MOZILLA_SUBST_FILES which contains the list of files to run SUBST_CMD on during pre-configure, and MOZILLA_AUTOCONF_DIRS which contains the list of dirs where AUTOCONF will be run during pre-configure.
wayland/wlrootsโ used for Wayland ports using thewlrootslibrary. SetsMODWLROOTS_LIB_DEPENDS,MODWLROOTS_WANTLIBandMODWLROOTS_VERSION. Appends the corresponding values toLIB_DEPENDSandWANTLIB, unlessMODWLROOTS_LIBDEPis set toNo๐www/pearโ used for PHP PEAR ports. Sets defaultSITES,EXTRACT_SUFX,PKGNAME. SetsPREFIXto/var/www. SetsNO_TESTunless ado-testtarget is defined. Adds common dependencies toRUN_DEPENDSandBUILD_DEPENDS, setsMAKE_FILEandFAKE_FLAGSappropriately. MakesPEAR_LIBDIRandPEAR_PHPBINavailable for use in the port. Sets a defaultPKGNAMEand appends toCATEGORIES.x11/gnomeโ seegnome-module(5)๐งx11/gnustepโ no extra lore here either ๐x11/qt5andx11/qt6โ allqt*modules share a commonMODQT_*namespace for simple ports. Theqt5module also defines the same variables underMODQT5_*and theqt6module also defines the same variables underMODQT6_*, to allow ports to use both modules, such asprint/poppler๐
Those modules define MODQT*_LIBDIR as the libraries location, MODQT*_INCDIR as the include files location, MODQT*_QTDIR as the global qt directory location, MODQT*_CONFIGURE_ARGS as standard GNU configure-style parameters to locate the include and libraries.
The location of Qt-specific tools lrelease, moc, qmake and uic is available through MODQT*_LRELEASE, MODQT*_MOC, MODQT*_QMAKE and MODQT*_UIC. MODQT*_OVERRIDE_UIC controls whether the default setup will force a value of UIC or not. The value of MOC is always forced to ${MODQT*_MOC}.
In most cases thedevel/qmakemodule should be used instead of usingMODQT*_QMAKEdirectly. Take the hint, bestie ๐ซถ
The modules add to CONFIGURE_ENV, MAKE_ENV and MAKE_FLAGS. They define appropriate MODQT*_LIB_DEPENDS and MODQT*_WANTLIB.
Note that Qt5 and Qt6 have their code split over several libraries. Both modules qt5 and qt6 doesn't set MODQT*_WANTLIB at all. Qt5 and Qt6 consist of many so called Qt modules, these Qt modules should be added to LIB_DEPENDS, BUILD_DEPENDS or RUN_DEPENDS manually ๐ญ
x11/tkโ okay so this one setsMODTK_VERSION,MODTK_BIN,MODTK_INCDIR,MODTK_LIBDIR,MODTK_BUILD_DEPENDS,MODTK_RUN_DEPENDS,MODTK_LIB_DEPENDS, andMODTK_LIB.MODTK_VERSIONis the default version that all Tk ports use, and bestie you can override it. It automatically adds thelang/tclmodule, hands you a defaultMODTCL_VERSIONthat matchesMODTK_VERSION, and it affectsCATEGORIES. Also clock theMODTCL_WISH_ADJshell fragment in thelang/tclmodule โ iykyk ๐ .x11/xfce4โ setsDIST_SUBDIR,EXTRACT_SUFX,CONFIGURE_STYLE,CONFIGURE_ENV, andUSE_GMAKE. IfMODXFCE_ICON_CACHEis set toyes, it addsx11/gtk+4,-guictoRUN_DEPENDS. UnlessXFCE_NO_SRCis set,textproc/intltoolgets added toMODULES. It also affectsCATEGORIES.
Xfce ports can be divided into five categories: core libraries and applications, goodies, artwork, thunar plugins, and panel plugins. HOMEPAGE, SITES, and DISTNAME are built using XFCE_VERSION (which defaults to XFCE_DESKTOP_VERSION if it's not set) and either XFCE_PROJECT, XFCE_GOODIE, XFCE_ARTWORK, THUNAR_PLUGIN, or XFCE_PLUGIN. One of the latter โ XFCE_PROJECT, XFCE_GOODIE, XFCE_ARTWORK, THUNAR_PLUGIN, or XFCE_PLUGIN โ has to be provided by the port Makefile. fr fr, don't forget it ๐ซถ.
๐ SEE ALSO ๐
make(1)bsd.port.mk(5)cabal-module(5)cargo-module(5)gnome-module(5)go-module(5)python-module(5)qmake-module(5)ruby-module(5)ports(7)
mwah ๐ that's the whole page, bestie! source: Debian, date: March 16, 2026, manual page: PORT-MODULES(5) โจ๐
๐ฆ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2008 Marc Espie
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms