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
- Get a GitHub account
- Create a ports repo in your GitHub
- Clone your GitHub ports repo on your local system to <ghports>
- add
.svnandworkto<ghports>/.gitignore - alias
svntosvnliteif you're not installingdevel/subversionfor full svn support - Install and configure
ports-mgmt/[[#poudriere|poudriere]]
Workflow
A way to get from patching a port to submitting it
Hack a port
- Create the category dir in
<ghports> - In the category dir using svn
svn co https://svn.FreeBSD.org/ports/head/<category>/<port>
Check Using Subversion for your closest mirror, at first call you need to match and accept the SSL fingerprint - In
<ghports>rungit add . - Modify your port
- whatever needs to change, see next sections
- In
<ghports>/<category>/<port>update local svnsvn add/move/copy/remove <file>svn statusto check your worksvn updateto update your local svn tree
- in
<ghports>runsvn diff <category>/<port> > ../patch-<category>-<port>-<version>-<shortdesc> - Build your modified port using poudriere testport
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 testport log
- 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…
Verbose builds
Not all builds are equally verbose. Options to enable more verbose builds
make V=1(generic)make VERBOSE=1(cmake)
poudriere
TODO
TODO
Poudriere usage