Subject: Re: automatic replacement of locale directories in buildlink2
To: Johnny C. Lam <>
From: Lubomir Sedlacik <>
List: tech-pkg
Date: 11/27/2002 05:00:27
Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9"
Content-Disposition: inline

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Nov 26, 2002 at 06:12:59PM -0800, Johnny C. Lam wrote:
> On Wed, Nov 27, 2002 at 01:03:58PM +1100, grant beattie wrote:
> >=20
> > Is it worth turning on USE_PKGLOCALEDIR automatically if
> >=20
> > We could, of course, create a list of OPSYSs which need to be hacked
> > on, so that it is not invoked unnecessarily. That would create far
> > less maintenance, since we would no longer need to know about broken
> > packages and modify them accordingly.
> It's better to just grep through the PLISTs in pkgsrc to see if they
> install locale files, and set USE_PKGLOCALEDIR in those packages'
> Makefiles.

i'd favor the following:

- make it conditional and use only when PKGLOCALEDIR !=3D share, since
  that's what we want to override on e.g. Solaris

- mark packages with USE_PKGLOCALEDIR.  this is really very small
  maintenance overload since PKGLOCALEDIR must be set it PLISTs for
  these packages anyway and it's one-time only.  this saves some
  buildlink2ify time for packages with GNU_CONFIGURE but no locale

this will make it painless on systems where it's not needed at all.  the
new patch is attached (it also has corrected quoting and simplified file
list generation).

> > Is there any possibility of screwing up a package by turning on this
> > behaviour automatically?
> I don't know, and I don't really want to find out ;)

it should not. ..unless the regexs aren't correct ;)

btw. thanks to johnny for helping me with _BUILDLINK_SUBST_USE!


-- Lubomir Sedlacik <>                   --
--                  <>                   --

Content-Type: text/plain; charset=us-ascii
Content-Description: pkglocaledir2.diff
Content-Disposition: attachment; filename=pkgl
Content-Transfer-Encoding: quoted-printable

RCS file: /cvsroot/pkgsrc/mk/buildlink2/,v
retrieving revision 1.57
diff -u -r1.57
---	2002/11/26 22:46:59	1.57
+++	2002/11/27 03:55:52
@@ -412,6 +412,25 @@
 	`${FIND} . ${_REPLACE_BUILDLINK_PATTERNS_FIND} -print | ${SED} -e 's|^\./=
||' | ${SORT} -u`
+# Fix locale directory references.
+	"Fixing locale directory references."
+BUILDLINK_SUBST_FILES.pkglocaledir=3D \
+	`${FIND} . -name "*" -print | ${GREP} -v "\.orig"`
+BUILDLINK_SUBST_SED.pkglocaledir=3D \
+	-e 's|^\(localedir[     ]*=3D\).*|\1 ${_PKGLOCALEDIR}|' \
+	-e 's|^\(gnulocaledir[  ]*=3D\).*|\1 ${_PKGLOCALEDIR}|' \
+	-e 's|\(-DLOCALEDIR[    ]*=3D\)[^ 	]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|'
+pkglocaledir-buildlink-subst: _BUILDLINK_SUBST_USE
+.if empty(USE_PKGLOCALEDIR:M[nN][oO]) && (${PKGLOCALEDIR} !=3D "share")
+pre-configure: pkglocaledir-buildlink-subst
 # When "unbuildlinkifying" a file, we must remove references to the
 # buildlink directories and change any -llib to the proper replacement
 # libraries (-lreadline -> -ledit, etc.).  Redundant -Idir and -Ldir


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.1 (NetBSD)