About patching ports

Chuck Swiger cswiger at mac.com
Thu Sep 22 18:09:07 PDT 2005


Naram Qashat wrote:
> Just a quick question really.  What's the best way to go about handling
> patching of files that need PREFIX substituted into the file after the patch
> has been applied?  Like for example, you replace a path in a source file
> with %%PREFIX%% and you want that replaced after the patch is done.  I don't
> think using SUB_FILES would work in this case.  Any help would be
> appreciated.

Something like:

USE_REINPLACE=  yes

post-patch:
         ${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
         s|%%CC%%|${CC}|g ; \
         s|%%CFLAGS%%|${CFLAGS}|g' ${WRKSRC}/Makefile

See 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/slow-patch.html 
for more details...

-- 
-Chuck





More information about the freebsd-ports mailing list