---
name: "port-modules"
section: "5"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/port-modules"
---

# port-modules(5)

documentation and conventions used in port modules

## NAME

**port-modules** – documentation and conventions used in port modules

## DESCRIPTION

The OpenBSD Ports framework is based on a gigantic makefile named [bsd.port.mk(5)](/bsd.port.mk/5.md).

In order to curb unwieldy growth, parts of the framework that are not always needed have been set apart in optional files called **port** **modules**, which are retrieved as needed through the MODULES variable of [bsd.port.mk(5)](/bsd.port.mk/5.md).

Some of these modules correspond to basic mechanisms which are not always needed, such as GNU autoconf, or perl5.

For convenience, setting CONFIGURE\_STYLE in a port's main Makefile is enough to get perl5 or autoconf support, but **gnu**, **imake** and **perl5** are actually modules, and there is some glue in [bsd.port.mk(5)](/bsd.port.mk/5.md) that magically adds the required module in that case. This doesn't work when parsing modules. For instance, if you set CONFIGURE\_STYLE=**gnu** in a module, you also need to set MODULES += **gnu**.

Other modules correspond to shortcuts for using some other ports as dependencies without needing to hardcode too much, such as the qt ports.

## 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}. If the module is *some/dir/portname*, the ports framework will look for a file named *${PORTSDIR}/some/dir/portname/portname.port.mk* and include it.

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.

Modules may refer to each other. The modules mechanism has specific recursion handling such that adding MODULES += *foo/bar* to a module will work as expected.

## NAMING CONVENTIONS

Since there is no actual scope in makefiles, everything defined within a module will be global to the ports framework, and thus may interfere with other ports.

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)](/bsd.port.mk/5.md), internal variables and targets not intended for user consumption should be named \_MODFOO\_\* and **\_modfoo\_\***.

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.

As an 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 allow ports to override normal behavior. This evolved as an ad-hoc framework, where only hooks that turned out to be needed were added. If several modules define the same hook, hook behaviors will be invoked in sequence.

- **extract**

  There is a **post-extract** hook that can be activated by defining MODFOO\_post-extract. It will be run right after **post-extract**.

- **patch**

  There is a **post-patch** hook that can be activated by defining MODFOO\_post-patch. It will be run right after **post-patch**.

- **gen**

  There is 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 is 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 to **do-configure**, but as the normal configure process. If **do-configure** is overridden, normal hook processing will not happen.

- **fake**

  There is a **pre-fake** hook that can be activated by defining MODFOO\_pre-fake. This will be invoked right after [mtree(8)](/mtree/8.md), 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 is 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\_TARGET that contains the commands necessary for **do-build**:

  ```
  MODFOO_BUILD_TARGET = cmd1; cmd2
  ```

- Override **do-build** only 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, as 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)](/bsd.port.mk/5.md) 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)](/bsd.port.arch.mk/5.md), 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)](/make/1.md) performs lazy evaluation.

## CORE MODULES DOCUMENTATION

The following modules are available.

