Subject: automatic replacement of locale directories in buildlink2
To: None <tech-pkg@netbsd.org>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: tech-pkg
Date: 11/26/2002 15:50:17
--Fig2xvG2VGoz8o/s
Content-Type: multipart/mixed; boundary="NDin8bjvE/0mNLFQ"
Content-Disposition: inline
--NDin8bjvE/0mNLFQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
hi,
since the current situation of packages with own locale catalogues which
shuld be installed on system-dependent ${PREFIX}/${PKGLOCALEDIR}/locale
is suboptimal and hundreds of packages would need several additional
patches to correctly install these catalogues, i'd like to propose a
buildlink2 addition for automatic reaplacement of locale directories in
packages' Makefile.in.* files.
the logic is:
- if package installs locale catalogues define USE_PKGLOCALEDIR
- if USE_PKGLOCALEDIR is set for a package, then
- within pre-configure target replace 'localedir', 'gnulocaledir' and
'-DLOCALEDIR' with correct values in all Makefile.in.* files (usually
Makefile.in, src/Makefile.in, intl/Makefile.in and po/Makefile.in.in)
benefits:
- no need to create additional patches for these files (there are tens
to hundreds them now) and current patches could be removed
- things will start working automatically for packages which have
insufficient patches at this moment
drawbacks:
- pre-configure target will be slower for packages with USE_PKGLOCALEDIR
set due to extensive replacement process (depends on number of files,
directory hierarchy, ..)
patch for mk/buildlink2/bsd.buildlink2.mk is attached. instructions for
converting packages are:
- remove all patches for PKGLOCALEDIR
- remove MAKE_ENV and CONFIGURE_ENV PKGLOCALEDIR variables
- add USE_PKGLOCALEDIR=3D yes
please test it and send your comments and/or suggestions.
regards,
--=20
-- Lubomir Sedlacik <salo@Xtrmntr.org> --
-- <salo@silcnet.org> --
--NDin8bjvE/0mNLFQ
Content-Type: text/plain; charset=us-ascii
Content-Description: pkglocaledir.diff
Content-Disposition: attachment; filename=pkgloc
Content-Transfer-Encoding: quoted-printable
Index: bsd.buildlink2.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/buildlink2/bsd.buildlink2.mk,v
retrieving revision 1.56
diff -u -r1.56 bsd.buildlink2.mk
--- bsd.buildlink2.mk 2002/11/26 08:59:06 1.56
+++ bsd.buildlink2.mk 2002/11/26 14:44:31
@@ -412,6 +412,25 @@
${REPLACE_BUILDLINK} \
`${FIND} . ${_REPLACE_BUILDLINK_PATTERNS_FIND} -print | ${SED} -e 's|^\./=
||' | ${SORT} -u`
=20
+# Fix locale directory references.
+#
+USE_PKGLOCALEDIR?=3D no
+_PKGLOCALEDIR=3D ${PREFIX}/${PKGLOCALEDIR}/locale
+BUILDLINK_SUBST_MESSAGE.pkglocaledir=3D \
+ "Fixing locale directory references."
+BUILDLINK_SUBST_FILES.pkglocaledir=3D \
+ `${FIND} . -name "Makefile.in*" -print | ${SED} 's|\.orig||' | ${SORT} -u`
+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])
+pre-configure: pkglocaledir-buildlink-subst
+.endif
+
# 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
--NDin8bjvE/0mNLFQ--
--Fig2xvG2VGoz8o/s
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (NetBSD)
iD8DBQE944opiwjDDlS8cmMRAiEbAJ0dyXqm17nGFLnlNbHGKI/6C5GbwQCgj/AJ
6b2KRGRhbxkVblK/cASlwZI=
=x24e
-----END PGP SIGNATURE-----
--Fig2xvG2VGoz8o/s--