Subject: Re: pkg/31038: indirect inclusion of x11.buildlink3.mk is broken
To: None <gnats-bugs@netbsd.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: pkgsrc-bugs
Date: 09/21/2005 01:50:17
--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Aug 22, 2005 at 08:22:00AM +0000, hira@po6.nsk.ne.jp wrote:
> 	If package indirectly includes mk/x11.buildlink3.mk, some
> 	builtin.mk files are not read.  For example, x11/randrext:
> 
> # cd /usr/pkgsrc/x11/randrext
> # grep x11.buildlink3.mk Makefile
> # make show-var VARNAME=BUILDLINK_PACKAGES
> xorg-libs xextensions fontconfig iconv zlib freetype2 expat
> # make show-var VARNAME=BUILDLINK_BUILTIN_MK.xextensions
> ../../x11/xextensions/builtin.mk
> # make show-var VARNAME=BUILDLINK_BUILTIN_MK.zlib
> 
> # make show-var VARNAME=IS_BUILTIN.zlib
> 
> #
> 
> 	This package indirectly includes mk/x11.buildlink3.mk via
> 	x11/xextensions/builtin.mk.  And this adds inclusions of
> 	buildlink3.mk files of zlib, fontconfig, etc.  However,
> 	these BUILDLINK_BUILTIN_MK are not defined.
> 
> 	If the package is added to BUILDLINK_PACKAGES,
> 	BUILDLINK_BUILTIN_MK.${package} should be defined at line
> 	108 of mk/buildlink3/bsd.buildlink3.mk.  It's too late to
> 	include the buildlink3.mk files.

This analysis of the problem is absolutely correct.  In addition, I
believe that this problem only affects installations that are using
pkgsrc X.org or XFree86 to provide X11 libraries.  This should be
fixed by modifying the builtin.mk files for xorg-libs and XFree86-libs
to also include the builtin.mk files that correspond to the buildlink3.mk
files included by the buildlink3.mk file for xorg-libs and XFree86-libs.
Can you please test the attached patch to xorg-libs/builtin.mk to see
if it fixes the problem?

	Thanks,

	-- Johnny Lam <jlam@NetBSD.org>

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xorg-libs.diff"

Index: builtin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/xorg-libs/builtin.mk,v
retrieving revision 1.2
diff -u -r1.2 builtin.mk
--- builtin.mk	24 Jun 2005 05:21:31 -0000	1.2
+++ builtin.mk	21 Sep 2005 01:47:08 -0000
@@ -65,6 +65,17 @@
 CHECK_BUILTIN.xorg-libs?=	no
 .if !empty(CHECK_BUILTIN.xorg-libs:M[nN][oO])
 
+.  if !empty(USE_BUILTIN.xorg-libs:M[nN][oO])
+.    for _mkfile_ in buildlink3.mk builtin.mk
+BUILDLINK_DEPTH:=               ${BUILDLINK_DEPTH}+
+.      sinclude "../../devel/zlib/${_mkfile_}"
+.      sinclude "../../fonts/fontconfig/${_mkfile_}"
+.      sinclude "../../graphics/freetype2/${_mkfile_}"
+.      sinclude "../../textproc/expat/${_mkfile_}"
+BUILDLINK_DEPTH:=               ${BUILDLINK_DEPTH:S/+$//}
+.    endfor
+.  endif
+
 .  if !empty(USE_BUILTIN.xorg-libs:M[yY][eE][sS])
 BUILDLINK_PREFIX.xorg-libs=	${X11BASE}
 BUILDLINK_FILES.xorg-libs+=	lib/pkgconfig/xorg-libs.pc

--9amGYk9869ThD9tj--