Subject: xpkgwedge proposal
To: None <>
From: Johnny C. Lam <>
List: tech-pkg
Date: 10/14/2000 23:50:47

	Now that the pkgsrc freeze is over, I'd like to propose some
changes to xpkgwedge.  I suspect this is a widely used packages, so
I'm soliciting feedback on my proposed changes.

	For the past several weeks, I've using a local xpkgwedge
package with the changes listed below.  I've rebuilt all of my pkgsrc
with and without the new xpkgwedge installed, so the changes are
stable and they work.

	* In xpkgwedge.def, 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 a slightly modified
	  xmkmf: it checks in ${PREFIX}/lib/X11/config before the standard
	  X11 config directory.

	* Create the host.def file in ${PREFIX}/lib/X11/config instead of
	  modifying the one in ${X11BASE}/lib/X11/config.

The benefits of this are:

	1) xpkgwedge can now install into ${PREFIX} instead of always into
	   ${X11BASE}.  This keeps the X11 tree "pure".

	2) Packages that install config files (lesstif, xview-config) can
	   now do so in $(PREFIX) and the right thing will happen,
	   regardless of whether xpkgwedge is installed or not.

	3) 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.

	4) This doesn't affect people who want to run xmkmf and not include
	   all the xpkgwedge stuff, even if it's installed.

I've placed my modified xpkgwedge (bumped version to 0.5) at

so please download it and take a look.  To complete the changes to use
the new xpkgwedge, you'll need the following modification to  Again, I'd like to reiterate that this doesn't affect
users who *don't* want to use xpkgwedge.

Please let me know what you think.


     -- Johnny C. Lam <>
        Department of Statistics, Carnegie Mellon University

RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.585
diff -u -r1.585
---	2000/10/13 23:18:00	1.585
+++	2000/10/15 03:29:55
@@ -89,11 +89,18 @@
-# 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 check for the existence of ${X11BASE}/lib/X11/config/xpkgwedge.def
+# is to catch users of xpkgwedge<0.5.
+.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
+    exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
+XMKMF?=			pkgxmkmf -a
+XMKMF?=			xmkmf -a
 .if defined(USE_MOTIF12)
@@ -117,6 +124,14 @@
 .endif  # USE_MOTIF
 .if defined(USE_IMAKE) || defined(USE_MOTIF) || defined(USE_X11BASE)
+.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
+    exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
+# XXX: actually, here we would need something like
+# BUILD_DEPENDS+=xpkgwedge>=0.5:../../pkgtools/xpkgwedge
+.if make(install-run-depends)
+DEPENDS+=		xpkgwedge>=0.5:../../pkgtools/xpkgwedge
 .elif defined(USE_CROSSBASE)
@@ -246,7 +261,6 @@
 # Miscellaneous overridable commands:
 SHCOMMENT?=		${ECHO_MSG} >/dev/null '***'
-XMKMF?=			xmkmf -a
 .if exists(/sbin/md5)
 MD5?=			/sbin/md5
 .elif exists(/bin/md5)