Subject: Proposal for xpkgwedge changes
To: None <tech-pkg@netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: tech-pkg
Date: 10/06/2000 08:40:42
Hi,

	First off, apologies to any who've seen this message before.
I realized belatedly that I posted to the wrong list for a discussion
on a packages issue.

	Now for the proposal:

	I've made changes to xpkgwedge in my local pkgsrc tree that
are summed up as follows:

 	* Redefine ImakeCmd to "imake -I$(PREFIX)/lib/X11/config" to
	  pick up X11 config files in $(PREFIX)/lib/X11/config before the
	  ones in the standard X11 tree.

	* Install a program called "pkgxmkmf" that's actually xmkmf, but
	  checks in $(PREFIX)/lib/X11/config before the standard X11 config
	  directory.

	* Create the host.def file in $(PREFIX)/lib/X11/config instead of
	  always in ${X11BASE}/lib/X11/config.

The benefits of this are:

	1) xpkgwedge can now install into $(PREFIX) instead of always into
	   $(X11BASE).

	2) Keeps the X11 tree "pure", and doesn't affect people who want
	   to run xmkmf and not include all the xpkgwedge stuff, even if
	   it's installed.

	3) Packages that install config files (lesstif, xview-config) can
	   now do so in $(PREFIX).

	4) People only have to use 'pkgxmkmf' instead of 'xmkmf', and
	   (hopefully) no other changes, if they want to use the config
	   files in xpkgwedge'd packages.

I've tested it fairly well, rebuilding most of my X11 packages from
scratch, and seeing that they do indeed build and install correctly.

For anyone who wants to see my xpkgwedge package, it's available at:

	http://www.stat.cmu.edu/~lamj/xpkgwedge.tgz

and the diffs needed for bsd.pkg.mk to work with the new xpkgwedge
follow.

	Thanks in advance for your feedback,

     -- Johnny C. Lam <lamj@stat.cmu.edu>
        Department of Statistics, Carnegie Mellon University
        http://www.stat.cmu.edu/~lamj/

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.581
diff -u -r1.581 bsd.pkg.mk
--- bsd.pkg.mk	2000/09/28 10:50:43	1.581
+++ bsd.pkg.mk	2000/10/06 12:32:17
@@ -88,11 +88,20 @@
 SCRIPTS_ENV+=		CLASSPATH=${CLASSPATH} JAVA_HOME=${JAVA_HOME}
 .endif
 
-# set X11PREFIX to reflect installed dir of X11 packages
-.if exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
+# Set X11PREFIX to reflect the install directory of X11 packages.
+#
+# The extra checks for the existence of files in explicit paths is to
+# provide backwards-compability for users with xpkgwedge<=0.4.
+#
+.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
+    exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
 X11PREFIX=		${LOCALBASE}
+.if exists(${LOCALBASE}/bin/pkgxmkmf)
+XMKMF?=			pkgxmkmf -a
+.endif
 .else
 X11PREFIX=		${X11BASE}
+XMKMF?=			xmkmf -a
 .endif
 
 .if defined(USE_MOTIF12)
@@ -245,7 +254,6 @@
 
 # Miscellaneous overridable commands:
 SHCOMMENT?=		${ECHO_MSG} >/dev/null '***'
-XMKMF?=			xmkmf -a
 .if exists(/sbin/md5)
 MD5?=			/sbin/md5
 .elif exists(/bin/md5)