PortGroup xcode
allows for efficient porting of Xcode-based opensource software.
A minimum Portfile for PortGroup
xcode
uses defaults for the configuration, build, and destroot phases.
It also defines some values for Xcode-based software.
Using PortGroup xcode
is a way to make your port able to tolerate Xcode version updates because the PortGroup is tested against all supported macOS and Xcode versions.
Portfiles using PortGroup xcode
allow for port authors to set the following keywords in addition to the general Portfile keywords.
The path relative to ${build.dir}
and ${destroot.dir}
of the Xcode project.
If unset, Xcode Tools should be able to determine it automatically.
It usually succeeds if there is only a single project in the directory.
Example:
xcode.project ${name}.xcode
Project configuration/buildstyle to use.
Deployment
Example:
xcode.configuration Main
If present, it overrides build.target
and +destroot.target+
.
Example:
xcode.target ${name}
Additional settings passed to the xcodebuild tool during the build phase. These settings should be in the X=Y form.
Example:
xcode.build.settings FRAMEWORK_SEARCH_PATHS=${frameworks_dir}
Type of project that will be installed.
This tells the PortGroup xcode how to destroot the project.
Correct values are application
and +framework+
.
application
Example:
xcode.destroot.type framework
Where to install the build product.
${frameworks_dir}
or ${applications_dir}
depending on +xcode.destroot.type+
.Additional settings passed to the xcodebuild tool during the destroot phase. These settings should be in the X=Y form.
Example:
xcode.destroot.settings SKIP_INSTALL=NO
Settings passed to the xcodebuild tool when the +universal variant is selected. These settings should be in the X=Y form.
ARCHS="${universal_archs}" MACOSX_DEPLOYMENT_TARGET=${universal_target}
SDK to use when the +universal variant is selected. The argument may be an absolute path to an SDK, or the canonical name of an SDK.
${universal_sysroot}
Portfiles using the PortGroup xcode do not need to define the following variables:
The following Portfile phase keywords affect the PortGroup xcode in a unique way. In most cases, you will not need to set any of these keywords in the Portfile. See
+${xcodebuildcmd}+
.Default: ""
This variable will be ignored if xcode.target
is set.
build
${xcodebuildcmd}
Default: ""
This variable will be ignored if xcode.target
is set.