How to apply private patches to port?

Heinrich Rebehn rebehn at ant.uni-bremen.de
Tue Aug 5 00:45:20 PDT 2003


Paul Chvostek wrote:
> On Mon, Aug 04, 2003 at 10:51:54AM +0200, Heinrich Rebehn wrote:
> 
>>Is there some documentation about how to add private patches/hacks to a
>>port?
>>Just add a patch-a{something} to the files directory?
> 
> 
> I'd recommend against local modification to the ports tree.  Remember
> that if you add patches to the 'files' directory, they will magically
> disappear the next time you do a `make update` in /usr/ports.
> 
> You can do a `make patch` in a port's directory, then go into the work
> directory that's been created and apply your own patches manually.  I
> suspect the best option would be to make YOUR OWN port that includes the
> patches you want, and maintain it independently from the one in the
> ports tree.  If your patch has widespread appeal, consider submitting it
> to the Project.  Others may have better solutions.  ;)
> 
> 
>>Also, where do i find all the possible options for the 'make' command (not
>>'man make', but things line 'CFLAGS=... make install')
> 
> 
> You're probably looking for the stuff in `man make.conf`, but you should
> be aware that the /etc/make.conf file only gets used by things that are
> part of the FreeBSD source or ports.  Many of the variables described in
> /etc/make.conf are widely accepted throughout the industry (CFLAGS, etc)
> but the real answer to your question is that every Makefile has a set of
> variables that can be set, and you have to read the Makefile to find out
> what they are.
> 
> 
>>Thanks for your help
> 
> 
> Any time.  :)
> 

Hi Paul,

In the meantime i found the "Porter's Handbook" and also had a look into 
/usr/ports/Mk/bsd.port.mk, which contains a description of all the make targets 
(fetch, extract, patch ..).
I wish every Makefile would have a 'help' target, which woukd list all the 
available targets. But that's only wishful thinking..

As for 'widespread appeal' of my patch: I guess not. It's only a private hack 
for imap-uw, which is very poorly configurable.
At first, i installed it directly from source (w/o port). But now i wanted to 
install the package 'imp' from the ports which depends on imap-uw and when i 
issued 'make' for imp, it began to pull in imap-uw, because it was not 
'installed'(via ports) and threatened to overwrite my private imap-uw with an 
unpatched version.
That's why i had the idea of expanding the imap-uw port (and also client-2002) 
with my own patch.

Thanks again,

	Heinrich



More information about the freebsd-ports mailing list