MacPorts Notes

The these are some general notes about MacPorts.


Commonly Used Ports (x86 / M1)

  1. autoconf (for autoreconf): https://www.gnu.org/software/autoconf/
  2. automake (to support autoreconf): https://www.gnu.org/software/automake/
  3. cargo2port: https://github.com/l2dy/cargo2port
  4. ccache (compiler cache): https://ccache.dev
  5. cdrtools (make ISOs from CDs): http://cdrtools.sourceforge.net/private/cdrecord.html
  6. dnscrypt-proxy (encrypted dns): https://github.com/DNSCrypt/dnscrypt-proxy
  7. dosbox-x (enhanced dosbox): https://dosbox-x.com/
  8. epy (cli ebook reader): https://github.com/wustho/epy
  9. gh (git hub CLI): https://docs.github.com/en/github-cli/github-cli/about-github-cli
  10. gnupg2 (GNU pretty good privacy): https://www.gnupg.org/
  11. innoextract (extract files from Windows installers): https://constexpr.org/innoextract/
  12. libpst (extract files from Outlook PST archives): https://www.five-ten-sg.com/libpst/
  13. links (terminal browser): http://links.twibright.com/
  14. ncftp (FTP client): http://www.ncftpd.com/ncftp/
  15. newsboat (terminal based RSS reader): https://newsboat.org/
  16. octave (matlab-like math package): https://www.gnu.org/software/octave/
  17. openssh: https://www.openssh.com/
  18. py-pipdeptree (python dependencies): https://pypi.org/project/pipdeptree/
  19. qemu (multi-architecture emulator): https://www.qemu.org/
  20. rclone (sync files to cloud services): https://rclone.org/
  21. shellcheck (check the syntax of shell scripts): https://www.shellcheck.net/
  22. slrn (Usenet news reader): https://slrn.info/
  23. smartmontools (get SMART status for drives): https://www.smartmontools.org/
  24. tig (terminal based git history browser): https://jonas.github.io/tig/
  25. tuir (terminal based reddit browser): https://gitlab.com/ajak/tuir
  26. unshield (extract Installshield archives): https://github.com/twogood/unshield
  27. xorriso (cd tools): https://www.gnu.org/software/xorriso/
  28. youtube-dl (video downloader): https://www.youtube-dl.org/
  29. w3m-devel (terminal web browser): http://w3m.sourceforge.net/

Checking which Port provides a file

$ port provides [file]

Contributing to MacPorts

  1. Create a fork on GitHub

  2. Clone the fork locally:
    $ git clone https://github.com/username/macports-ports.git
    where username your github username.

  3. Add the the official repository as the upstream:
    $ git remote add upstream https://github.com/macports/macports-ports.git
  4. On GitHub, update the fork to include any upstream changes, for example:

    $ gh repo sync username/macports-ports
    where username your github username.

    See: GitHub Docs, Syncing a fork

  5. Fetch upstream changes locally:
    $ git fetch upstream && git pull
  6. Create a branch for changes:
    $ git checkout -b portname-version
    where portname is the name of the port and version is the version of the port

  7. After making changes, lint the Portfile:
    $ port lint --nitpick -D .
  8. Commit the changes:
    $ git commit -a -m "portname: update to version" [-S]
    where portname is the name of the port, version is the version of the port, and -S is optional (assuming that signing commits is enabled)

  9. Push the changes upstream:
    $ git push --set-upstream origin portname-version
    where portname is the name of the port and version is the version of the port
  10. Open a pull request on GitHub

  11. If changes are requested, make the changes, lint the Portfile (see above), and then override the prior commit:
    $ git commit --amend -a -m "portname: update to version" [-S]
    $ git push origin -f
    where portname is the name of the port, version is the version of the port, and -S is optional (assuming that signing commits is enabled)

  12. Switch back to the main/master branch:
    $ git checkout master
  13. Once the pull request is merged, delete the local and remote branches:

    • Delete the local branch:
      $ git branch -D portname-version
      where portname is the name of the port and version is the version of the port

    • Delete the remote branch:
      $ git push origin --delete portname-version
      where portname is the name of the port and version is the version of the port

    • Synchronize local and remote branches:
      $ git fetch -p

Making ISO images

  1. Install cdrools:
    $sudo port install cdrtools
  2. Make a mount point for the cd, if it doesn't exist:
    $ sudo mkdir /Volumes/cdrom
  3. Find the non-Mac/HFS partition/slice on the cd using diskutil list (often it is slice 1)

  4. Mount the non-Mac/HFS partition on the cdrom:
    $ sudo mount_cd9660 -r /dev/disk[X]s[Y] /Volumes/cdrom
    where X is the disk number for the cd shown by diskutil list and Y is the slice number for the cd shown by diskutil list.

  5. Create the ISO image using mkisofs from cdrtools:
    $ mkisofs -v -J -r -V [VOLNAME] -o [ISO PATH] /Volumes/cdrom
    where VOLNAME is the volume name for the ISO and ISO PATH is the location where the ISO should be saved.

  6. Unmount the cd:
    $ umount /Volumes/cdrom
  7. Eject the cd:
    $ diskutil eject /dev/disk[X]
    where X is the disk number shown by diskutil list.
Based on: https://lists.macports.org/pipermail/macports-users/2022-April/051105.html

Home / Notes