Modifying a port and keeping the mods across updates

Ulrich Spoerlein uspoerlein at gmail.com
Sun Jan 21 18:53:10 UTC 2007


Paul Hoffman wrote:
> Greetings again. I have a two-part question that may be a ports FAQ, but I couldn't find such 
> a beast.
> 
> (1) For a particular port, I need to change the the MAKE_ENV to make it build the way I want. 
> What is the proper way to do this that will live beyond the next time I do a cvsup? That is, 
> editing the Makefile works just fine, but I want something that will live if the Makefile 
> gets reverted.

/etc/make.conf:
.if ${.CURDIR:M*/devel/dmalloc}
CFLAGS=         -O -pipe -g
STRIP=
DEBUG_FLAGS=    -g
.endif


> (2) For a particular port, I need to patch a particular source file. This is a patch that 
> will probably be in a future release. Same question as above: what's the proper way to do 
> this that will live beyond the next cvsup? I know how to use 'patch' to apply patches, but 
> not yet to create them.

/etc/make.conf:
.if ${.CURDIR:M*/sysutils/cdrtools}
EXTRA_PATCHES=  /path/to/my/cdrtools.patch
.endif

Your patch needs to be relative to ${WRKSRC}, just as the usual patches
in files/patch-*.

Be careful though, some of these vars might be set by the port itself.
(You can use VAR+=foo then, this needs to be judged on a case by case
basis, though)

hth,
Ulrich Spoerlein
-- 
A: Yes.
>Q: Are you sure?
> >A: Because it reverses the logical flow of conversation.
> >>Q: Why is top posting frowned upon?


More information about the freebsd-ports mailing list