Patching ports

Simon Barner barner at
Wed May 5 16:30:29 PDT 2004


> How do I add a patch to a certain port? Usually I would use the "patch"
> program to add the patch to the source code. But when using ports the
> system begins compiling right after rewtrieving the source. Thus not
> giving me a change to apply the patch. I've seen a folder named "files"
> in which patches part of the port seem to be located. But just adding
> the patchfile here apperently wont do much good. I've tried using the
> "PATCHFILES" variable in the Makefile but then the system complains the
> my patchfile does not have a matching MD5 hash. Does anyone know how to
> handle this issue?

You can use ``make patch'' to extract the port and apply existing
FreeBSD patches to it. Now you can create your own local patches
(relative to ${WRKDIR} which is
/usr/ports/<category>/<portname>/work/<portname-version-mumble> by
default), and put them into into the files subdirectory of your port.
Please note, that the FreeBSD port system will ignore patches that do
not start with the ``patch-'' prefix (you could use the EXTRA_PATCHES
macro to work around or exploit that fact) (``grep'' the ports
tree for examples)

You can find more information on how to work on the ports collection in
the porters handbook:

One last side remark:
If you think that your patches are useful for either the FreeBSD or the
whole open source community, it would be really nice if you sent them as
a problem report (send-pr(1), see the porter's handbook) or to the author
of the software.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url :

More information about the freebsd-questions mailing list