Jul 20, 2023

Format FreeBSD Ports Makefiles

Portfmt is a collection of tools for editing, formatting, and linting FreeBSD Ports Collection Makefiles.

It comes with several tools

  • portfmt formats Makefiles
  • portclippy is a linter that checks if variables are in the correct order in a more comprehensive way than portlint
  • portedit edits Makefiles. It comes with several commands that can be used as a basis for your own port update scripts
    • bump-epoch bumps PORTEPOCH or inserts it at the right place
    • bump-revision bumps PORTREVISION or inserts it at the right place
    • get lookup unevaluated variable values
    • merge Generic command to set/update variables while also formatting the updated variables properly and inserting them in the right places if necessary. Useful for merging output of other tools like make cargo-crates, modules2tuple, or make stage-qa. For example to mark a port deprecated

      printf “DEPRECATED=s\nEXPIRATION_DATE=s” \ Abandonware 2019-08-15 | portedit merge -i Makefile

    • set-version resets PORTREVISION, sets DISTVERSION or PORTVERSION

Checkout these related ports:
  • Wanted-ports - Just depend on a configurable, arbitrary set of other ports
  • Synth - Custom package repository builder for FreeBSD and DragonFly
  • Submodules2tuple - GH_TUPLE generator for GitHub projects with submodules
  • Sccache-overlay - Ports overlay for sccache
  • Reprise - Port testing system
  • Rc-subr-jail - Shell library to help writing RC scripts with jail support
  • Py-skog - Generate visual dependency trees for FreeBSD ports
  • Py-pytoport - Generate FreeBSD ports from Python modules on PyPI
  • Py-freebsd-ports - Parse FreeBSD Ports INDEX, provide search API
  • Psearch - Utility for searching the FreeBSD Ports Collection
  • Poudriere - Port build and test system
  • Poudriere-devel - Port build and test system
  • Portupgrade - FreeBSD ports/packages administration and management tool suite
  • Portupgrade-devel - FreeBSD ports/packages management tool (devel version)
  • Portupdate-scan - Display pertinent parts of {PORTSDIR}/UPDATING