-
-
Save zadr/e9a090fb564451fb5c76db233fabf0d0 to your computer and use it in GitHub Desktop.
# fetch MacPorts sources | |
curl -LO https://distfiles.macports.org/MacPorts/MacPorts-2.8.1.tar.gz | |
# extract them and get into the dir | |
tar -jxf MacPorts-2.8.1.tar.gz | |
cd MacPorts-2.8.1 | |
# configure things | |
## If you want MacPorts to run in a custom prefix, pass in the following arguments: --prefix=/usr/local --with-unsupported-prefix --with-applications-dir=/Applications | |
## replacing /usr/local with your desired location | |
./configure --with-no-root-privileges --with-install-user=$USER --with-install-group=staff --silent | |
# build and install things, using however many performance CPUs are available | |
# for older versions of macOS, substitute in `machdep.cpu.core_count` | |
make -s -j `sysctl -n hw.perflevel0.physicalcpu` | |
make -s -j `sysctl -n hw.perflevel0.physicalcpu` install | |
# clean up after ourselves | |
cd .. | |
rm -rf MacPorts-2.8.1* | |
# post-install tasks | |
## Update ports to latest definitions | |
port selfupdate | |
## Edit the config to change any other values that you need, such as setting `buildfromsource` to `always` | |
### if you passed in a custom prefix via `--prefix`, replace /opt/local with your target prefix. | |
$EDITOR /opt/local/etc/macports/macports.conf |
Why try to find out core count by yourself ?
The number of CPUs in my machine may differ from the number of CPUs in your machine
perhaps because
install
tries to write to PATH writable only by root ?ˇ
in the years since this gist was written, Apple has changed default permissions of various directories. You can make a new directory and install to other locations (/opt, /Users/`whoami`/.usr, etc) as needed.
The number of CPUs in my machine may differ from the number of CPUs in your machine
Allow N jobs at once; **infinite jobs** with no arg.
Isn't infinite jobs = no of cores at a time? Shouldn't need to specify the core
Isn't infinite jobs = no of cores at a time? Shouldn't need to specify the core
What are you hoping to get out of this thread? The gist we're talking on is a set of notes I wrote down for myself, and specifying the number of cores gives me the behavior I'm looking for.
Works like a charm! Thanks!
Why try to find out core count by yourself ?
Also, I had to do
perhaps because
install
tries to write to PATH writable only by root ?ˇ