- **cpan**

  For perl ports coming from CPAN. Wrapper around the normal perl module that fetches the file from the correct location depending on DISTNAME, and sets a default PKGNAME. Also affects TEST\_DEPENDS, CONFIGURE\_STYLE, PKG\_ARCH, and CATEGORIES.

  Some CPAN modules are only indexed by author, 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}
  ```

- **databases/mariadb**

  Adds small framework for testing ports that require running MariaDB. Defines MODMARIADB\_TEST\_TARGET which consists actual commands to run in **do-test** target. If this target isn't defined, it will be added automatically.

  The actual test command to be run could be specified in the MODMARIADB\_TEST\_CMD. Default is similar to what [bsd.port.mk(5)](/bsd.port.mk/5.md) runs itself.

  The MariaDB server being started will listen on UNIX domain socket only, minimizing impact on running system. The path to socket is recorded in MODMARIADB\_TEST\_SOCKET. Any local user will be able to connect without password.

  If the MODMARIADB\_TEST\_DBNAME variable is set, the database with such name will be set up before running actual test command. Otherwise (default), the test is responsible to call [mysqladmin(1)](/mysqladmin/1.md) itself, if needed.

  The *databases/mariadb,-server* will get added to TEST\_DEPENDS, but not to any other \*\_DEPENDS. The MODMARIADB\_CLIENT\_ARGS and MODMARIADB\_ADMIN\_ARGS variables hold arguments for [mysql(1)](/mysql/1.md) and [mysqladmin(1)](/mysqladmin/1.md), respectively; those argument lists could be used in test scripts for connecting to test server, if they aren't satisfied by environment.

- **databases/postgresql**

  Adds small framework for testing ports that require running Postgres. Defines MODPOSTGRESQL\_TEST\_TARGET which consists actual commands to run in **do-test** target. If this target isn't defined, it will be added automatically.

  The actual test command to be run could be specified in the MODPOSTGRESQL\_TEST\_CMD. Default is similar to what [bsd.port.mk(5)](/bsd.port.mk/5.md) runs itself.

  The Postgres server being started will listen on UNIX domain socket only, minimizing impact on running system. The path to directory where socket will be created is set by MODPOSTGRESQL\_TEST\_PGHOST, defaulting to *${WRKDIR}*. Any local user will be able to connect without password.

  If the MODPOSTGRESQL\_TEST\_DBNAME variable is set, the database with such name will be set up before running actual test command. Otherwise (default), the test is responsible to call [initdb(1)](/initdb/1.md) itself.

  The *databases/postgresql,-server* will get added to TEST\_DEPENDS, but not to any other \*\_DEPENDS.

- **devel/cabal**

  See [cabal-module(5)](/cabal-module/5.md) for porting Haskell applications.

- **devel/cargo**

  See [cargo-module(5)](/cargo-module/5.md).

- **devel/cmake**

  Adds *devel/cmake* to BUILD\_DEPENDS and fills up CONFIGURE\_ARGS, CONFIGURE\_ENV and MAKE\_ENV. Sets up **configure** target. If CONFIGURE\_STYLE was not set before, sets its value to \`cmake'. Changes default value of SEPARATE\_BUILD to **Yes** because modern CMake requires out-of-source build anyway. Changes TEST\_TARGET to **test** as this is standard for CMake projects. Also this module has the following knobs:

  - MODCMAKE\_DEBUG

    If set to **Yes**, CMake will produce a debug build instead of a release build. The exact effects on the build process depend on settings specified in the CMake config files. Default value is **No**.

  - MODCMAKE\_LDFLAGS

    If set, the value will be passed to CMake via the LDFLAGS environment variable during configuration. CMake uses this only on the first configuration to set CMAKE\_EXE\_LINKER\_FLAGS\_INIT, CMAKE\_SHARED\_LINKER\_FLAGS\_INIT, and CMAKE\_MODULE\_LINKER\_FLAGS\_INIT. Default value is empty.

  - MODCMAKE\_VERBOSE

    If set to **Yes**, CMake will print details during configure and build stages about exact command being run, etc. Should not be used in ports Makefiles. Default value is **Yes**.

  - MODCMAKE\_WANTCOLOR

    If set to **Yes**, CMake will colorize its output. Should not be used in ports Makefiles. Default value is **No**.

  - USE\_NINJA

    If set to **Yes**, use [ninja(1)](/ninja/1.md) as the build system instead of [make(1)](/make/1.md). Adds *devel/ninja* to BUILD\_DEPENDS. If set to **No**, uses Unix Makefiles generator and adds ‘nojunk’ to DPB\_PROPERTIES. Default value is **Yes**.

    When used together with other modules, appropriate variables are automatically passed to CMake:

    - **java**

      JAVA\_HOME is set in CONFIGURE\_ENV and MAKE\_ENV.

    - **lang/python**

      Python executable, library, and include paths are set for FindPython, FindPython3, and FindPythonN modules.

    - **lang/lua**

      Lua include directory and library path are set for FindLua.

    - **lang/ruby**

      Ruby executable is set for FindRuby.

    - **lang/tcl**

      Tcl version, include, library directories and library name are set in CONFIGURE\_ENV.

    - **x11/tk**

      Tk version, include, library directories and library name are set in CONFIGURE\_ENV.

      The environment variable MODCMAKE\_PORT\_BUILD is automatically set to **yes** in CONFIGURE\_ENV and MAKE\_ENV. This disables CMake's default optimization flags, putting them under ports control, and prevents network operations (file DOWNLOAD/UPLOAD) during the build.

- **devel/dconf**

  Sets CONFIGURE\_ARGS, BUILD\_DEPENDS and RUN\_DEPENDS. This module is used by ports installing gsettings schemas under *${PREFIX}/share/glib-2.0/schemas/*. PLIST must contain:

  ```
  @tag glib-compile-schemas
  ```

- **devel/gconf2**

  A link from [gconftool-2(1)](/gconftool-2/1.md) to [true(1)](/true/1.md) will be put at the front of the PATH. Sets CONFIGURE\_ARGS, BUILD\_DEPENDS, and RUN\_DEPENDS. According to the values of MODGCONF2\_LIBDEP, sets LIB\_DEPENDS. User settings: set MODGCONF2\_SCHEMAS\_DIR to the directory name under *${LOCALBASE}/share/schemas/* where schemas files will be installed.

- **devel/meson**

  Adds *devel/meson* and *devel/ninja* to BUILD\_DEPENDS. Sets up **configure** target. If CONFIGURE\_STYLE was not set before, sets its value to **meson**. Changes default value of SEPARATE\_BUILD to **Yes** because meson requires out-of-source build. If CONFIGURE\_STYLE is **meson**, MODMESON\_CONFIGURE\_ARGS and MODMESON\_CONFIGURE\_ENV will add default values to CONFIGURE\_ARGS and CONFIGURE\_ENV.

  To figure out some dependencies, [meson(1)](/meson/1.md) uses [pkg-config(1)](/pkg-config/1.md) then falls back to [cmake(1)](/cmake/1.md). As we do not want to enforce a dependency on devel/cmake/core, [dpb(1)](/dpb/1.md) might junk it if it's found. This could create a race between finding foo.cmake and junking [cmake(1)](/cmake/1.md) at configure time. To prevent this, unless devel/cmake/core is explicitly part of BUILD\_DEPENDS, [cmake(1)](/cmake/1.md) will be disabled by creating a link to false in ${WRKDIR}/bin/.

  Specific integration for building with [cargo(1)](/cargo/1.md) is automatically enabled if **devel/cargo** is included in MODULES. MODCARGO\_BUILD, MODCARGO\_INSTALL, and MODCARGO\_TEST are set to **No**, ${MODCARGO\_ENV} is added to MAKE\_ENV and ${MODCARGO\_configure} is added to MODMESON\_pre-configure.

  This module supports the following knob:

  - MODMESON\_WANTCOLOR

    If set to **Yes**, meson will colorize its output. Should not be used in ports Makefiles. Default value is **No**.

- **devel/qmake**

  See [qmake-module(5)](/qmake-module/5.md).

- **devel/scons**

  Adds *devel/scons* to BUILD\_DEPENDS. Sets MODSCONS\_BIN and MODSCONS\_ENV. Also defines an overridable MODSCONS\_FLAGS. It provides a **do-build** and **do-install** targets that can be overridden in the port Makefile.

- **font**

  Used for ports which primarily install fonts. Affects PKG\_ARCH and EXTRACT\_SUFX. Appends to CATEGORIES. When MODFONT\_FAMILY is set in combination with MODFONT\_VERSION, it sets PKGNAME. MODFONT\_FAMILY should be set to the name of the font family. This sets MODFONT\_FONTDIR, MODFONT\_DOCDIR, and MODFONT\_WEBDIR using said family name. A **do-install** target is provided if the port itself does not provide it. This installs fonts from WRKSRC in the distribution. If one or more filenames (relative to WRKSRC) are listed in MODFONT\_FONTFILES, they will be installed to MODFONT\_FONTDIR. Otherwise, otf files in WRKSRC will be installed, with a fallback to ttf. If filenames (relative to WRKSRC) are listed in MODFONT\_DOCFILES, they will be installed to MODFONT\_DOCDIR. If filenames (relative to WRKSRC) are listed in MODFONT\_WEBFILES, they will be installed to MODFONT\_WEBDIR; ports that set MODFONT\_WEBFILES must also declare a -web subpackage in MULTI\_PACKAGES.

- **fortran**

  Sets MODFORTRAN\_LIB\_DEPENDS, MODFORTRAN\_WANTLIB, MODFORTRAN\_BUILD\_DEPENDS. Set MODFORTRAN\_COMPILER depending on what the port requires. The current default and only supported value is **gfortran**. The dependencies are chosen according to MODFORTRAN\_COMPILER.

- **gcc**

  If COMPILER\_VERSION is not gcc4 (defined by */usr/share/mk/bsd.own.mk*), and architecture is in MODGCC\_ARCHS, then the gcc compilers will be put at the front of the path. By default, only C language support is included by this module. If other languages are needed, they must be listed in MODGCC\_LANGS (e.g. c++, fortran). The MODGCC\_VERSION variable can be used to change the version of gcc. By default gcc 4.9 is used. If MODGCC\_LANGS contains c++, this module provides MODGCC\_CPPLIBDEP and MODGCC\_CPPWANTLIB.

- **gnu**

  This module is documented in the main [bsd.port.mk(5)](/bsd.port.mk/5.md) manpage.

- **imake**

  This module is documented in the main [bsd.port.mk(5)](/bsd.port.mk/5.md) manpage.

- **java**

  Set MODJAVA\_VER=*x.y* to use exactly the JDK x.y, MODJAVA\_VER=*x.y***+** to use any x.y or higher version. Set MODJAVA\_JRERUN=**Yes** if the port only needs the JRE at runtime. The 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, as well as a **do-build** target (if not already defined). It heeds NO\_BUILD.

- **lang/clang**

  Similar to gcc module. If architecture is in MODCLANG\_ARCHS, the Clang compilers will be put at the front of the path. By default, only C language support is included by this module. If other languages are needed, they must be listed in MODCLANG\_LANGS (e.g. c++). Sets MODCLANG\_VERSION which is also appended to SUBST\_VARS.

- **lang/erlang**

  - **lang/go**

  See [go-module(5)](/go-module/5.md).

- **lang/lua**

  Sets MODLUA\_BIN, MODLUA\_DATADIR, MODLUA\_DEP, MODLUA\_DEP\_VERSION, MODLUA\_DOCDIR, MODLUA\_EXAMPLEDIR, MODLUA\_INCL\_DIR, MODLUA\_LIB, MODLUA\_LIBDIR, MODLUA\_VERSION, MODLUA\_WANTLIB. Appends to CATEGORIES. 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**. 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 the FULLPKGNAME is adjusted, if MODLUA\_SA is not set. In order to set a build, run or test dependency on a lua port, use the following, which will propagate the currently used flavor: MODLUA\_BUILD\_DEPENDS, MODLUA\_TEST\_DEPENDS, MODLUA\_RUN\_DEPENDS.

- **lang/mono**

  Sets MODMONO\_ONLY\_FOR\_ARCHS, CONFIGURE\_ENV, MAKE\_FLAGS, MODMONO\_BUILD\_DEPENDS, and MODMONO\_RUN\_DEPENDS. If MODMONO\_DEPS is set to **Yes**, *lang/mono* is appended to BUILD\_DEPENDS and RUN\_DEPENDS. DLLMAP\_FILES defines in which files the module will substitute hardcoded shared library versions using a **post-configure** target.

- **lang/ocaml**

  Appends to BUILD\_DEPENDS and MAKE\_ENV. Appends to RUN\_DEPENDS unless MODOCAML\_RUNDEP is set to **No**, or set to if-not-native and native compilation is supported on this architecture. Including this module selects a %%native%% plist fragment and ocaml\_native property depending on whether the architecture supports native compilation. If dynamic linking is supported on the native architecture, the %%dynlink%% plist fragment and ocaml\_native\_dynlink property is set. When CONFIGURE\_STYLE is set to **oasis**, overrides for the **do-build**, **do-install**, and **do-test** targets are added.

- **lang/php**

  Used for ports using PHP in some way: either extensions to PHP, or software written in PHP. Sets MODPHP\_RUN\_DEPENDS, MODPHP\_LIB\_DEPENDS, MODPHP\_WANTLIB, MODPHP\_BIN, MODPHP\_PHPIZE, MODPHP\_PHP\_CONFIG, MODPHP\_INCDIR, and MODPHP\_LIBDIR. Adds to RUN\_DEPENDS unless MODPHP\_RUNDEP is set to **No**. Adds to BUILD\_DEPENDS if MODPHP\_BUILDDEP is set to **Yes**. If MODPHP\_DO\_PHPIZE is set, prepares a build environment for extensions that use phpize.

  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.

- **lang/php/pecl**

  Used for ports for PHP PECL extensions. Sets default SITES, HOMEPAGE, EXTRACT\_SUFX, DESTDIRNAME, MODPHP\_DO\_SAMPLE, MODPHP\_DO\_PHPIZE, AUTOCONF\_VERSION, AUTOMAKE\_VERSION, LIBTOOL\_FLAGS. Provides a default TEST\_TARGET and TEST\_FLAGS unless NO\_TEST or a **do-test** target is defined. Adds common dependencies to RUN\_DEPENDS and BUILD\_DEPENDS. Sets a default PKGNAME and appends to CATEGORIES.

- **lang/python**

  See [python-module(5)](/python-module/5.md).

- **lang/ruby**

  See [ruby-module(5)](/ruby-module/5.md).

- **lang/rust**

  Ports using Rust must use this module so a rebuild can be triggered via SYSTEM\_VERSION-rust on updates of the lang/rust port or changes to the Rust standard library. Sets MODRUST\_WANTLIB as appropriate for the architecture so it can be added to WANTLIB. It adds *lang/rust* to the BUILD\_DEPENDS unless MODRUST\_BUILDDEP is set to anything but **Yes**.

- **lang/tcl**

  Sets MODTCL\_VERSION, MODTCL\_BIN, MODTCL\_INCDIR, MODTCL\_LIBDIR, MODTCL\_BUILD\_DEPENDS, MODTCL\_RUN\_DEPENDS, MODTCL\_LIB\_DEPENDS, and MODTCL\_LIB. Also sets MODTCL\_EXTLIB, MODTCL\_EXT8, MODTCL\_EXT9, and MODTCL\_COMMENT, for Tcl 8/9 ports. See textproc/tdom and x11/dbus-tcl. MODTCL\_VERSION is the default version used by all Tcl ports and may be overridden. Provides MODTCL\_TCLSH\_ADJ and MODTCL\_WISH\_ADJ shell fragments to patch the interpreter path in executable scripts. Also affects CATEGORIES.

- **perl**

  This module is documented in the main [bsd.port.mk(5)](/bsd.port.mk/5.md) manpage.

- **security/heimdal**

  A link from ${LOCALBASE}/heimdal/bin/krb5-config to [krb5-config(1)](/krb5-config/1.md) will be put at the front of the path. Sets LIB\_DEPENDS and WANTLIB according to the values of MODHEIMDAL\_LIB\_DEPENDS, and MODHEIMDAL\_WANTLIB.

- **textproc/intltool**

  Sets MODINTLTOOL\_OVERRIDE. *textproc/intltool* is added to BUILD\_DEPENDS. MODINTLTOOL\_OVERRIDE changes the paths of INTLTOOL\_EXTRACT, INTLTOOL\_MERGE and INTLTOOL\_UPDATE to use the installed versions of intltool-extract, intltool-merge and intltool-update, instead of the version's packages into the distfile of the port using this module. Also affects CONFIGURE\_ENV, MAKE\_ENV and MAKE\_FLAGS by appending MODINTLTOOL\_OVERRIDE to them.

- **wayland/wlroots**

  Used for Wayland ports using the wlroots library. Sets MODWLROOTS\_LIB\_DEPENDS, MODWLROOTS\_WANTLIB, and MODWLROOTS\_VERSION. Appends the corresponding values to LIB\_DEPENDS and WANTLIB, unless MODWLROOTS\_LIBDEP is set to **No**.

- **www/mozilla**

  Sets PKGNAME, HOMEPAGE, SITES, DISTNAME, USE\_GMAKE, and ONLY\_FOR\_ARCHS. EXTRACT\_SUFX defaults 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**.

- **www/pear**

  Used for PHP PEAR ports. Sets default SITES, EXTRACT\_SUFX, PKGNAME. Sets PREFIX to */var/www*. Sets NO\_TEST unless a **do-test** target is defined. Adds common dependencies to RUN\_DEPENDS and BUILD\_DEPENDS, sets MAKE\_FILE and FAKE\_FLAGS appropriately. Makes PEAR\_LIBDIR and PEAR\_PHPBIN available for use in the port. Sets a default PKGNAME and appends to CATEGORIES.

- **x11/gnome**

  See [gnome-module(5)](/gnome-module/5.md).

- **x11/gnustep**

  - **x11/qt5** and **x11/qt6**

  All qt\* modules share a common MODQT\_\* namespace for simple ports. The qt5 module also defines the same variables under MODQT5\_\* and the qt6 module also defines the same variables under MODQT6\_\*, to allow ports to use both modules, such as *print/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 the **devel/qmake** module should be used instead of using MODQT\*\_QMAKE directly.

  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**

  Sets MODTK\_VERSION, MODTK\_BIN, MODTK\_INCDIR, MODTK\_LIBDIR, MODTK\_BUILD\_DEPENDS, MODTK\_RUN\_DEPENDS, MODTK\_LIB\_DEPENDS, and MODTK\_LIB. MODTK\_VERSION is the default version used by all Tk ports and may be overridden. Automatically adds the **lang/tcl** module, provides a default MODTCL\_VERSION to match MODTK\_VERSION, and affects CATEGORIES. Note the MODTCL\_WISH\_ADJ shell fragment in the **lang/tcl** module.

- **x11/xfce4**

  Sets DIST\_SUBDIR, EXTRACT\_SUFX, CONFIGURE\_STYLE, CONFIGURE\_ENV, and USE\_GMAKE. If MODXFCE\_ICON\_CACHE is set to **Yes**, it adds *x11/gtk+4,-guic* to RUN\_DEPENDS. Unless XFCE\_NO\_SRC is set, *textproc/intltool* is added to MODULES. Also affects CATEGORIES.

  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 not set) and either XFCE\_PROJECT, XFCE\_GOODIE, XFCE\_ARTWORK, THUNAR\_PLUGIN, or XFCE\_PLUGIN. One of the latter has to be provided by the port Makefile.

## SEE ALSO

[make(1)](/make/1.md), [bsd.port.mk(5)](/bsd.port.mk/5.md), [cabal-module(5)](/cabal-module/5.md), [cargo-module(5)](/cargo-module/5.md), [gnome-module(5)](/gnome-module/5.md), [go-module(5)](/go-module/5.md), [python-module(5)](/python-module/5.md), [qmake-module(5)](/qmake-module/5.md), [ruby-module(5)](/ruby-module/5.md), [ports(7)](/ports/7.md)
