1. Introduction
2. Installing MacPorts
2.1. Install Xcode
2.2. Install MacPorts
2.3. Upgrade MacPorts
2.4. Uninstall MacPorts
2.5. MacPorts and the Shell
3. Using MacPorts
3.1. The port Command
3.2. Port Variants
3.3. Common Tasks
3.4. Port Binaries
4. Portfile Development
4.1. Portfile Introduction
4.2. Creating a Portfile
4.3. Example Portfiles
4.4. Port Variants
4.5. Patch Files
4.6. Local Portfile Repositories
4.7. Portfile Best Practices
4.8. MacPorts' buildbot
5. Portfile Reference
5.1. Global Keywords
5.2. Global Variables
5.3. Port Phases
5.4. Dependencies
5.5. Variants
5.6. Tcl Extensions & Useful Tcl Commands
5.7. StartupItems
5.8. Livecheck / Distcheck
5.9. PortGroups
5.10. PortGroup Introduction
5.11. PortGroup github
5.12. PortGroup gnustep
5.13. PortGroup golang
5.14. PortGroup haskell
5.15. PortGroup java
5.16. PortGroup perl5
5.17. PortGroup python
5.18. PortGroup ruby
5.19. PortGroup xcode
6. MacPorts Internals
6.1. File Hierarchy
6.2. Configuration Files
6.3. Port Images
6.4. APIs and Libs
6.5. The MacPorts Registry
6.6. Tests
7. MacPorts Project
7.1. Using Trac for Tickets
7.2. Using Git and GitHub
7.3. Contributing to MacPorts
7.4. Port Update Policies
7.5. Updating Documentation
7.6. MacPorts Membership
7.7. The PortMgr Team
8. MacPorts Guide Glossary
Glossary

5.19. PortGroup xcode

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.

5.19.1. xcode PortGroup Specific Keywords

Portfiles using PortGroup xcode allow for port authors to set the following keywords in addition to the general Portfile keywords.

xcode.project

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.

  • Type: optional
  • Default: none
  • Example:

    xcode.project ${name}.xcode
xcode.configuration

Project configuration/buildstyle to use.

  • Type: optional
  • Default: Deployment
  • Example:

    xcode.configuration Main
xcode.target

If present, it overrides build.target and +destroot.target+.

  • Type: optional
  • Default: none
  • Example:

    xcode.target ${name}
xcode.build.settings

Additional settings passed to the xcodebuild tool during the build phase. These settings should be in the X=Y form.

  • Type: optional
  • Default: none
  • Example:

    xcode.build.settings FRAMEWORK_SEARCH_PATHS=${frameworks_dir}
xcode.destroot.type

Type of project that will be installed. This tells the PortGroup xcode how to destroot the project. Correct values are application and +framework+.

  • Type: optional
  • Default: application
  • Example:

    xcode.destroot.type framework
xcode.destroot.path

Where to install the build product.

  • Type: optional
  • Default: ${frameworks_dir} or ${applications_dir} depending on +xcode.destroot.type+.
xcode.destroot.settings

Additional settings passed to the xcodebuild tool during the destroot phase. These settings should be in the X=Y form.

  • Type: optional
  • Default: none
  • Example:

    xcode.destroot.settings SKIP_INSTALL=NO
xcode.universal.settings

Settings passed to the xcodebuild tool when the +universal variant is selected. These settings should be in the X=Y form.

  • Type: optional
  • Default: ARCHS="${universal_archs}" MACOSX_DEPLOYMENT_TARGET=${universal_target}
xcode.universal.sdk

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.

  • Type: optional
  • Default: ${universal_sysroot}

5.19.2. xcode PortGroup Sugar

Portfiles using the PortGroup xcode do not need to define the following variables:

categories
Default: aqua
platforms
Default: macosx
use_configure
Default: no

5.19.3. Portfile-Phase Keywords Affecting the PortGroup xcode

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

build.cmd
Default: +${xcodebuildcmd}+.
build.target

Default: ""

This variable will be ignored if xcode.target is set.

build.args
Default: build
destroot.cmd
Default: ${xcodebuildcmd}
destroot.target

Default: ""

This variable will be ignored if xcode.target is set.