<s>
MacPorts	B-Application
,	O
formerly	O
DarwinPorts	B-Application
,	O
is	O
a	O
package	B-Application
manager	I-Application
for	O
macOS	B-Application
and	O
Darwin	B-Operating_System
.	O
</s>
<s>
It	O
is	O
an	O
open-source	B-Application
software	I-Application
project	O
that	O
aims	O
to	O
simplify	O
the	O
installation	O
of	O
other	O
open	B-Application
source	I-Application
software	I-Application
.	O
</s>
<s>
It	O
is	O
similar	O
in	O
function	O
to	O
Fink	B-Application
and	O
the	O
BSD	B-Application
ports	I-Application
collections	O
.	O
</s>
<s>
MacPorts	B-Application
allows	O
the	O
installation	O
of	O
a	O
number	O
of	O
packages	O
by	O
entering	O
the	O
command	O
sudo	O
port	O
install	O
packagename	O
in	O
the	O
Terminal	B-Application
,	O
which	O
will	O
then	O
download	O
,	O
compile	O
if	O
necessary	O
,	O
and	O
install	O
the	O
requested	O
software	O
,	O
while	O
also	O
installing	O
any	O
required	O
dependencies	O
automatically	O
.	O
</s>
<s>
MacPorts	B-Application
supports	O
universal	B-Operating_System
binaries	I-Operating_System
for	O
PowerPC	B-Architecture
,	O
Intel-based	O
,	O
and	O
Apple	B-Device
silicon	I-Device
versions	O
of	O
macOS	B-Application
,	O
but	O
migrating	O
from	O
a	O
PowerPC	B-Architecture
installation	O
of	O
MacPorts	B-Application
to	O
a	O
version	O
on	O
an	O
Intel	O
Mac	O
requires	O
reinstalling	O
all	O
installed	O
ports	O
.	O
</s>
<s>
sync	O
updates	O
the	O
local	O
ports	B-Application
tree	I-Application
.	O
</s>
<s>
It	O
is	O
similar	O
in	O
function	O
to	O
brew	O
update	O
or	O
apt	B-Application
update	O
.	O
</s>
<s>
selfupdate	O
has	O
the	O
same	O
functionality	O
as	O
sync	O
but	O
also	O
updates	O
the	O
MacPorts	B-Application
system	O
.	O
</s>
<s>
In	O
most	O
cases	O
,	O
this	O
should	O
be	O
used	O
in	O
preference	O
to	O
just	O
running	O
sync	O
by	O
itself	O
,	O
and	O
it	O
is	O
recommended	O
to	O
run	O
this	O
each	O
time	O
before	O
using	O
MacPorts	B-Application
.	O
</s>
<s>
upgrade	O
upgrades	O
any	O
installed	O
ports	O
and	O
its	O
dependencies	O
to	O
the	O
latest	O
version	O
found	O
in	O
the	O
local	O
ports	B-Application
tree	I-Application
.	O
</s>
<s>
It	O
is	O
similar	O
in	O
function	O
to	O
apt	B-Application
upgrade	O
.	O
</s>
<s>
This	O
can	O
be	O
done	O
by	O
running	O
the	O
following	O
:	O
MacPorts	B-Application
supports	O
logical	O
operators	O
such	O
as	O
and	O
,	O
or	O
and	O
not	O
,	O
as	O
well	O
as	O
glob	B-Language
patterns	I-Language
(	O
enabled	O
by	O
default	O
)	O
and	O
regex	B-Language
(	O
enabled	O
via	O
--regex	O
)	O
.	O
</s>
<s>
For	O
instance	O
,	O
to	O
update	O
outdated	O
ports	O
excluding	O
all	O
PHP	B-Application
versions	O
,	O
change	O
the	O
above	O
command	O
to	O
the	O
following	O
:	O
</s>
<s>
Users	O
can	O
indicate	O
one	O
or	O
more	O
packages	O
that	O
they	O
wish	O
to	O
install	O
via	O
the	O
install	O
mode	O
,	O
and	O
MacPorts	B-Application
will	O
aim	O
to	O
install	O
them	O
and	O
its	O
dependencies	O
.	O
</s>
<s>
For	O
example	O
,	O
both	O
LibreOffice	B-Application
and	O
Texmaker	O
can	O
be	O
installed	O
by	O
running	O
the	O
following:Note	O
that	O
this	O
will	O
install	O
the	O
latest	O
version	O
as	O
indicated	O
by	O
the	O
local	O
ports	B-Application
tree	I-Application
.	O
</s>
<s>
Running	O
selfupdate	O
beforehand	O
will	O
make	O
sure	O
that	O
the	O
downloaded	O
package	O
is	O
the	O
newest	O
version	O
in	O
MacPorts	B-Application
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
youtube-dl	B-Protocol
port	O
provides	O
an	O
ffmpeg	B-Library
variant	O
that	O
is	O
enabled	O
by	O
default	O
.	O
</s>
<s>
Variants	O
can	O
be	O
included	O
or	O
removed	O
using	O
the	O
+	O
or	O
-	O
symbols	O
,	O
so	O
the	O
ffmpeg	B-Library
variant	O
can	O
be	O
disabled	O
by	O
running	O
the	O
following:Multiple	O
variants	O
can	O
be	O
listed	O
one	O
after	O
another	O
by	O
separating	O
them	O
with	O
a	O
space	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
it	O
is	O
possible	O
to	O
disable	O
the	O
default	O
prefork	O
MPM	O
in	O
the	O
apache2	B-Application
port	O
in	O
favour	O
of	O
worker	O
MPM:The	O
variants	O
of	O
a	O
port	O
can	O
be	O
determined	O
by	O
running	O
port	O
variants	O
packagename	O
,	O
or	O
by	O
searching	O
for	O
the	O
port	O
on	O
the	O
MacPorts	B-Application
website	O
.	O
</s>
<s>
The	O
MacPorts	B-Application
Ports	O
website	O
was	O
implemented	O
during	O
Google	B-Application
Summer	I-Application
of	I-Application
Code	I-Application
2019	O
,	O
with	O
major	O
UI	O
improvements	O
made	O
within	O
the	O
same	O
program	O
in	O
2020	O
.	O
</s>
<s>
These	O
statistics	O
are	O
also	O
available	O
via	O
an	O
API	B-General_Concept
.	O
</s>
<s>
There	O
is	O
also	O
a	O
separate	O
MacPorts	B-Application
homepage	O
,	O
that	O
provides	O
information	O
on	O
the	O
project	O
as	O
well	O
as	O
instructions	O
on	O
how	O
to	O
install	O
it	O
.	O
</s>
<s>
MacPorts	B-Application
was	O
started	O
in	O
2002	O
with	O
the	O
involvement	O
of	O
a	O
number	O
of	O
Apple	O
Inc	O
.	O
employees	O
,	O
including	O
Landon	O
Fuller	O
,	O
Kevin	O
Van	O
Vechten	O
,	O
and	O
Jordan	O
Hubbard	O
.	O
</s>
<s>
It	O
was	O
originally	O
known	O
as	O
DarwinPorts	B-Application
,	O
with	O
the	O
name	O
coming	O
from	O
Darwin	B-Operating_System
and	O
FreeBSD	B-Application
Ports	I-Application
.	O
</s>
<s>
It	O
began	O
as	O
part	O
of	O
the	O
OpenDarwin	O
project	O
,	O
with	O
its	O
aim	O
to	O
help	O
users	O
on	O
macOS	B-Application
and	O
Darwin	B-Operating_System
to	O
install	O
Unix	B-Application
software	O
.	O
</s>
<s>
DarwinPorts	B-Application
was	O
then	O
hosted	O
on	O
Mac	B-Application
OS	I-Application
Forge	O
,	O
an	O
open	O
source	O
hosting	O
service	O
created	O
and	O
maintained	O
by	O
Apple	O
Inc	O
.	O
for	O
third-party	O
projects	O
not	O
supported	O
by	O
Apple	O
.	O
</s>
<s>
So	O
as	O
to	O
indicate	O
the	O
project	O
's	O
emphasis	O
on	O
macOS	B-Application
,	O
its	O
name	O
was	O
changed	O
to	O
MacPorts	B-Application
.	O
</s>
<s>
When	O
Apple	O
closed	O
Mac	B-Application
OS	I-Application
Forge	O
in	O
2016	O
,	O
the	O
project	O
moved	O
to	O
GitHub	B-Application
.	O
</s>
<s>
As	O
part	O
of	O
this	O
change	O
,	O
git	B-Application
was	O
used	O
as	O
the	O
new	O
version	B-Architecture
control	I-Architecture
system	I-Architecture
,	O
although	O
Trac	B-Language
was	O
still	O
preferred	O
for	O
ticket	B-Application
management	I-Application
over	O
GitHub	B-Application
issues	O
.	O
</s>
<s>
,	O
MacPorts	B-Application
has	O
over	O
30,900	O
ports	O
and	O
best-effort	O
support	O
can	O
be	O
sourced	O
from	O
the	O
community	O
.	O
</s>
<s>
MacPorts	B-Application
installs	O
software	O
on	O
top	O
of	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
providing	O
newer	O
versions	O
of	O
pre-installed	O
packages	O
or	O
software	O
that	O
is	O
not	O
included	O
in	O
macOS	B-Application
.	O
</s>
<s>
This	O
is	O
in	O
contrast	O
to	O
other	O
package	B-Application
management	I-Application
systems	I-Application
,	O
such	O
as	O
APT	B-Application
and	O
DNF	B-Application
,	O
that	O
are	O
part	O
of	O
the	O
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
MacPorts	B-Application
is	O
sometimes	O
known	O
as	O
an	O
overlay	O
distribution	O
.	O
</s>
<s>
Other	O
examples	O
include	O
Fink	B-Application
and	O
Homebrew	B-Application
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
FreeBSD	B-Application
Ports	I-Application
Collection	I-Application
,	O
which	O
installs	O
its	O
software	O
in	O
/usr/local	O
,	O
MacPorts	B-Application
stores	O
its	O
data	O
in	O
/opt/local	O
by	O
default	O
,	O
although	O
this	O
can	O
be	O
modified	O
when	O
compiling	O
MacPorts	B-Application
from	O
source	O
.	O
</s>
<s>
The	O
reason	O
given	O
for	O
this	O
change	O
is	O
that	O
other	O
packaging	O
systems	O
could	O
overwrite	O
what	O
MacPorts	B-Application
has	O
installed	O
,	O
or	O
vice	O
versa	O
.	O
</s>
<s>
Fink	B-Application
follows	O
a	O
similar	O
approach	O
,	O
installing	O
its	O
data	O
into	O
/sw	O
by	O
default	O
.	O
</s>
<s>
Buildbots	B-Application
are	O
used	O
to	O
build	O
ports	O
in	O
advance	O
so	O
that	O
users	O
do	O
not	O
have	O
to	O
compile	O
the	O
package	O
locally	O
.	O
</s>
<s>
Similar	O
to	O
Homebrew	B-Application
,	O
MacPorts	B-Application
takes	O
the	O
approach	O
of	O
having	O
different	O
builders	O
for	O
different	O
operating	B-General_Concept
system	I-General_Concept
versions	O
and	O
architectures	O
.	O
</s>
<s>
If	O
a	O
binary	O
could	O
not	O
be	O
built	O
,	O
this	O
would	O
be	O
noted	O
on	O
the	O
MacPorts	B-Application
website	O
for	O
that	O
individual	O
port	O
and	O
the	O
maintainer	O
would	O
be	O
alerted	O
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
view	O
recent	O
buildbot	B-Application
events	O
on	O
a	O
dedicated	O
activity	O
page	O
.	O
</s>
<s>
MacPorts	B-Application
stores	O
the	O
instructions	O
required	O
to	O
build	O
a	O
port	O
in	O
a	O
port	O
description	O
file	O
,	O
otherwise	O
known	O
as	O
a	O
portfile	O
.	O
</s>
<s>
This	O
is	O
similar	O
to	O
how	O
the	O
AUR	O
use	O
shell	B-Language
scripts	O
known	O
as	O
a	O
PKGBUILD	O
,	O
or	O
how	O
Homebrew	B-Application
use	O
ruby	B-Language
scripts	O
as	O
a	O
formula	O
.	O
</s>
<s>
The	O
portfiles	O
are	O
complete	O
TCL	B-Operating_System
programs	O
with	O
access	O
to	O
the	O
TCL	B-Operating_System
interpreter	O
.	O
</s>
<s>
For	O
example	O
,	O
this	O
is	O
the	O
portfile	O
for	O
Hashcat:Each	O
portfile	O
has	O
pre-defined	O
stages	O
that	O
can	O
be	O
manually	O
configured	O
via	O
the	O
portfile	O
.	O
</s>
<s>
First	O
,	O
MacPorts	B-Application
retrieves	O
and	O
downloads	O
all	O
the	O
relevant	O
files	O
for	O
the	O
port	O
from	O
upstream	B-General_Concept
.	O
</s>
<s>
In	O
the	O
case	O
of	O
hashcat	B-Application
,	O
these	O
files	O
are	O
retrieved	O
from	O
GitHub	B-Application
.	O
</s>
<s>
Checksums	B-Algorithm
are	O
always	O
defined	O
within	O
the	O
portfile	O
,	O
since	O
they	O
are	O
different	O
for	O
different	O
files	O
.	O
</s>
<s>
The	O
checksums	B-Algorithm
of	O
the	O
downloaded	O
files	O
are	O
compared	O
to	O
those	O
in	O
the	O
portfile	O
to	O
see	O
whether	O
they	O
match	O
.	O
</s>
<s>
Only	O
one	O
compressed	O
file	O
is	O
downloaded	O
for	O
Hashcat	B-Application
,	O
so	O
only	O
one	O
checksum	B-Algorithm
is	O
required	O
in	O
the	O
portfile	O
.	O
</s>
<s>
Sometimes	O
,	O
the	O
code	O
might	O
need	O
to	O
be	O
modified	O
to	O
make	O
it	O
installable	O
via	O
MacPorts	B-Application
.	O
</s>
<s>
In	O
the	O
above	O
portfile	O
,	O
Hashcat	B-Application
does	O
not	O
require	O
any	O
changes	O
to	O
the	O
code	O
for	O
the	O
installation	O
to	O
work	O
.	O
</s>
<s>
The	O
project	O
's	O
configure	B-Device
script	I-Device
is	O
run	O
to	O
prepare	O
for	O
the	O
build	O
process	O
.	O
</s>
<s>
Part	O
of	O
this	O
involves	O
determining	O
whether	O
the	O
required	O
libraries	B-Library
are	O
present	O
.	O
</s>
<s>
For	O
ports	O
that	O
do	O
not	O
have	O
a	O
configure	B-Device
script	I-Device
,	O
this	O
stage	O
(	O
as	O
well	O
as	O
others	O
when	O
required	O
)	O
can	O
be	O
disabled	O
.	O
</s>
<s>
Since	O
the	O
configure	B-Device
stage	O
is	O
not	O
referenced	O
in	O
the	O
Portfile	O
,	O
hashcat	B-Application
is	O
using	O
the	O
default	O
configure	B-Device
setup	O
as	O
defined	O
by	O
MacPorts	B-Application
.	O
</s>
<s>
This	O
involves	O
running	O
the	O
configure	B-Device
script	I-Device
via	O
./configure	O
.	O
</s>
<s>
The	O
commands	O
that	O
are	O
executed	O
can	O
vary	O
for	O
different	O
languages	B-Language
.	O
</s>
<s>
The	O
portfile	O
for	O
hashcat	B-Application
shows	O
that	O
it	O
should	O
be	O
treated	O
as	O
a	O
Makefile	O
project	O
.	O
</s>
<s>
This	O
hashcat	B-Application
port	O
has	O
not	O
defined	O
a	O
test	O
stage	O
.	O
</s>
<s>
MacPorts	B-Application
takes	O
the	O
approach	O
of	O
first	O
staging	O
the	O
installation	O
into	O
an	O
intermediate	O
location	O
(	O
destroot	O
)	O
before	O
placing	O
the	O
files	O
in	O
their	O
correct	O
positions	O
(	O
install	O
)	O
.	O
</s>
<s>
For	O
hashcat	B-Application
,	O
this	O
is	O
done	O
by	O
running	O
make	O
install	O
,	O
where	O
one	O
of	O
the	O
arguments	O
(	O
DESTDIR	O
)	O
specifies	O
where	O
to	O
temporarily	O
store	O
the	O
files	O
.	O
</s>
<s>
When	O
upgrading	O
a	O
port	O
,	O
MacPorts	B-Application
deactivates	O
but	O
does	O
not	O
uninstall	O
the	O
current	O
version	O
as	O
a	O
safety	O
feature	O
.	O
</s>
<s>
Anyone	O
is	O
able	O
to	O
contribute	O
to	O
MacPorts	B-Application
,	O
generally	O
via	O
pull	B-Protocol
requests	I-Protocol
,	O
and	O
contributors	O
can	O
apply	O
for	O
commit	O
rights	O
following	O
a	O
good	O
track	O
record	O
as	O
a	O
maintainer	O
.	O
</s>
<s>
A	O
team	O
of	O
MacPorts	B-Application
members	O
,	O
known	O
as	O
the	O
project	O
managers	O
,	O
help	O
to	O
lead	O
and	O
coordinate	O
the	O
project	O
.	O
</s>
<s>
They	O
normally	O
take	O
place	O
in	O
Slovenia	O
,	O
and	O
allow	O
for	O
MacPorts	B-Application
members	O
to	O
work	O
on	O
future	O
development	O
.	O
</s>
<s>
By	O
default	O
,	O
MacPorts	B-Application
does	O
not	O
collect	O
any	O
statistics	O
.	O
</s>
<s>
The	O
information	O
is	O
then	O
used	O
to	O
determine	O
which	O
hardware	O
to	O
support	O
and	O
to	O
understand	O
how	O
quickly	O
new	O
MacPorts	B-Application
releases	O
are	O
adopted	O
.	O
</s>
<s>
Users	O
can	O
view	O
analytics	O
data	O
on	O
the	O
MacPorts	B-Application
website	O
.	O
</s>
