Subject: CVS commit: pkgsrc/x11/gtkmm3
From: Roland Illig
Date: 2020-06-07 19:14:23
Message id: 20200607171423.E47E1FB27@cvs.NetBSD.org

Log Message:
x11/gtkmm3: move gtk3 buildlink above the PKG_BUILD_OPTIONS

Before, "bmake show-all" showed that PLIST.x11 was commented out.  This
was misleading since during the actual package build, that variable is
active, and the corresponding files are included in the PLIST.

This inconsistency was due to the magic of MAKEVARS and the barrier.

When bmake is run, the build options of gtk3 are determined and added
to MAKEVARS.  At that point PLIST.x11 is still undefined.  That doesn't
matter since this variable is not evaluated yet.  Before the actual PLIST
generation happens, the value of PKG_BUILD_OPTIONS.gtk3 is stored in
work/.build_makevars.mk, which acts as a cache.

After that, the barrier steps in, and bmake calls an inner bmake to do
the actual work.  This inner bmake reads the package Makefile again, and
when bsd.prefs.mk is included, the makevars.mk cache is loaded as well.
This makes PKG_BUILD_OPTIONS.gtk3 known at load time, and at that point,
PLIST.x11 is evaluated as expected and becomes "yes".

Luckily, PLIST.x11 was not added to MAKEVARS.  Otherwise it would have
been evaluated too early, the early value would have been cached, and the
whole trick wouldn't have worked.

Files:
RevisionActionfile
1.40modifypkgsrc/x11/gtkmm3/Makefile