The MacPorts port installation process has a number of distinct phases that are described in detail in this section.
The default scripts coded into MacPorts base performs the standard +configure+
, +make+
, and +make
install+
steps.
For applications that do not conform to this standard, installation phases may be declared in a Portfile to augment or override the default behavior as described in the Portfile Development chapter.
${distfiles}
from ${master_sites}
and place it in ${prefix}/var/macports/distfiles/${name}
.${checksums}
specified in a Portfile
to the checksums of the fetched ${distfiles}.${distfiles}
into the path ${prefix}/var/macports/build/…./work${patchfiles}
to modify a port’s source code file(s).${configure.cmd}
in +${worksrcpath}+
.${build.cmd}
in +${worksrcpath}+
.+port test+
is executed, and always works with a build from source, not a binary.
A failure is only for the user’s information, and does not block a subsequent installation from the build.+make install+
+DESTDIR=${destroot}+
in +${worksrcpath}+
.Using a DESTDIR
variable is a part of standard GNU coding practices, and this variable must be supported in an application’s install routines for MacPorts' destroot phase to work without manual Portfile scripting or source patching.
Urge developers to fully support DESTDIR
in their applications.
+ Understanding the destroot phase is critical to understanding MacPorts, because, unlike some package management systems, MacPorts “stages” an installation into an intermediate location, not the final file destination. MacPorts uses the destroot phase to provide:
Multiple port versions may be installed on the same host, since a port’s files are not directly inserted into ${prefix}
but rather hard-linked into ${prefix}
from an intermediate location during a later activation phase.
Any empty directories in ${destroot}
upon completion of the destroot phase are removed unless a directory name is placed in the value field of the optional destroot.keepdirs
keyword.
${prefix}/var/macports/software
.
See Port Images in the MacPorts Internals chapter for details.${prefix}/var/macports/software
to their final installed locations, usually inside +${prefix}+
.MacPorts keywords are used to specify required or optional items within a Portfile, or to override default options used by MacPorts base for individual ports. Keywords are to be used within the “global” and “variant” sections of Portfiles, and not within optional port phase declarations.
In other words, port phase keywords are not located within port phase declarations, but rather they refer to port phases and set options for those phases, and they take effect whether or not phase declarations have been explicitly defined in a Portfile.
Keyword list modifiers are keywords that end in -append, -delete or -replace. Keywords that support list modifiers are identified under appropriate reference sections below.
-append adds a value to the keyword, -delete removes a previously added item. -replace takes two arguments and replaces the first value from the keyword with the second value. -strsed treats the keyword value as a string and filters it through strsed using the given pattern. There is also a deprecated syntax for -replace which takes only one argument and behaves the same as -strsed.
Keyword list modifiers are most frequently used for these three purposes:
Preserve configure defaults set by a previously executed Portfile keyword or by MacPorts base
MacPorts base sets the gcc compiler flags CFLAGS and LDFLAGS for all ports using configure.cflags
and +configure.ldflags+
, therefore to keep from overwriting the default compiler flags use configure.cflags-append
and +configure.ldflags-append+
.
configure.cflags-append
configure.ldflags-append
Preserve PortGroup Dependencies
Ports in a PortGroup have default library dependencies set by MacPorts base.
Therefore, never use depends_lib
in ports belonging to a PortGroup or it will overwrite the default library dependencies.
Instead, use +depends_lib-append+
.
Add or Delete Items for Variants
When a variant requires more or fewer dependencies, distfiles, or patchfiles, when the variant is invoked you want to add or remove items to the appropriate keyword values list set in the global section of the Portfile.
Use the appropriate keywords, for example:
depends_lib-append
or depends_lib-delete
or depends_lib-replace
distfiles-append
or distfiles-delete
or distfiles-replace
** patchfiles-append
or patchfiles-delete
or patchfiles-replace
Keywords that support pre_args and post_args are used to assemble command strings together in a row, as described in the reference sections below.
But it should be noted that all keyword argument modifiers implicitly support keyword list modifiers.
For example, the keyword configure.pre_args
also supports configure.pre_args-append
and +configure.pre_args-delete+
.
The list of keywords related to the fetch phase.
A list of URLs from which a port’s ${distfiles}
may be retrieved.
Keyword values for master_sites
may include predefined site lists known as “mirrors”, such as sourceforge, gnu, etc.
The file(s) declared in ${distfiles}
will be fetched from one of the locations defined in +master_sites+
, while trying to find the best reachable mirror for the user’s connection.
For a complete list of mirrors and their list of sites, see the file mirror_sites.tcl
located in _resources/port1.0/fetch/
in the ports tree.
If a master_sites
keyword has multiple values, after any mirrors are expanded the list of sites is sorted by ping response times.
The sites are then tried in sorted order until matching ${distfiles}
are found.
none
(but the macports_distfiles
mirror is always implicitly appended)Examples:
master_sites https://www.example.org/files/ \ https://mirror.example.org/example_org/files/
You may also use mirror site lists predefined by MacPorts. Here the sourceforge, gnu, and freebsd mirrors are used.
master_sites sourceforge gnu freebsd
When using mirror master_sites, the subdirectory ${name}
is checked on every mirror.
If the mirror subdirectory does not match ${name}, then you may specify it using after the mirror separated by a colon.
master_sites sourceforge:widget \ gnu:widget
For ports that must fetch multiple download files from different locations, you must label the files with tags and match the tags to a distfiles
keyword.
The format is +mirror:subdirectory:tag+
.
In the example below, file_one.tar.gz is fetched from sourceforge mirrors in subdirectory +${name}+
; file tagtwo.tar.gz is fetched from the gnu mirrors in subdirectory sources.
master_sites sourceforge::tagone \ gnu:sources:tagtwo distfiles file_one.tar.gz:tagone \ file_two.tar.gz:tagtwo
+${master_sites}+
.${name}
Example:
master_sites.mirror_subdir magic
${master_sites}
Example:
patch_sites ftp://ftp.patchcityrepo.com/pub/magic/patches
+${patch_sites}+
.${name}
Example:
patch_sites.mirror_subdir magic
${name}-${version}
Example:
distname ${name}
${distname}${extract.suffix}
Examples:
distfiles ${name}-dev_src.tgz
distfiles file_one.tar.gz:tagone \ file_two.tar.gz:tagtwo
+${distpath}+
.
Override it to store multiple ports' distfiles in the same directory (such as multiple ports providing different versions of the same software), or if a stealth
update has occurred.${name}
Examples:
dist_subdir gcc
dist_subdir ${name}/${version}_1
${distname}
Examples:
worksrcdir ${name}-src-${version}
worksrcdir ${distname}/src
Some mirrors require special options for a resource to be properly fetched.
Change the fetch type.
This is only necessary if a bzr, cvs, git, hg, or svn checkout is being used. standard
is used for a normal http or ftp fetch using ${distfiles}
and is used as default.
standard
standard
bzr
+cvs+
+git+
+hg+
+svn+
Example:
fetch.type svn svn.url svn://example.org svn.revision 2100
HTTP or FTP user to fetch the resource.
Example:
TODO: add example
HTTP or FTP password to fetch the resource.
Example:
TODO: add example
Whether to use EPSV command for FTP transfers.
yes
Example:
fetch.use_epsv no
Whether to ignore the host SSL certificate (for HTTPS).
no
Example:
fetch.ignore_sslcert yes
Bzr may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via bzr may cause non-reproducible builds, so it is strongly discouraged.
The bzr
fetch.type is used to fetch source code from a bzr repository.
This specifies the url from which to fetch files.
Examples:
bzr.url lp:inkscape
bzr.url lp:~callelejdfors/pycg/trunk
Optional tag for fetching with bzr, this specifies the revision to checkout
Example:
bzr.revision 2209
CVS may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via CVS may cause non-reproducible builds, so it is strongly discouraged.
The cvs
fetch.type is used to fetch source code from a CVS repository.
Specify the url from which to fetch files.
Example:
cvs.root :pserver:anonymous@cvs.sv.gnu.org:/sources/emacs
Password to login to the CVS server.
Example:
cvs.password nice-password
Optional for fetching with CVS, this specifies the code revision to checkout.
Example:
cvs.tag HEAD
A date that identifies the CVS code set to checkout.
Example:
cvs.date "12-April-2007"
A CVS module from which to check out the code.
Example:
cvs.module Sources
Git may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via Git may cause non-reproducible builds, so it is strongly discouraged.
The git
fetch.type is used to fetch source code from a git repository.
This specifies the url from which to fetch files.
Examples:
git.url git://git.kernel.org/pub/scm/git/git.git
git.url https://www.kernel.org/pub/scm/git/git.git
Optional tag for fetching with git, this specifies the tag or other commit-ish that git should checkout. Note that any tag on a branch besides HEAD should be prefixed by origin/.
Example:
git.branch 72bf1c8
git.branch origin/next
Mercurial may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via Mercurial may cause non-reproducible builds, so it is strongly discouraged.
The hg
fetch.type is used to fetch source code from a Mercurial repository.
This specifies the url from which to fetch files.
Examples:
hg.url https://www.kernel.org/hg/index.cgi/linux-2.6/
hg.url http://hg.intevation.org/mercurial
Optional tag which should be fetched. Can be a Mercurial tag or a revision. To prevent non-reproducible builds use of tip as revision is discouraged.
Example:
hg.tag v1.3
hg.tag ceb884843737
Subversion may be used as an alternative method of fetching distribution files using the keywords in this section. However, fetching via Subversion may cause non-reproducible builds, so it is strongly discouraged.
The svn
fetch.type is used to fetch source code from an svn repository.
This specifies the url from which to fetch files.
Examples:
svn.url https://www.example.com/svn-repo/mydirectory
svn.url svn://svn.example.com/svn-repo/mydirectory
Optional tag for fetching with Subversion, this specifies the peg revision to checkout; it corresponds to the @REV syntax of the svn cli.
Example:
svn.revision 37192
Optional tag for fetching with Subversion, this specifies whether to check out the code into a working copy, or just export it without the working copy metadata. An export is preferable because it takes half the disk space, but some software expects to be built in a working copy (for example because it wants to record the revision number into itself somewhere).
Example:
svn.method checkout
The list of keywords related to the checksum phase.
Checksum(s) of the distribution files. For ports with multiple distribution files, filenames must be included to associate files with their checksums. Each checksum entry should also indicate the file’s size.
At least two checksum types (typically rmd160 and sha256) should be used to ensure the integrity of the distfiles.
Examples:
checksums rmd160 0c1147242adf476f5e93f4d59b553ee3ea378b23 \ sha256 baf8a29ff721178317aac7b864c2d392b1accc02de8677dd24c18fd5717bf26e \ size 1039840
checksums ${distname}${extract.suffix} \ rmd160 0c1147242adf476f5e93f4d59b553ee3ea378b23 \ sha256 883715307c31ae2c145db15d2404d89a837f4d03d7e6932aed21d1d1f21dad89 \ size 2429530 \ hobbit.tar.gz \ rmd160 82b9991f3bf0ceedbf74c188c5fa44b98b5e40c9 \ sha256 2c3afd16915e9f8eac2351673f8b599f5fd2ff9064d4dfe61f750d72bab740b3 \ size 8594032
The list of keywords related to the extract phase.
This keyword is used to specify that the extract phase should be done as the root user.
no
Example:
extract.asroot no
This keyword is used to specify the extract suffix type.
.tar.gz
Example:
extract.suffix .tgz
This keyword is for downloads that are compressed using the 7z algorithm. When invoked, it automatically sets:
extract.suffix = .7z extract.cmd = 7za
no
Example:
use_7z yes
This keyword is for downloads that are tarred and bzipped. When invoked, it automatically sets:
extract.suffix = .tar.bz2 extract.cmd = bzip
no
Example:
use_bzip2 yes
This keyword is for downloads that are compressed using the lzma algorithm. When invoked, it automatically sets:
extract.suffix = .tar.lz extract.cmd = lzip
no
Example:
use_lzip yes
This keyword is for downloads that are compressed using the lzma algorithm. When invoked, it automatically sets:
extract.suffix = .lzma extract.cmd = lzma
no
Example:
use_lzma yes
This keyword is for downloads that are uncompressed tar archives. When invoked, it automatically sets:
extract.suffix = .tar extract.cmd = tar extract.pre_args = -xf
no
Example:
use_tar yes
This keyword is for downloads that are zipped. When invoked, it automatically sets:
extract.suffix = .zip extract.cmd = unzip extract.pre_args = -q extract.post_args = "-d ${extract.dir}"
no
Example:
use_zip yes
This keyword is for downloads that are compressed using the xz tool. When invoked, it automatically sets:
extract.suffix = .tar.xz extract.cmd = xz
no
Example:
use_xz yes
This keyword is used to specify if the directory worksrcdir
is part of the distfile or if it should be created automatically and the distfiles should be extracted there instead.
This is useful for distfiles with a flat structure which would pollute the worksrcdir
with lots of files.
no
Example:
extract.mkdir yes
List of files to extract into +${worksrcpath}+
.
Only use if default extract behavior is not correct for your port.
${distfiles}
Example:
extract.only foo.tar.gz
extract.only-append bar.tar.gz extract.only-delete foo.tar.gz
Command to perform extraction.
+gzip+
Example:
extract.cmd gunzip
Main arguments to +extract.cmd+
; additional arguments passed before and after the main arguments.
${distpath}/${distfile}
Example:
extract.args ${distpath}/${distfile}
The following argument modifiers are available:
+extract.pre_args+
, defaults to: -dc
+extract.post_args+
, defaults to: "| tar -xf -"
Examples:
extract.pre_args xf extract.post_args "| gnutar -x"
The list of keywords related to the patch phase.
Specify the base path for patch files.
${worksrcpath}
Example:
patch.dir ${worksrcpath}/util
Specify the command to be used for patching files.
+patch+
Example:
patch.cmd cat
Specify patch files to be applied for a port; list modifiers specify patchfiles to be added or removed from a previous patchfile declaration.
Example:
patchfiles patch-destdir-variable-fix.diff \ patch-source.c.diff
patchfiles-append patch-configure.diff patchfiles-delete patch-destdir-variable-fix.diff
Main arguments to +patch.cmd+
; optional argument modifiers pass arguments before and after the main arguments.
Example:
patch.args ???
The following argument modifiers are available:
+patch.pre_args+
, defaults to: -p0
+patch.post_args+
, defaults to: noneExamples:
patch.pre_args -p1 patch.post_args ???
The list of keywords related to the configure phase.
MacPorts base sets some important default configure options, so should use the -append version of most configure keywords so you don’t overwrite them.
For example, MacPorts base sets default configure.cflags
so you should always use configure.cflags-append
to set additional CFLAGS in Portfiles.
Sets if the configure phase should be run.
Can be used if the port has no ./configure
script.
yes
Example:
use_configure no
Selects the command to be run in the default configure phase.
./configure
Example:
configure.cmd ./config.sh
Set environment variables for configure; list modifiers add and delete items from a previous Portfile configure.env keyword, or a default set by MacPorts base. If available, it is encouraged to use the predefined options (like configure.cflags) instead of modifying configure.env directly.
CFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib
Example:
configure.env QTDIR=${prefix}/lib/qt3
configure.env-append ABI=32 configure.env-delete TCLROOT=${prefix}
Set optimization compiler flags; list modifiers add or delete items from a previous Portfile configure.optflags keyword or the default set by MacPorts base.
-Os
Example:
configure.optflags -O2
configure.optflags-append -finline-functions configure.optflags-delete -Os
Set CFLAGS compiler flags; list modifiers add or delete items from a previous Portfile configure.cflags keyword or the default set by MacPorts base.
${configure.optflags}
Example:
configure.cflags -Os -flat_namespace
configure.cflags-append "-undefined suppress" configure.cflags-delete -O2
Set LDFLAGS compiler flags; list modifiers add or delete items from a previous Portfile configure.ldflags keyword or the default set by MacPorts base.
-L${prefix}/lib -Wl,-headerpad_max_install_names
Example:
configure.ldflags "-L${worksrcpath}/zlib -lz"
configure.ldflags-append "-L/usr/X11R6/lib -L${worksrcpath}/lib" configure.ldflags-delete -L${prefix}/lib/db44
Set CPPFLAGS to be passed to the C processor; list modifiers add or delete items from a previous Portfile configure.cppflags keyword or the default set by MacPorts base.
-I${prefix}/include
Example:
configure.cppflags -I${worksrcpath}/include
configure.cppflags-append "-I/usr/X11R6/lib -I${worksrcpath}/lib -DHAVE_RRD_12X" configure.cppflags-delete -I${prefix}/lib/db44
Set CXXFLAGS to be passed to the C++ processor; list modifiers add or delete items from a previous Portfile configure.cxxflags keyword or the default set by MacPorts base.
${configure.optflags}
Example:
TODO: add example
TODO: add description
${configure.optflags}
Example:
TODO: add example
TODO: add description
Example:
TODO: add example
TODO: add description
Example:
TODO: add example
Set FFLAGS to be passed to the Fortran compiler; list modifiers add or delete items from a previous Portfile configure.fflags keyword or the default set by MacPorts base.
${configure.optflags}
Example:
configure.fflags -Os
Set FCFLAGS to be passed to the Fortran compiler; list modifiers add or delete items from a previous Portfile configure.fcflags keyword or the default set by MacPorts base.
${configure.optflags}
Example:
configure.fcflags -Os
Set F90FLAGS to be passed to the Fortran 90 compiler; list modifiers add or delete items from a previous Portfile configure.f90flags keyword or the default set by MacPorts base.
${configure.optflags}
Example:
configure.f90flags -Os
C compiler for the CC environment variable when invoking the configure script.
???
Example:
configure.cc ${prefix}/bin/gcc-mp-4.2
C preprocessor for the CPP environment variable when invoking the configure script.
???
Example:
configure.cpp /usr/bin/cpp-3.3
C++ compiler for the CXX environment variable when invoking the configure script.
???
Example:
configure.cxx /usr/bin/g++-4.0
Objective-C compiler for the OBJC environment variable when invoking the configure script.
???
Example:
configure.objc /usr/bin/gcc-4.0
Fortran compiler for the FC environment variable when invoking the configure script.
???
Example:
configure.fc ${prefix}/bin/gfortran-mp-4.2
Fortran 77 compiler for the F77 environment variable when invoking the configure script.
???
Example:
configure.f77 ${prefix}/bin/gfortran-mp-4.2
Fortran 90 compiler for the F90 environment variable when invoking the configure script.
???
Example:
configure.f90 ${prefix}/bin/gfortran-mp-4.2
Java compiler for the JAVAC environment variable when invoking the configure script.
???
Example:
configure.javac ${prefix}/bin/jikes
Select a compiler suite to fill the compiler environment variables.
All variables/tools a compiler suite can provide are set.
Manually set variables are not overwritten.
Keep in mind that not all compiler suites might be available on your platform: gcc-3.3
is available on Mac OS X 10.3 and 10.4 PowerPC, gcc-4.0
is available on 10.4 and 10.5, gcc-4.2
and llvm-gcc-4.2
are available on 10.5 and 10.6, and clang
is available on 10.6 and later.
Only use it if a port really needs a different compiler.
apple-gcc-4.2
on Mac OS X 10.4gcc-4.2
with Xcode 3.x on Mac OS X 10.5 and 10.6llvm-gcc-4.2
with Xcode 4.0 through 4.2 on Mac OS X 10.6 and 10.7clang
with Xcode 4.3 and later on OS X 10.7 and latergcc-3.3
gcc-4.0
+gcc-4.2+
+llvm-gcc-4.2+
+clang+
+macports-clang-3.3+
+macports-clang-3.4+
+macports-clang-3.7+
+macports-clang-3.8+
+macports-clang-3.9+
+macports-clang-4.0+
+macports-clang-5.0+
+macports-clang-6.0+
+apple-gcc-4.0+
+apple-gcc-4.2+
+macports-gcc-4.3+
+macports-gcc-4.4+
+macports-gcc-4.5+
+macports-gcc-4.6+
+macports-gcc-4.7+
+macports-gcc-4.8+
+macports-gcc-4.9+
+macports-gcc-5+
+macports-gcc-6+
+macports-gcc-7+
+macports-gcc-8+
Example:
configure.compiler macports-gcc-4.5
Set PERL flag for selecting a Perl interpreter.
???
Example:
configure.perl ${prefix}/bin/perl5.26
Set PYTHON flag for selecting a Python interpreter.
???
Example:
configure.python ${prefix}/bin/python2.7
Set RUBY flag for selecting a Ruby interpreter.
???
Example:
configure.ruby ${prefix}/bin/ruby
Set INSTALL
flag for selecting an install tool; used for copying files and creating directories.
/usr/bin/install
Example:
configure.install ${prefix}/bin/ginstall
Set AWK flag for selecting an awk executable.
???
Example:
configure.awk ${prefix}/bin/gawk
Set BISON flag for selecting a bison executable, a parser generator.
???
Example:
configure.bison /usr/bin/bison
Set PKG_CONFIG flag for helping find pkg_config, a tool for retrieving information about installed libraries.
???
Example:
configure.pkg_config ${prefix}/bin/pkg-config
Set PKG_CONFIG_PATH flag for telling pkg_config where to search for information about installed libraries.
${prefix}/lib/pkgconfig:${prefix}/share/pkgconfig
Example:
configure.pkg_config_path ${python.prefix}/lib/pkgconfig
Main arguments to +configure.cmd+
; optional argument modifiers pass arguments before and after the main arguments.
Example:
configure.args --bindir=${prefix}/bin
The following argument modifiers are available:
+configure.pre_args+
, defaults to: --prefix=${prefix}
+configure.post_args+
, defaults to: noneExamples:
configure.pre_args --prefix=${prefix}/share/bro configure.post_args OPT="-D__DARWIN_UNIX03"
Universal keywords are used to make a port compile on OS X for multiple architectures.
There is a default universal variant made available to all ports by MacPorts base, so redefining universal keywords should only be done to make a given port compile if the default options fail to do so.
Arguments used in the configure script to build the port universal.
--disable-dependency-tracking
Example:
TODO: add example
Additional flags to put in the CFLAGS environment variable when invoking the configure script.
Default value is based on +${configure.universal_archs}+
.
Default:
(PowerPC Tiger) -isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
(Intel Tiger / Leopard) -arch i386 -arch ppc
(Snow Leopard and later) -arch x86_64 -arch i386
Example:
TODO: add example
Additional flags to put in the CPPFLAGS environment variable when invoking the configure script.
Default:
(PowerPC Tiger) -isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk
(others) none
Example:
TODO: add example
Additional flags to put in the CXXFLAGS environment variable when invoking the configure script.
Default value is based on +${configure.universal_archs}+
.
Default:
(PowerPC Tiger) -isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
(Intel Tiger / Leopard) -arch i386 -arch ppc
(Snow Leopard and later) -arch x86_64 -arch i386
Example:
TODO: add example
Additional flags to put in the LDFLAGS environment variable when invoking the configure script.
Default:
(PowerPC Tiger) -Wl,-syslibroot,${developer_dir}/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
(Intel Tiger / Leopard) -arch i386 -arch ppc
(Snow Leopard and later) -arch x86_64 -arch i386
Example:
TODO: add example
The list of configure keywords available for ports that need automake and/or autoconf.
Whether or not to use autoreconf
no
Example:
use_autoreconf yes
Arguments to pass to autoreconf.
--install --verbose
Example:
autoreconf.args --install --verbose --force
Directory in which to run +${autoreconf.cmd}+
.
${worksrcpath}
Example:
autoreconf.dir ./src
Whether or not to use automake.
no
Example:
use_automake yes
Environment variables to pass to automake.
Example:
automake.env CFLAGS=-I${prefix}/include
Arguments to pass to automake.
Example:
automake.args --foreign
Directory in which to run +${automake.cmd}+
.
${worksrcpath}
Example:
automake.dir ./src
Whether or not to use autoconf.
no
Example:
use_autoconf yes
Environmental variables to pass to autoconf.
Example:
autoconf.env CFLAGS=-I${prefix}/include/gtk12
Arguments to pass to autoconf.
Example:
autoconf.args "-l src/aclocaldir"
Directory in which to run +${autoconf.cmd}+
.
${worksrcpath}
Example:
autoconf.dir src
The list of keywords related to the build phase.
Make command to run in +${worksrcdir}+
.
Only use it if you can’t use +build.type+
.
+make+
Example:
build.cmd scons
Defines which build software is required and sets ${build.cmd}
accordingly.
The available options are BSD Make, GNU Make, and Xcode.
default
(the default Make on the current platform)default
bsd
+gnu+
+xcode+
Example:
build.type bsd
Main arguments to +${build.cmd}+
; optional argument modifiers pass arguments before and after the main arguments.
Example:
build.args -DNOWARN
The following argument modifiers are available:
+build.pre_args+
, defaults to: ${build.target}
+build.post_args+
, defaults to: noneExamples:
build.pre_args -project AudioSlicer.xcode build.post_args CFLAGS_SYS="-DUSE_FREETYPE -DPREFER_FREETYPE"
Build target to pass to +${build.cmd}+
; list modifiers add or delete items from a previous Portfile build.target keyword or the default set by MacPorts base.
all
Example:
build.target all-src
build.target-append doc extra build.target-delete compat
Set environment variables for build; list modifiers add and delete items from a previous Portfile build.env keyword, or a default set by MacPorts base.
This keyword is for specifying whether or not it is safe for a port to use multiple CPUs or multiple cores in parallel during its build phase.
If use_parallel_build
is not set to “no” in a given port, the option -j${build.jobs}
is passed to ${build.cmd}
(if ${build.cmd}
is +make+
or +scons+
).
yes
Example:
use_parallel_build no
The number of simultaneous jobs to run when parallel build is enabled.
The default value is based on the variable buildmakejobs
in macports.conf
.
buildmakejobs
is 0, the number of CPU cores in the machine, or the number of GB of physical memory plus one, whichever is less. Otherwise, the actual value of +${buildmakejobs}+
.The list of keywords related to the test phase.
Enable running test suites bundled with a port.
no
Example:
test.run yes
Test command to run relative to +${worksrcdir}+
.
${build.cmd}
Example:
test.cmd checks.sh
Test target to pass to +${test.cmd}+
.
test
Example:
test.target checks
Main arguments to +test.cmd+
; optional argument modifiers pass arguments before and after the main arguments.
Example:
test.args -f Makefile.test
The following argument modifiers are available:
+test.pre_args+
, defaults to: ${test.target}
+test.post_args+
, defaults to: noneSet environment variables for test; list modifiers add and delete items from a previous Portfile test.env keyword, or a default set by MacPorts base.
Often DYLD_LIBRARY_PATH
is set here to support testing dynamically linked libraries.
Example:
test.env DYLD_LIBRARY_PATH=${worksrcpath}/src/.libs
The list of keywords related to the destroot phase.
Install command to run relative to +${worksrcdir}+
.
${build.cmd}
Example:
destroot.cmd scons
Main arguments to +${destroot.cmd}+
; optional argument modifiers pass arguments before and after the main arguments.
Example:
destroot.args BINDIR=${prefix}/bin
The following argument modifiers are available:
+destroot.pre_args+
, defaults to: ${destroot.target}
+destroot.post_args+
, defaults to: ${destroot.destdir}
Examples:
destroot.pre_args -project AudioSlicer.xcode destroot.post_args INSTDIR=${destroot}${prefix}
Install target to pass to +${destroot.cmd}+
; list modifiers add or delete items from a previous Portfile destroot.target keyword or the default set by MacPorts base.
install
Example:
destroot.target install install-config install-commandmode
destroot.target-append install-plugins destroot.target-delete install-commandmode
Arguments passed to ${destroot.cmd}
via ${destroot.post_args}
to install correctly into the destroot.
DESTDIR=${destroot}
Example:
destroot.destdir prefix=${destroot}${prefix}
If an application’s Makefile properly supports the DESTDIR variable, MacPorts will automatically destroot the port properly. A port must destroot properly or the port will not install correctly, upgrade, or uninstall. If not, you may need to set this variable, or even patch the application’s Makefile.
Umask to use during destroot.
022
Example:
destroot.umask 002
A list of directories that should not be removed if empty upon destroot completion.
Example:
destroot.keepdirs ${destroot}${prefix}/var/run \ ${destroot}${prefix}/var/log \ ${destroot}${prefix}/var/cache/mrtg
MacPorts tests for compliance to the common directory structure in +${prefix}+
.
If a port is not compliant with the standard, set it to +yes+
.
You can find the macports standard in MacPorts File Hierarchy or in the porthier(7) man page.
If destroot.violate_mtree
is set to +yes+
, the following warning is issued during the installation.
Warning: portname requests to install files outside the common directory structure!
+
This means that the port installed files outside of their normal locations in +${prefix}+
.
These could be files totally outside of +${prefix}+
, which could cause problems on your computer, or files inside of ${prefix}
that are not in a standard location.
Use +port contents
to see the location for all files that were installed by a given port.+portname+
+
no
Example:
destroot.violate_mtree yes