Subject: Re: X11 problems with pkgs
To: Tim Rightnour <root@garbled.net>
From: Todd Vierling <tv@pobox.com>
List: tech-userlevel
Date: 06/20/1998 22:18:23
On Sat, 20 Jun 1998, Tim Rightnour wrote:

: # [*] This is not always true, because I have additions that I have added to
: # <site.def> that can dynamically redefine ProjectRoot simply by setting
: # PREFIX in the environment.
: 
: I'd be veryested in seeing this, because I'm really sick of stuff getting in
: and around my X11R6 tree.  It would be *really* nice if we could make
: everything in the pkg system install into pkg, and leave a nice clean X11R6
: tree.

Actually, I use <host.def>, come to think of it, because that file is
basically empty.  Here it is - and you may be surprised at how small vs. 
powerful it is: 

/********** CUT /usr/X11R6/lib/X11/config/host.def **********/
#ifdef AfterVendorCF

/*
 * The following defines inject a "PREFIX=" make-time option that lets the
 * user twiddle the ProjectRoot setting with a single switch.  This makes
 * the command "make PREFIX=/path/to/install all install" work as expected.
 */

#ifdef ProjectRoot
PREFIX = ProjectRoot
X11_ROOT = ProjectRoot
#undef ProjectRoot
#else
/* Assume the worst:  this should not happen in practice. */
PREFIX = /usr/X11
X11_ROOT = /usr/X11
#endif

#define MakeCmd $(MAKE) PREFIX=$(PREFIX)
#define ProjectRoot $(PREFIX)

/*
 * This is necessary to emit dual -I and -L options to cc, one for the
 * actual X11 root, and one for the user-set prefix.
 */
#define X11ProjectRoot $(X11_ROOT)

#endif
/********** CUT /usr/X11R6/lib/X11/config/host.def **********/

: There is the environment variable: XAPPLRESDIR  which I believe can contain a
: path variable.

Hm, this is promising!  I'll check it out.

: My footnote, which I did omit.. is this.  I feel very strongly that nothing
: should be installed in the X11R6 tree.  *ever*.

So do I.  With the host.def above, and the XAPPLRESDIR variable, it looks
like ${LOCALBASE} (i.e. /usr/pkg) can be used instead of ${X11BASE} for
most, if not all, X packages.

Problem is, not everyone has this host.def, though a pkg could probably be
made to install it, or install a "replacement" site.def that includes these
modifications.  Or, a user can set X11BASE=${LOCALBASE} in /etc/mk.conf to
indicate that these modifications are available (probably the preferred
option). 

There are some pre-configure pkg targets out there that use sed to
substitute ${X11BASE} into Imakefiles; these need to be changed to use
${PREFIX} properly.  Once fixed, these sed manipulations would work with
either ${X11BASE} or ${LOCALBASE} as ${PREFIX}.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)