Using USES MacrosAn Introduction to USESUSES macros make it easy to declare
requirements and settings for a port. They can add
dependencies, change building behavior, add metadata to
packages, and so on, all by selecting simple, preset
values..Each section in this chapter describes a possible value for
USES, along with its possible arguments.
Arguments are appeneded to the value after a colon
(:). Multiple arguments are separated by
commas (,).Using Multiple ValuesUSES= bison perlAdding an ArgumentUSES= gmake:liteAdding Multiple ArgumentsUSES= drupal:7,themeMixing it All TogetherUSES= pgsql:9.3+ cpe python:2.7,build7zPossible arguments: (none), p7zip,
partialExtract using &man.7z.1; instead of &man.bsdtar.1; and sets
EXTRACT_SUFX=.7z. The
p7zip option forces a dependency on the
7z from archivers/p7zip if the one from the base
system is not able to extract the files.
EXTRACT_SUFX is not changed if the
partial option is used, this can be used if
the main distribution file does not have a
.7z extension.adaPossible arguments: (none),
5,
6Depends on an Ada-capable
compiler, and sets CC accordingly. Defaults
to use gcc 5 from ports. Use the
:X version option
to force building with a different version.autoreconfPossible arguments: (none), buildRuns autoreconf. It encapsulates the
aclocal, autoconf,
autoheader, automake,
autopoint, and libtoolize
commands. Each command applies to
${AUTORECONF_WRKSRC}/configure.ac or its
old name,
${AUTORECONF_WRKSRC}/configure.in. If
configure.ac defines subdirectories with
their own configure.ac using
AC_CONFIG_SUBDIRS,
autoreconf will recursively update those as
well. The :build argument only adds build
time dependencies on those tools but does not run
autoreconf. A port can set
AUTORECONF_WRKSRC if
WRKSRC does not contain the path to
configure.ac.blaslapackPossible arguments: (none), atlas,
netlib (default),
gotoblas, openblasAdds dependencies on Blas / Lapack libraries.bdbPossible arguments: (none), 48,
5 (default), 6Add dependency on the Berkeley DB
library. Default to databases/db5. It can also depend on
databases/db48 when using the
:48 argument or databases/db6 with
:6. It is possible to declare a range of
acceptable values, :48+ finds the highest
installed version, and falls back to 4.8 if nothing else is
installed. INVALID_BDB_VER can be used to
specify versions which do not work with this port. The
framework exposes the following variables to the port:BDB_LIB_NAMEThe name of the Berkeley DB
library. For example, when using databases/db5, it contains
db-5.3.BDB_LIB_CXX_NAMEThe name of the Berkeley DBC++ library. For example, when
using databases/db5, it
contains db_cxx-5.3.BDB_INCLUDE_DIRThe location of the Berkeley
DB include directory. For example, when
using databases/db5, it
will contain
${LOCALBASE}/include/db5.BDB_LIB_DIRThe location of the Berkeley
DB library directory. For example, when
using databases/db5, it
contains ${LOCALBASE}/lib.BDB_VERThe detected Berkeley DB
version. For example, if using
USES=bdb:48+ and Berkeley
DB 5 is installed, it contains
5.databases/db48 is
deprecated and unsupported. It must not be used by any
port.bisonPossible arguments: (none), build,
run, bothUses devel/bison By default,
with no arguments or with the build argument,
it implies bison is a build-time dependency,
run implies a run-time dependency, and
both implies both run-time and build-time
dependencies.cargoPossible arguments: (none)Uses Cargo for configuring, building, and testing.
It can be used to port Rust applications that use the Cargo
build system. For more information see .charsetfixPossible arguments: (none)Prevents the port from installing
charset.alias. This must be installed only
by converters/libiconv.
CHARSETFIX_MAKEFILEIN can be set to a path
relative to WRKSRC if
charset.alias is not installed by
${WRKSRC}/Makefile.in.cmakePossible arguments: (none), insource,
noninja, runUses CMake for configuring and
building.By default an out-of-source build is performed, leaving the
sources in WRKSRC free from build artifacts.
With the insource argument, an in-source
build will be performed instead. Setting it should be the
exception when a regular out-of-source build does not
work.By default Ninja is used for
the build. In some cases this does not work correctly. With
the noninja argument, the build will
fallback to using regular make for builds.
It should only be used if a
Ninja-based build does not
work.With the run argument, a run dependency
is registered in addition to a build dependency.For more information see .compilerPossible arguments: (none), env
(default, implicit), c++17-lang,
c++14-lang,
c++11-lang, gcc-c++11-lib,
c++11-lib, c++0x,
c11, openmp,
nestedfct, featuresDetermines which compiler to use based on any given wishes.
Use c++17-lang if the port needs a
C++17-capable compiler,
c++14-lang if the port needs a
C++14-capable compiler, c++11-lang
if the port needs a C++11-capable compiler,
gcc-c++11-lib if the
port needs the g++ compiler with a C++11
library, or c++11-lib if the port needs
a C++11-ready standard library. If the port needs a compiler
understanding C++0X, C11, OpenMP, or nested functions,
the corresponding parameters should be used.Use
features to request a list of features
supported by the default compiler. After including
bsd.port.pre.mk the port can inspect the
results using these variables:COMPILER_TYPE: the default compiler
on the system, either gcc or clangALT_COMPILER_TYPE: the alternative
compiler on the system, either gcc or clang. Only set if
two compilers are present in the base system.COMPILER_VERSION: the first two
digits of the version of the default compiler.ALT_COMPILER_VERSION: the first two
digits of the version of the alternative compiler, if
present.CHOSEN_COMPILER_TYPE: the chosen
compiler, either gcc or clangCOMPILER_FEATURES: the features
supported by the default compiler. It currently lists the
C++ library.cpePossible arguments: (none)Include Common Platform Enumeration
(CPE) information in package manifest as a
CPE 2.3 formatted string. See the CPE
specification for details. To add
CPE information to a port, follow these
steps:Search for the official CPE entry for the software
product either by using the NVD's CPE
search engine or in the official
CPE dictionary (warning, very
large XML file). Do not ever
make up CPE data.Add cpe to USES
and compare the result of make -V CPE_STR
to the CPE dictionary entry. Continue one
step at a time until make -V CPE_STR is
correct.If the product name (second field, defaults to
PORTNAME) is incorrect, define
CPE_PRODUCT.If the vendor name (first field, defaults to
CPE_PRODUCT) is incorrect, define
CPE_VENDOR.If the version field (third field, defaults to
PORTVERSION) is incorrect, define
CPE_VERSION.If the update field (fourth field, defaults to empty) is
incorrect, define CPE_UPDATE.If it is still not correct, check
Mk/Uses/cpe.mk for additional details,
or contact the &a.ports-secteam;.Derive as much as possible of the CPE
name from existing variables such as
PORTNAME and
PORTVERSION. Use variable modifiers to
extract the relevant portions from these variables rather
than hardcoding the name.Always run make -V
CPE_STR and check the output before committing
anything that changes PORTNAME or
PORTVERSION or any other variable which
is used to derive CPE_STR.cranPossible arguments: (none),
auto-plist,
compilesUses the Comprehensive R Archive Network. Specify
auto-plist to automatically generate
pkg-plist. Specify
compiles if the port has code that need to be
compiled.desktop-file-utilsPossible arguments: (none)Uses update-desktop-database from
devel/desktop-file-utils. An
extra post-install step will be run without interfering with any
post-install steps already in the port
Makefile. A line with @desktop-file-utils
will be added to the plist.desthackPossible arguments: (none)Changes the behavior of GNU configure to properly support
DESTDIR in case the original software does
not.displayPossible arguments: (none),
ARGSSet up a virtual display environment. If the environment
variable DISPLAY is not set, then
Xvfb is added as a build dependency,
and CONFIGURE_ENV is extended with the port
number of the currently running instance of
Xvfb. The
ARGS
parameter defaults to install and controls
the phase around which to start and stop the virtual
display.dos2unixPossible arguments: (none)The port has files with line endings in
DOS format which need to be converted.
Several variables can be set to control which files will be
converted. The default is to convert all
files, including binaries. See for
examples.DOS2UNIX_REGEX: match file names
based on a regular expression.DOS2UNIX_FILES: match literal file
names.DOS2UNIX_GLOB: match file names based
on a glob pattern.DOS2UNIX_WRKSRC: the directory from
which to start the conversions. Defaults to
${WRKSRC}.drupalPossible arguments:
7, module,
themeAutomate installation of a port that is a
Drupal theme or module. Use with the
version of Drupal that the port is expecting. For example,
USES=drupal:7,module says that this port
creates a Drupal 6 module. A Drupal 7 theme can be specified
with USES=drupal:7,theme.fakerootPossible arguments: (none)Changes some default behavior of build systems to allow
installing as a user. See for more
information on fakeroot.famPossible arguments: (none), fam,
gaminUses a File Alteration Monitor as a library dependency,
either devel/fam or devel/gamin. End users can set
WITH_FAM_SYSTEM to specify their preference.firebirdPossible arguments: (none), 25Add a dependency to the client library of the Firebird
database.fontsPossible arguments: (none), fc,
fcfontsdir (default),
fontsdir, noneAdds a runtime dependency on tools needed to register fonts.
Depending on the argument, add a @fc ${FONTSDIR}
line, @fcfontsdir
${FONTSDIR} line, @fontsdir
${FONTSDIR} line, or no line if the argument is
none, to the plist.
FONTSDIR defaults to
${PREFIX}/share/fonts/${FONTNAME} and
FONTNAME to ${PORTNAME}.
Add FONTSDIR to PLIST_SUB
and SUB_LISTfortranPossible arguments: gcc (default)Uses the GNU Fortran compiler.fusePossible arguments: 2 (default),
3The port will depend on the FUSE library and handle the
dependency on the kernel module depending on the version of
&os;.gemPossible arguments: (none),
noautoplistHandle building with RubyGems.
If noautoplist is used, the packing list is
not generated automatically.gettextPossible arguments: (none)Deprecated. Will include both gettext-runtime
and gettext-tools.gettext-runtimePossible arguments: (none), lib
(default), build,
runUses devel/gettext-runtime.
By default, with no arguments or with the lib
argument, implies a library dependency on
libintl.so. build and
run implies, respectively a build-time and a
run-time dependency on gettext.gettext-toolsPossible arguments: (none), build
(default), runUses devel/gettext-tools. By
default, with no argument, or with the build
argument, a build time dependency on msgfmt
is registered. With the run argument, a
run-time dependency is registered.ghostscriptPossible arguments: X,
build, run,
nox11A specific version X can be used.
Possible versions are 7,
8, 9, and
agpl (default). nox11
indicates
that the -nox11 version of the port is
required. build and run
add build- and run-time dependencies on
Ghostscript. The default is both
build- and run-time dependencies.glPossible arguments: (none)Provides an easy way to depend on
GL components. The components
should be listed in USE_GL. The available
components are:egladd a library dependency on libEGL.so
from graphics/mesa-libsgbmAdd a library dependency on libgbm.so
from graphics/mesa-libsglAdd a library dependency on libGL.so
from graphics/mesa-libsglesv2Add a library dependency on libGLESv2.so
from graphics/mesa-libsglewAdd a library dependency on libGLEW.so
from graphics/glewgluAdd a library dependency on libGLU.so
from graphics/libGLUglutAdd a library dependency on libglut.so
from graphics/freeglutglwAdd a library dependency on libGLw.so
from graphics/libGLwgmakePossible arguments: (none)Uses devel/gmake as a
build-time dependency and sets up the environment to use
gmake as the default make
for the build.gnomePossible arguments: (none)Provides an easy way to depend on
GNOME components. The components
should be listed in USE_GNOME. The available
components are:atkatkmmcairocairommdconfesoundevolutiondataserver3gconf2gconfmm26gdkpixbufgdkpixbuf2glib12glib20glibmmgnomecontrolcenter3gnomedesktop3gnomedocutilsgnomemenus3gnomemimedatagnomeprefixgnomesharp20gnomevfs2gsoundgtk-update-icon-cachegtk12gtk20gtk30gtkhtml3gtkhtml4gtkmm20gtkmm24gtkmm30gtksharp20gtksourceviewgtksourceview2gtksourceview3gtksourceviewmm3gvfsintlhackintltoolintrospectionlibartlgpl2libbonobolibbonobouilibgda5libgda5-uilibgdamm5libglade2libgnomelibgnomecanvaslibgnomekbdlibgnomeprintlibgnomeprintuilibgnomeuilibgsflibgtkhtmllibgtksourceviewmmlibidllibrsvg2libsigc++12libsigc++20libwncklibwnck3libxml++26libxml2libxsltmetacitynautilus3orbit2pangopangommpangox-compatpy3gobject3pygnome2pygobjectpygobject3pygtk2pygtksourceviewreferencehackvtevte3The default dependency is build- and run-time, it can be
changed with :build or
:run. For example:USES= gnome
USE_GNOME= gnomemenus3:build intlhackSee for more
information.goPorts should not be created for Go libs, see
for more information.Possible arguments: (none), modules,
no_targets, runSets default values and targets used to build
Go software. A build dependency
on the Go compiler port selected via GO_PORT
is added. By default the build is performed in GOPATH mode.
If Go software uses modules, the modules-aware mode can be
switched on with modules argument.
no_targets will setup build environment like
GO_ENV, GO_BUILDFLAGS but
skip creating post-extract,
do-build and
do-install targets.
run will also add a run dependency on
what is in GO_PORT.The build process is controlled by several variables:GO_PKGNAMEThe name of the Go package.
When building in GOPATH mode, this is the directory that
will be created in ${GOPATH}/src and
seen by the go. When building in
modules-aware mode, no GOPATH directories will be created
and GO_PKGNAME value will be only used
as a default for GO_TARGET. If not set
explicitly and GH_SUBDIR is present,
GO_PKGNAME value will be inferred from
${GH_SUBDIR}, otherwise it will be set
to ${PORTNAME}.GO_TARGETThe name of the packages to build. The default
value is ${GO_PKGNAME}.CGO_CFLAGSAdditional CFLAGS values to be
passed to the C compiler by
go.CGO_LDFLAGSAdditional LDFLAGS values to be
passed to the C compiler by
go.GO_BUILDFLAGSAdditional build arguments to be passed to
go install.GO_PORTThe Go compiler port to use. By default this is
lang/go but can be set
to lang/go-devel in
make.conf for testing with future Go
versions.This variable must not be set by individual
ports!gperfPossible arguments: (none)Add a buildtime dependency on devel/gperf if gperf
is not present in the base system.grantleePossible arguments: 5,
selfbuildHandle dependency on Grantlee.
Specify 5 to depend on the
Qt5 based version, devel/grantlee5.
selfbuild is used internally by devel/grantlee5 to get their versions
numbers.groffPossible arguments: build,
run, bothRegisters a dependency on textproc/groff if not present in the
base system.gssapiPossible arguments: (none), base
(default), heimdal, mit,
flags, bootstrapHandle dependencies needed by consumers of the
GSS-API. Only libraries that provide the
Kerberos mechanism are available. By
default, or set to base, the
GSS-API library from the base system is used.
Can also be set to heimdal to use security/heimdal, or
mit to use security/krb5.When the local Kerberos
installation is not in LOCALBASE, set
HEIMDAL_HOME (for heimdal)
or KRB5_HOME (for krb5) to
the location of the Kerberos
installation.These variables are exported for the ports to use:GSSAPIBASEDIRGSSAPICPPFLAGSGSSAPIINCDIRGSSAPILDFLAGSGSSAPILIBDIRGSSAPILIBSGSSAPI_CONFIGURE_ARGSThe flags option can be given alongside
base, heimdal, or
mit to automatically add
GSSAPICPPFLAGS,
GSSAPILDFLAGS, and
GSSAPILIBS to CFLAGS,
LDFLAGS, and LDADD,
respectively. For example, use
base,flags.The bootstrap option is a special prefix
only for use by security/krb5 and
security/heimdal. For example,
use bootstrap,mit.Typical UseOPTIONS_SINGLE= GSSAPI
OPTIONS_SINGLE_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE
GSSAPI_BASE_USES= gssapi
GSSAPI_BASE_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} ${GSSAPI_CONFIGURE_ARGS}
GSSAPI_HEIMDAL_USES= gssapi:heimdal
GSSAPI_HEIMDAL_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} ${GSSAPI_CONFIGURE_ARGS}
GSSAPI_MIT_USES= gssapi:mit
GSSAPI_MIT_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} ${GSSAPI_CONFIGURE_ARGS}
GSSAPI_NONE_CONFIGURE_ON= --without-gssapihordePossible arguments: (none)Add buildtime and runtime dependencies on devel/pear-channel-horde. Other
Horde dependencies can be added
with USE_HORDE_BUILD and
USE_HORDE_RUN. See for more information.iconvPossible arguments: (none), lib,
build,
patch, translit,
wchar_tUses iconv functions, either from the
port converters/libiconv as a
build-time and run-time dependency, or from the base system on
10-CURRENT after a native iconv was committed
in 254273. By default, with no arguments
or with the lib argument, implies
iconv with build-time and run-time
dependencies. build implies a build-time
dependency, and patch implies a patch-time
dependency. If the port uses the WCHAR_T or
//TRANSLIT iconv extensions, add the relevant
arguments so that the correct iconv is used. For more
information see .imakePossible arguments: (none), env,
notall, nomanAdd devel/imake as a
build-time dependency and run xmkmf -a during
the configure stage. If the
env argument is given, the
configure target is not set. If the
flag is a problem for the port, add the
notall argument. If xmkmf
does not generate a install.man
target, add the noman argument.kdePossible arguments: 5Add dependency on KDE components.
See for more information.kmodPossible arguments: (none), debugFills in the boilerplate for kernel module ports,
currently:Add kld to
CATEGORIES.Set SSP_UNSAFE.Set IGNORE if the kernel sources are
not found in SRC_BASE.Define KMODDIR to
/boot/modules by default, add it to
PLIST_SUB and
MAKE_ENV, and create it upon
installation. If KMODDIR is set to
/boot/kernel, it will be rewritten to
/boot/modules. This prevents breaking
packages when upgrading the kernel due to
/boot/kernel being renamed to
/boot/kernel.old in the process.Handle cross-referencing kernel modules upon
installation and deinstallation, using @kld.If the debug argument is given, the
port can install a debug version of the module into
KERN_DEBUGDIR/KMODDIR.
By default, KERN_DEBUGDIR is copied from
DEBUGDIR and set to
/usr/lib/debug. The framework will
take care of creating and removing any required
directories.lhaPossible arguments: (none)Set EXTRACT_SUFX to
.lzhlibarchivePossible arguments: (none)Registers a dependency on archivers/libarchive. Any ports
depending on libarchive must include
USES=libarchive.libeditPossible arguments: (none)Registers a dependency on devel/libedit. Any ports depending on
libedit must include
USES=libedit.libtoolPossible arguments: (none), keepla,
buildPatches libtool scripts. This must be
added to all ports that use libtool. The
keepla argument can be used to keep
.la files. Some ports do not ship with
their own copy of libtool and need a build time dependency on
devel/libtool, use the
:build argument to add such
dependency.linuxPossible arguments: c6,
c7Ports Linux compatibility
framework. Specify c6 to depend on
CentOS 6 packags. Specify
c7 to depend on
CentOS 7 packages. The available
packages are:allegroalsa-plugins-ossalsa-plugins-pulseaudioalsalibatkavahi-libsbasecairocups-libscurlcyrus-sasl2dbusglibdbuslibsdevtoolsdriexpatflacfontconfiggdkpixbuf2gnutlsgraphite2gtk2harfbuzzjasperjbigkitjpeglibasyncnslibaudiofilelibelflibgcryptlibgfortranlibgpg-errorlibmnglibogglibpciaccesslibsndfilelibsouplibssh2libtasn1libthailibtheoralibv4llibvorbislibxml2mikmodnaslibsncurses-basensprnssopenalopenal-softopenldapopenmotifopensslpangopixmanpngpulseaudio-libsqtqt-x11qtwebkitscimlibssdl12sdlimagesdlmixersqlite3tcl85tcp_wrappers-libstifftk85uclxorglibslocalbasePossible arguments: (none),
ldflagsEnsures that libraries from dependencies in
LOCALBASE are used instead of the ones from
the base system. Specify ldflags to add
-L${LOCALBASE}/lib to
LDFLAGS instead of LIBS.
Ports that depend on libraries that are also
present in the base system should use this. It is also used
internally by a few other USES.luaPossible arguments: (none),
XY+,
XY,
build, runAdds a dependency on Lua. By
default this is a library dependency, unless overridden by the
build or run option. The
default version is 5.2, unless set by the
XY parameter (for
example, 51 or
52+).lxqtPossible arguments: (none)Handle dependencies for the LXQt Desktop
Environment. Use USE_LXQT to
select the components needed for the port. See for more information.makeinfoPossible arguments: (none)Add a build-time dependency on makeinfo
if it is not present in the base system.makeselfPossible arguments: (none)Indicates that the distribution files are makeself archives
and sets the appropriate dependencies.matePossible arguments: (none)Provides an easy way to depend on
MATE components. The components
should be listed in USE_MATE. The available
components are:autogencajacommoncontrolcenterdesktopdialogsdocutilsiconthemeintlhackintltoollibmatekbdlibmateweathermarcomenusnotificationdaemonpanelplumapolkitsessionsettingsdaemonThe default dependency is build- and run-time, it can be
changed with :build or
:run. For example:USES= mate
USE_MATE= menus:build intlhackmesonPossible arguments: (none)Provide support for Meson based projects. For more
information see .metaportPossible arguments: (none)Sets the following variables to make it easier to create a
metaport: MASTER_SITES,
DISTFILES, EXTRACT_ONLY,
NO_BUILD, NO_INSTALL,
NO_MTREE, NO_ARCH.mysqlPossible arguments: (none),
version,
client (default), server,
embeddedProvide support for MySQL. If no
version is given, try to find the current installed version.
Fall back to the default version, MySQL-5.6. The possible
versions are 55, 55m,
55p, 56,
56p, 56w,
57, 57p,
80, 100m,
101m, and 102m. The
m and p suffixes are for
the MariaDB and
Percona variants of
MySQL. server and
embedded add a build- and run-time dependency
on the MySQL server. When using
server or embedded, add
client to also add a dependency on
libmysqlclient.so. A port can set
IGNORE_WITH_MYSQL if some versions are not
supported.The framework sets MYSQL_VER to the
detected MySQL version.monoPossible arguments: (none), nugetAdds a dependency on the Mono
(currently only C#) framework by setting the appropriate
dependencies.Specify nuget when the port uses nuget
packages. NUGET_DEPENDS needs to be set with
the names and versions of the nuget packages in the format
name=version.
An optional package origin can be added using
name=version:origin.The helper target, buildnuget,
will output the content of the NUGET_DEPENDS
based on the provided
packages.config.motifPossible arguments: (none)Uses x11-toolkits/open-motif
as a library dependency. End users can set
WANT_LESSTIF for the dependency to be on
x11-toolkits/lesstif instead of
x11-toolkits/open-motif.ncursesPossible arguments: (none), base,
portUses ncurses, and causes some
useful variables to be set.ninjaPossible arguments: (none)Uses ninja to build the
port.objcPossible arguments: (none)Add objective C dependencies (compiler, runtime library) if
the base system does not support it.openalPossible arguments: al,
soft (default), si,
alutUses OpenAL. The backend can be
specified, with the software implementation as the default. The
user can specify a preferred backend with
WANT_OPENAL. Valid values for this knob are
soft (default) and
si.pathfixPossible arguments: (none)Look for Makefile.in and
configure in
PATHFIX_WRKSRC (defaults to
WRKSRC)
and fix common paths to make sure they respect the &os;
hierarchy. For example, it fixes the installation directory
of pkgconfig's .pc files
to ${PREFIX}/libdata/pkgconfig. If
the port uses USES=autoreconf,
Makefile.am will be added to
PATHFIX_MAKEFILEIN automatically.If the port USES=cmake it
will look for CMakeLists.txt in
PATHFIX_WRKSRC. If needed, that default
filename can be changed with
PATHFIX_CMAKELISTSTXT.pearPossible arguments: envAdds a dependency on devel/pear. It will setup default
behavior for software using the PHP
Extension and Application Repository. Using the
env arguments only sets up the
PEAR environment variables. See
for more information.perl5Possible arguments: (none)Depends on Perl. The
configuration is done using USE_PERL5.USE_PERL5 can contain the phases in which
to use Perl, can be
extract, patch,
build, run, or
test.USE_PERL5 can also contain
configure,
modbuild, or modbuildtiny
when Makefile.PL,
Build.PL, or
Module::Build::Tiny's flavor of
Build.PL is required.USE_PERL5 defaults to build
run. When using configure,
modbuild, or modbuildtiny,
build and run are
implied.See for more
information.pgsqlPossible arguments: (none),
X.Y,
X.Y+,
X.Y-Provide support for PostgreSQL. Maintainer can set version
required. Minimum and maximum versions can be specified; for
example, 9.0-, 8.4+.Add PostgreSQL component dependency, using
WANT_PGSQL=component[:target]. for example,
WANT_PGSQL=server:configure pltcl plperl.
The available components are:clientcontribdocspgtclplperlplpythonpltclserverphpPossible arguments: (none), phpize,
ext, zend,
build, cli,
cgi, mod,
web, embed,
pecl, flavors,
noflavorsProvide support for PHP. Add a
runtime dependency on the default PHP version, lang/php56.phpizeUse to build a PHP
extension. Enables flavors.extUse to build, install and register a
PHP extension. Enables
flavors.zendUse to build, install and register a Zend
extension. Enables flavors.buildSet PHP also as a
build-time dependency.cliNeeds the CLI version of
PHP.cgiNeeds the CGI version of
PHP.modNeeds the Apache module for
PHP.webNeeds the Apache module or
the CGI version of
PHP.embedNeeds the embedded library version of
PHP.peclProvide defaults for fetching
PHP extensions from the PECL
repository. Enables flavors.flavorsEnable automatic PHP
flavors generation. Flavors will be generated
for all PHP versions, except the ones present in
IGNORE_WITH_PHP.noflavorsDisable automatic PHP
flavors generation. Must only be
used with extensions provided by
PHP itself.Variables are used to specify which
PHP modules are required, as well as
which version of PHP are
supported.USE_PHPThe list of required PHP
extensions at run-time. Add :build to
the extension name to add a build-time dependency.
Example: pcre xml:build gettextIGNORE_WITH_PHPThe port does not work with
PHP of the given version. For
possible values look at the content of
_ALL_PHP_VERSIONS in
Mk/Uses/php.mk.When building a PHP or
Zend extension with
:ext or :zend, these
variables can be set:PHP_MODNAMEThe name of the PHP or
Zend extension. Default value
is ${PORTNAME}.PHP_HEADER_DIRSA list of subdirectories from which to install header
files. The framework will always install the header files
that are present in the same directory as the
extension.PHP_MOD_PRIOThe priority at which to load the extension. It is a
number between 00 and
99.For extensions that do not depend on any extension,
the priority is automatically set to
20, for extensions that depend on
another extension, the priority is automatically set to
30. Some extensions may need to be
loaded before every other extension, for example www/php56-opcache. Some may need
to be loaded after an extension with a priority of
30. In that case, add
PHP_MOD_PRIO=XX
in the port's Makefile. For example:USES= php:ext
USE_PHP= wddx
PHP_MOD_PRIO= 40These variables are available to use in
PKGNAMEPREFIX or
PKGNAMESUFFIX:PHP_PKGNAMEPREFIXContains
phpXY- where
XY is the current flavor's PHP
version. Use with PHP extensions and modules.PHP_PKGNAMESUFFIXContains
-phpXY where
XY is the current flavor's PHP
version. Use with PHP applications.PECL_PKGNAMEPREFIXContains
phpXY-pecl-
where XY is the current
flavor's PHP version. Use with
PECL modules.With flavors, all PHP extensions, PECL extensions, PEAR
modules must have a different package
name, so they must all use one of these three variables in
their PKGNAMEPREFIX or
PKGNAMESUFFIX.pkgconfigPossible arguments: (none), build
(default), run,
bothUses devel/pkgconf. With no
arguments or with the build argument, it
implies pkg-config as a build-time
dependency. run implies a run-time
dependency and both implies both run-time and
build-time dependencies.purePossible arguments: (none), ffiUses lang/pure. Largely used
for building related pure ports.
With the ffi argument, it implies devel/pure-ffi as a run-time
dependency.pyqtPossible arguments: (none), 4,
5Uses PyQt. If the port is part
of PyQT itself, set PYQT_DIST. Use
USE_PYQT to select the components the port
needs. The available components are:coredbusdbussupportdemodesignerdesignerplugindocguimultimedianetworkopenglqscintilla2sipsqlsvgtestwebkitxmlxmlpatternsThese components are only available with
PyQT4:assistantdeclarativehelpphononscriptscripttoolsThese components are only available with
PyQT5:multimediawidgetsprintsupportqmlserialportwebkitwidgetswidgetsThe default dependency for each component is build- and
run-time, to select only build or run, add
_build or _run to the
component name. For example:USES= pyqt
USE_PYQT= core doc_build designer_runpythonPossible arguments: (none),
X.Y,
X.Y+,
-X.Y,
X.Y-Z.A,
patch,
build, run,
testUses Python. A supported version
or version range can be specified. If Python is only needed at
build time, run time or for the tests, it can be set as a build,
run or test dependency with build,
run, or test. If Python
is also needed during the patch phase, use
patch. See
for more information.PYTHON_NO_DEPENDS=yes can be used when
the variables exported by the framework are needed but a
dependency on Python is not. It can
happen when using with USES=shebangfix,
and the goal is only to fix the shebangs but not add a
dependency on Python.qmailPossible arguments: (none), build,
run, both,
varsUses mail/qmail. With the
build argument, it implies
qmail as a build-time dependency.
run implies a run-time dependency. Using no
argument or the both argument implies both
run-time and build-time dependencies. vars
will only set QMAIL variables for the port to use.qmakePossible arguments: (none), norecursive,
outsource, no_env,
no_configureUses QMake for configuring. For
more information see .qtPossible arguments: 5,
no_envAdd dependency on Qt components.
no_env is passed directly to
USES= qmake. See
for more information.readlinePossible arguments: (none), portUses readline as a library
dependency, and sets CPPFLAGS and
LDFLAGS as necessary. If the
port argument is used or if readline is not
present in the base system, add a dependency on devel/readlinesambaPossible arguments: build,
env, lib,
runHandle dependency on Samba.
env will not add any dependency and only set
up the variables. build and
run will add build-time and run-time
dependency on smbd. lib
will add a dependency on libsmbclient.so.
The variables that are exported are:SAMBAPORTThe origin of the default
Samba port.SAMBAINCLUDESThe location of the Samba
header files.SAMBALIBSThe directory where the
Samba shared libraries are
available.sconsPossible arguments: (none)Provide support for the use of devel/scons. See for more information.shared-mime-infoPossible arguments: (none)Uses update-mime-database from
misc/shared-mime-info. This uses
will automatically add a post-install step in such a way that
the port itself still can specify there own post-install step if
needed. It also add an @shared-mime-info
entry to the plist.shebangfixPossible arguments: (none)A lot of software uses incorrect locations for script
interpreters, most notably /usr/bin/perl
and /bin/bash. The shebangfix macro fixes
shebang lines in scripts listed in
SHEBANG_REGEX,
SHEBANG_GLOB, or
SHEBANG_FILES.SHEBANG_REGEXContains one extended regular
expressions, and is used with the
-iregex argument of &man.find.1;. See
.SHEBANG_GLOBContains a list of patterns used with the
-name argument of &man.find.1;. See
.SHEBANG_FILESContains a list of files or &man.sh.1; globs. The
shebangfix macro is run from ${WRKSRC},
so SHEBANG_FILES can contain paths that
are relative to ${WRKSRC}. It can also
deal with absolute paths if files outside of
${WRKSRC} require patching. See .Currently
Bash,
Java, Ksh,
Lua,
Perl, PHP,
Python,
Ruby, Tcl,
and Tk are supported by
default.There are three configuration variables:SHEBANG_LANGThe list of supported interpreters.interp_CMDThe path to the command interpreter on &os;. The
default value is
${LOCALBASE}/bin/interp.interp_OLD_CMDThe list of wrong invocations of interpreters. These
are typically obsolete paths, or paths used on other
operating systems that are incorrect on &os;. They
will be replaced by the correct path in
interp_CMD.These will always be part of
interp_OLD_CMD:
"/usr/bin/env
interp"
/bin/interp
/usr/bin/interp
/usr/local/bin/interp.interp_OLD_CMD
contain multiple values. Any entry with spaces must be
quoted. See .The fixing of shebangs is done during the
patch phase. If scripts are
created with incorrect shebangs during the
build phase, the build process (for
example, the configure script, or the
Makefiles) must be patched or given the
right path (for example, with
CONFIGURE_ENV,
CONFIGURE_ARGS,
MAKE_ENV, or MAKE_ARGS)
to generate the right shebangs.Correct paths for supported interpreters
are available in
interp_CMD.When used with USES=python,
and the aim is only to fix the shebangs but a dependency on
Python itself is not wanted, use
PYTHON_NO_DEPENDS=yes.Adding Another Interpreter to
USES=shebangfixTo add another interpreter, set
SHEBANG_LANG. For example:SHEBANG_LANG= luaSpecifying all the Paths When Adding an Interpreter to
USES=shebangfixIf it was not already defined, and there were no default
values for
interp_OLD_CMD
and interp_CMD
the Ksh entry could be defined
as:SHEBANG_LANG= ksh
ksh_OLD_CMD= "/usr/bin/env ksh" /bin/ksh /usr/bin/ksh
ksh_CMD= ${LOCALBASE}/bin/kshAdding a Strange Location for an InterpreterSome software uses strange locations for an interpreter.
For example, an application might expect
Python to be located in
/opt/bin/python2.7. The strange path to
be replaced can be declared in the port
Makefile:python_OLD_CMD= /opt/bin/python2.7USES=shebangfix with
SHEBANG_REGEXTo fix all the files in
${WRKSRC}/scripts ending in
.pl, .sh, or
.cgi do:USES= shebangfix
SHEBANG_REGEX= ./scripts/.*\.(sh|pl|cgi)SHEBANG_REGEX is used by running
find -E, which uses modern regular
expressions also known as extended regular expressions. See
&man.re.format.7; for more information.USES=shebangfix with
SHEBANG_GLOBTo fix all the files in ${WRKSRC}
ending in .pl or
.sh, do:USES= shebangfix
SHEBANG_GLOB= *.sh *.plUSES=shebangfix with
SHEBANG_FILESTo fix the files script/foobar.pl and
script/*.sh in
${WRKSRC}, do:USES= shebangfix
SHEBANG_FILES= scripts/foobar.pl scripts/*.shsqlitePossible arguments: (none), 2,
3Add a dependency on SQLite. The
default version used is 3, but version 2 is also possible using
the :2 modifier.sslPossible arguments: (none), build,
runProvide support for OpenSSL.
A build- or run-time only dependency can be specified using
build or run.
These variables are available for the port's use, they are also
added to MAKE_ENV:OPENSSLBASEPath to the OpenSSL installation base.OPENSSLDIRPath to OpenSSL's
configuration files.OPENSSLLIBPath to the OpenSSL
libraries.OPENSSLINCPath to the OpenSSL
includes.OPENSSLRPATHIf defined, the path the linker needs to use to find
the OpenSSL libraries.If a port does not build with an
OpenSSL flavor, set the
BROKEN_SSL variable, and possibly the
BROKEN_SSL_REASON_flavor:BROKEN_SSL= libressl
BROKEN_SSL_REASON_libressl= needs features only available in OpenSSLtarPossible arguments: (none), Z,
bz2, bzip2,
lzma, tbz,
tbz2,
tgz, txz,
xzSet EXTRACT_SUFX to
.tar, .tar.Z,
.tar.bz2, .tar.bz2,
.tar.lzma, .tbz,
.tbz2,
.tgz, .txz or
.tar.xz respectively.tclPossible arguments: version,
wrapper, build,
run, teaAdd a dependency on Tcl. A
specific version can be requested using
version. The version can be empty,
one or more exact version numbers (currently
84, 85, or
86), or a minimal version number (currently
84+, 85+ or
86+). To only request a non version specific
wrapper, use wrapper. A build- or run-time
only dependency can be specified using build
or run. To build the port using the
Tcl Extension Architecture, use
tea. After including
bsd.port.pre.mk the port can inspect the
results using these variables:TCL_VER: chosen major.minor version
of TclTCLSH: full path of the
Tcl interpreterTCL_LIBDIR: path of the
Tcl librariesTCL_INCLUDEDIR: path of the
Tcl C header filesTK_VER: chosen major.minor version of
TkWISH: full path of the
Tk interpreterTK_LIBDIR: path of the
Tk librariesTK_INCLUDEDIR: path of the
Tk C header filesterminfoPossible arguments: (none)Adds @terminfo
to the plist. Use when the port installs
*.terminfo files
in ${PREFIX}/share/misc.tkSame as arguments for tclSmall wrapper when using both Tcl
and Tk. The same variables are
returned as when using Tcl.uidfixPossible arguments: (none)Changes some default behavior (mostly variables) of
the build system to allow installing this port as a normal
user. Try this in the port before using USES=fakeroot or
patching.uniquefilesPossible arguments: (none), dirsMake files or directories 'unique', by adding a prefix or
suffix. If the dirs argument is used, the
port needs a prefix (and only a prefix) based on
UNIQUE_PREFIX for standard directories
DOCSDIR, EXAMPLESDIR,
DATADIR, WWWDIR,
ETCDIR. These variables are available for
ports:UNIQUE_PREFIX: The prefix to be used
for directories and files. Default:
${PKGNAMEPREFIX}.UNIQUE_PREFIX_FILES: A list of files
that need to be prefixed. Default: empty.UNIQUE_SUFFIX: The suffix to be used
for files. Default:
${PKGNAMESUFFIX}.UNIQUE_SUFFIX_FILES: A list of files
that need to be suffixed. Default: empty.varnishPossible arguments: 4,
5Handle dependencies on Varnish
Cache. 4 will add a
dependency on www/varnish4.
5 will add a dependency on www/varnish5.webpluginPossible arguments: (none), ARGSAutomatically create and remove symbolic links for each
application that supports the webplugin framework.
ARGS can be one of:gecko: support plug-ins based on
Geckonative: support plug-ins for Gecko,
Opera, and WebKit-GTKlinux: support Linux plug-insall (default, implicit): support all
plug-in types(individual entries): support only the browsers
listedThese variables can be adjusted:WEBPLUGIN_FILES: No default, must be
set manually. The plug-in files to install.WEBPLUGIN_DIR: The directory to
install the plug-in files to, default
PREFIX/lib/browser_plugins/WEBPLUGIN_NAME.
Set this if the port installs plug-in files outside of the
default directory to prevent broken symbolic links.WEBPLUGIN_NAME: The final directory
to install the plug-in files into, default
PKGBASE.xfcePossible arguments: (none), gtk3Provide support for Xfce related
ports. See for details.The gtk3 argument specifies that the port
requires GTK3 support. It adds
additional features provided by some core components, for
example, x11/libxfce4menu and
x11-wm/xfce4-panel.zipPossible arguments: (none),
infozipIndicates that the distribution files use the ZIP
compression algorithm. For files using the InfoZip algorithm
the infozip argument must be passed to set
the appropriate dependencies.zopePossible arguments: (none)Uses
www/zopeXY.
Mostly used
for building zope related ports.
ZOPE_VERSION can be used by a port to
indicate that a specific version of
zope shall be used.