This is an old revision of the document!
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
devel/git: Minimized depedencies CONTRIB=off CVS=off GUI=off NLS=off P4=offsvn(lite): in base is sufficient (or devel/subversion from ports)ports-mgmt/portlint: Sanity checksports-mgmt/poudriere: To generate logs that reviewers like
One-time setup
Workflow
A way to get from patching a port to submitting it
Hack a port
- Create the category dir in
<ports> - In the category dir using svn
svn co https://svn0.eu.FreeBSD.org/ports/head/<category>/<port> - In
<ports>rungit add . - Modify your port
- whatever needs to change, see next sections
- In
<ports>/<category>/<port>update local svnsvn add/move/copy/remove <file>svn statusto check your worksvn updateto update your local svn tree
- in
<ports>/<category>/<port>runsvn diff > ../../patch-<port>-<version>-<shortdesc> - Build your modified port using poudriere
Quality checks
portlint -Cmake check-plistmake -V CPE_STR
Submit a Bug Report
- 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
- Describe what's changed, refer to link if you submitted it upstream as well
- Attach the svn diff(s) relative to the
${PORTSDIR}root- Set
maintainer-approvalto+if you're the maintainer of the port
- Attach the poudriere logs
- As plain text when < 1MB
- Gzipped when > 1MB
Tips-'n-tricks
make makepatch
make makepatch is your friend
- make a backup of the files dir…
- run
make do-patchto extract and patch the port (but not run pre- nor post-patch) - cd into the ${WRKSRC}
- Copy the file you want to modify to
<file>.orig
cd `make -V WRKSRC`
cp -p path/to/file-to-patch{,.orig}
- Edit
path/to/file-to-patchusing your favourite editor - cd into the port-dir (i.e.
cd ../..) runmake makepatchto update all patches in thefilesdir - NB. There can also be PATCH commands in the Makefile and extra-patches…
poudriere
TODO
TODO
Poudriere usage