Subject: Re: Buildlink & {,X11}PREFIX
To: Masao Uebayashi <uebayasi@soum.co.jp>
From: Alistair Crooks <agc@wasabisystems.com>
List: tech-pkg
Date: 03/25/2002 00:10:01
On Sat, Mar 23, 2002 at 05:59:37PM +0900, Masao Uebayashi wrote:
> Given a buildlink.mk, "buildlink" tries to know the place of the
> source files (installed library files) relying on the information just
> got at the time the "make" is invoked.  In other words, "buildlink"
> assumes that {,X11}PREFIX have never changed since the package was
> installed.
> 
> This scheme obviously breaks if an user installs xpkgwedge after
> installing some non-xpkgwedge'ed X-packages, or changes PREFIX
> somewhere else than previous.

I don't know where you come up with that idea.

The buildlink.mk files include lines of the form:

EVAL_PREFIX+=           BUILDLINK_PREFIX.gtk=gtk
BUILDLINK_PREFIX.gtk_DEFAULT=   ${X11PREFIX}

(that was taken from x11/gtk's buildlink.mk file).

The EVAL_PREFIX section is defined in bsd.pkg.mk, and uses pkg_info
to get the installed prefix of the gtk package. I personally went
to a lot of trouble to implement the EVAL_PREFIX functionality in
the first place.

To quote from pkgsrc/Packages.txt

* If xpkgwedge is installed, it is possible to have some packages installed in
   X11BASE and some in LOCALBASE. To determine the prefix of an installed
   package, the EVAL_PREFIX definition can be used. It takes pairs in the
   format DIRNAME=<package>, and the make(1) variable DIRNAME will be set
   to the prefix of the installed package <package>, or ${X11PREFIX} if the
   package is not installed.

   This is best illustrated by example.

   The following lines are taken from pkgsrc/wm/scwm/Makefile:

        EVAL_PREFIX+=   GTKDIR=gtk+
        CONFIGURE_ARGS+=        --with-guile-prefix=${LOCALBASE}        \
                                --with-gtk-prefix="${GTKDIR}"           \
                                --enable-multibyte
   
   Specific defaults can be defined for the packages evaluated using
   EVAL_PREFIX, by using a definition of the form:

        GTKDIR_DEFAULT= ${LOCALBASE}
   
   where "GTKDIR" corresponds to the first definition in the EVAL_PREFIX pair.

> So now... I want to know whether those who are facing buildlink
> problems install X-prefix'ed packages across /usr/X11R6 and /usr/pkg
> with xpkgwedge or not.

Please check your facts before you start asking questions like this.

Thanks,
Alistair