AKA Hack-a-port

Documenting the workflow I've established to hack ports

WORK IN PROGRESS - INCOMPLETE - YMMV

Setup

Setting up your porting environment

Tools required

One-time setup

  1. Get a GitHub account

  2. Create a ports repo in your GitHub

  3. Clone your GitHub ports repo on your local system to <ghports>

  4. Install and configure ports-mgmt/[[#poudriere|poudriere]]

Workflow

A way to get from patching a port to submitting it

Hack a port

Update the port's files.

Quality checks

  1. portlint -C

  2. make check-plist

  3. make -V CPE_STR

  4. Build your modified port using poudriere testport

Submit a Bug Report

  1. If you're the maintainer of the port, prefix the Summary with [MAINTAINER] otherwise prefix with [PATCH]
    • e.g. [PATCH] category/port: Fix this and that

  2. Describe what's changed, refer to link if you submitted it upstream as well
  3. Attach the git diff(s)
    1. Set maintainer-approval to + if you're the maintainer of the port

  4. Attach the poudriere testport log
    1. As plain text when < 1MB

    2. Gzipped when > 1MB

Tips-'n-tricks

make makepatch

make makepatch is your friend

  1. make a backup of the files dir...
  2. run make do-patch to extract and patch the port (but not run pre- nor post-patch)

  3. cd into the ${WRKSRC}
  4. Copy the file you want to modify to <file>.orig

cd `make -V WRKSRC`
cp -p path/to/file-to-patch{,.orig}
  1. Edit path/to/file-to-patch using your favourite editor

  2. cd into the port-dir (i.e. cd ../..) run make makepatch to update all patches in the files dir

  3. NB. There can also be PATCH commands in the Makefile and extra-patches...

Verbose builds

Not all builds are equally verbose. Options to enable more verbose builds

poudriere

TODO

TODO

Poudriere usage

References/Links

Porter's Handbook
Committer's Guide - Ports

BernardSpil/PortingWorkflow (last edited 2025-01-18T10:33:17+0000 by BernardSpil)