Adding Src

Simon Barner barner at
Wed Apr 28 14:28:04 PDT 2004

Jason Dusek wrote:
> Hi Everyone,
> How do I add a file to a port?  I would like to add a new component to a 
> port and then use a patch to the Makefile to get everything to turn out 
> all right.  Is this easy or hard?  Is there a hand book on how to do 
> neat hacks on the ports?


I see two possibilities:

1. Create a patch for the new file(s):
   touch filename.c.orig
   vim filename.c (hack, hack, hack)
   diff -u filename.c.orig filename.c > ${FILESDIR}/patch-filename.c

2. Simply put the file into the files directory, and use the pre-patch
   target (in the port Makefile)
   ${CP} ${FILESDIR}/filename.c ${WRKDIR}/right/directory

I'd say that #2 is obfuscates your extension less, so I'd prefer it.

But before you submit a PR, you should ask yourself whether the ports
collection is the right place for you extension, (i.e. is it really
FreeBSD specific), or whether it should be incorporated into the
official release.

-------------- 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-ports mailing list