Subject: Re: substitutes framework ?
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Juan RP <juan@xtraeme.nopcode.org>
List: tech-pkg
Date: 01/24/2005 11:14:27
--Signature=_Mon__24_Jan_2005_11_14_27_+0100_u1N=d3Tjq6YRaVKK
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

On Mon, 24 Jan 2005 11:11:30 +0100
Manuel Bouyer <bouyer@antioche.lip6.fr> 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 ?

Yes, mk/subst.mk, for example you can do something like this:

SUBST_CLASSES+=	foo
SUBST_STAGE.foo=	post-patch
SUBST_FILES.foo=		foo.c bar.c # Relative to WRKSRC
SUBST_SED.foo=		-e 's,SUBSTME,FIXED,g'
SUBST_MESSAGE.foo=	"Patching files for blah blah..."

Cheers.


--Signature=_Mon__24_Jan_2005_11_14_27_+0100_u1N=d3Tjq6YRaVKK
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iD8DBQFB9MqDypkLYVDran0RAqiEAKCJzqfCSfjNlohlI8NP2zg+P2s53ACgwUjz
0je9A0lyh3hYrPSywXeoQ1g=
=rpyH
-----END PGP SIGNATURE-----

--Signature=_Mon__24_Jan_2005_11_14_27_+0100_u1N=d3Tjq6YRaVKK--