MacPorts for Mac

[ ]

The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac operating system.

MacPorts vs HomeBrew

Both MacPorts and HomeBrew help you install command line and library to Mac OS. There are some differences:

  • MacPorts almost always builds packages from source, while Homebrew has continuously gotten less and less permissive of letting you do this (opting instead for downloading pre-built binaries)
  • MacPorts has more package than HomeBrew. https://www.slant.co/versus/1588/1674/~macports_vs_homebrew
  • MacPorts requires sudo permission to install package while HomeBrew could install without sudo. However, you may frequently faces link or path cannot find issue after OS update for HomeBrew

So I choose MacPorts now

Install MacPorts

I don’t have environment to test it for M1 chip based Mac

Follow the instructions on the website:

Possible Installation Errors

Error in Installing gd2

gd2 is a depdendency to many packages. You may run into the following errors:

Error: Failed to configure gd2, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_gd2/gd2/work/libgd-2.3.0/config.log
Error: Failed to configure gd2: configure failure: command execution failed

To fix this, please follow this instrucitons

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

xcode-select: error: command line tools are already installed, use “Software Update” to install updates

This is more like a warning, if it causes other errors, please check the solutions above.

Packages to Install

  • python3: well it is python3
  • tessract: a library and tools for optical character recognition
  • opencv: a library for computer vision
  • upic: for uploading images to varying platforms, e.g., github
  • ffmpeg: for manipulate videos
  • pandoc: for converting different document formats, e.g., word, pdf
Written on January 24, 2021