MacPorts, formerly DarwinPorts, is a package manager for macOS and Darwin. It is an open-source software project that aims to simplify the installation of other open source software. It is similar in function to Fink and the BSD ports collections. MacPorts supports universal binaries for PowerPC, Intel-based, and Apple silicon versions of macOS, but migrating from a PowerPC installation of MacPorts to a version on an Intel Mac requires reinstalling all installed ports.
Usage
Updating software There are three main usage modes of port that assist in updating installed software:
sync updates the local ports tree. It does not upgrade any installed packages, but instead retrieves information about new and updated software. It is similar in function to brew update or apt update. selfupdate has the same functionality as sync but also updates the MacPorts system. In most cases, this should be used in preference to just running sync by itself, and it is recommended to run this each time before using MacPorts. upgrade upgrades any installed ports and its dependencies to the latest version found in the local ports tree. It is similar in function to apt upgrade. As an example, one common task is to update outdated ports. This can be done by running the following: MacPorts supports logical operators such as and, or and not, as well as glob patterns (enabled by default) and regex (enabled via --regex). For instance, to update outdated ports excluding all PHP versions, change the above command to the following:
Installing software Users can indicate one or more packages that they wish to install via the install mode, and MacPorts will aim to install them and its dependencies. For example, both LibreOffice and Texmaker can be installed by running the following:Note that this will install the latest version as indicated by the local ports tree. Running selfupdate beforehand will make sure that the downloaded package is the newest version in MacPorts.
Variants Variants provide different options that may be invoked when installing a port. Common actions include adding or removing dependencies and changing build arguments. They provide additional functionality that might not necessarily be useful for all users, but can be useful for others.
For instance, the youtube-dl port provides an ffmpeg variant that is enabled by default. In return for adding two extra dependencies, this then allows for audio to be extracted. Variants can be included or removed using the + or - symbols, so the ffmpeg variant can be disabled by running the following:Multiple variants can be listed one after another by separating them with a space. As an example, it is possible to disable the default prefork MPM in the apache2 port in favour of worker MPM:The variants of a port can be determined by running port variants packagename, or by searching for the port on the MacPorts website.
Frontends
Website The MacPorts Ports website was implemented during Google Summer of Code 2019, with major UI improvements made within the same program in 2020. It displays information about individual ports, such as installation statistics and build-history. These statistics are also available via an API. Users can optionally login to be notified when a port has been updated. There is also a separate MacPorts homepage, that provides information on the project as well as instructions on how to install it.
History
MacPorts was started in 2002 with the involvement of a number of Apple Inc. employees, including Landon Fuller, Kevin Van Vechten, and Jordan Hubbard. It was originally known as DarwinPorts, with the name coming from Darwin and FreeBSD Ports. It began as part of the OpenDarwin project, with its aim to help users on macOS and Darwin to install Unix software. OpenDarwin was shut down in 2006. DarwinPorts was then hosted on Mac OS Forge, an open source hosting service created and maintained by Apple Inc. for third-party projects not supported by Apple. So as to indicate the project's emphasis on macOS, its name was changed to MacPorts. When Apple closed Mac OS Forge in 2016, the project moved to GitHub. As part of this change, git was used as the new version control system, although Trac was still preferred for ticket management over GitHub issues. Version 1.0 was released on April 28, 2005. In December 2005 the project reached a milestone, surpassing 3,000 ports. At that time, package installation involved the source code being downloaded and compiled on the end user's machine. Version 2.0, released in 2011, introduced support for prebuilt binary archives; by default ports are installed using the prebuilt binary archive if available, and are built from source otherwise. As of May 2023, MacPorts has over 33,600 ports and best-effort support can be sourced from the community.
Implementation MacPorts installs software on top of the operating system, providing newer versions of pre-installed packages or software that is not included in macOS. This is in contrast to other package management systems, such as APT and DNF, that are part of the operating system. For this reason, MacPorts is sometimes known as an overlay distribution. Other examples include Fink and Homebrew. In contrast to the FreeBSD Ports Collection, which installs its software in /usr/local, MacPorts stores its data in /opt/local by default, although this can be modified when compiling MacPorts from source. The reason given for this change is that other packaging systems could overwrite what MacPorts has installed, or vice versa. A dedicated directory helps to overcome this problem. Fink follows a similar approach, installing its data into /sw by default.
… excerpt ends here. Continue reading the full article.



![MacPorts: Homepage of the MacPorts Ports site[23]](https://thumb.wikimedia.org/wikipedia/commons/thumb/8/8e/MacPorts_Ports_Website.png/1280px-MacPorts_Ports_Website.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)
![MacPorts: Jordan Hubbard, one of the main creators of MacPorts whilst heading Apple's UNIX team[29][30]](https://upload.wikimedia.org/wikipedia/commons/f/f7/Picture_of_Jordan_Hubbard.jpg?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail_unscaled)
![MacPorts: Output of port info hashcat. This provides information about a port from its portfile.[59][60]](https://thumb.wikimedia.org/wikipedia/commons/thumb/4/49/MacPorts_Hashcat_Info.png/500px-MacPorts_Hashcat_Info.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)