Subject: Re: how can we create PATCHFILES that are not DISTFILES?
To: NetBSD Packages Technical Discussion List <firstname.lastname@example.org>
From: Alan Barrett <email@example.com>
Date: 04/22/2002 10:27:06
On Fri, 19 Apr 2002, Greg A. Woods wrote:
> This isn't a compiled file -- there's no post processing done during
> build and none that would make sense. It really has to be a build-time
> modification too. A "patch" really is the ideal mechanism for making
> the requisite change(s). I.e. "patch" is the compiler in this case and
> I think it is far more suitable for the job than 'sed', or 'm4'. The
> proposed mechanism is undoutably more widely usable in this form in
> other packages than other tools could ever be too.
Sorry, I forget what Greg's proposed mechanism is.
Perhaps you could a patch to place @YOUR_MAGIC_VARIABLE@ into the
relevant config file, and a post-patch target using sed to replace
@YOUR_MAGIC_VARIABLE@ with the desired value. This way, the patch
command can worry about context, and the sed command can blindly make
the substitution without worrying about context. You could probably
use the existing FILES_SUBST framework. (Oops, FILES_SUBST is not
documented in Packages.txt.)
--apb (Alan Barrett)