Subject: Re: substitutes framework ?
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 01/24/2005 11:31:05
On Mon, 2005-01-24 at 11:11 +0100, Manuel Bouyer wrote:
> Hi,
> I'm working on a package which has lots of hardcoded paths. Is there a
> framework in pkgsrc for dealing with this ? I looked in the guide, and
> a few packages but didn't bind anything obvious.
> 
> Basically I'll need to do s,@@PREFIX@@,${PREFIX} in a set of files,
> between patch configure. I can add a custom post-patch target, but
> maybe there's already something in mk/* to do this ?

You can use SUBST_CLASSES and friends.  Do a grep inside pkgtools; many
packages there use this feature.

BTW, use pre-configure as the stage, _not_ post-patch.  This way, when
somebody does 'make patch' to later edit the patches manually, he won't
get any changes that are done automatically (which happens from time to
time, breaking existing patches).

Cheers,

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/