Subject: Re: CVS commit: pkgsrc/x11/xextensions
To: Johnny C. Lam <jlam@NetBSD.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 06/12/2005 13:15:38
--=-96uDmgt5zJ7gQ7f/fdVx
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Sat, 2005-06-11 at 18:20 +0000, Johnny C. Lam wrote:
> On Sat, Jun 11, 2005 at 08:49:33AM +0000, Julio M. Merino Vidal wrote:
> > 
> > Module Name:	pkgsrc
> > Committed By:	jmmv
> > Date:		Sat Jun 11 08:49:33 UTC 2005
> > 
> > Modified Files:
> > 	pkgsrc/x11/xextensions: builtin.mk
> > 
> > Log Message:
> > Revision 1.2 of this file added a check for the presence of xextensions.pc
> > to decide whether the builtin version was enough or not.  This check was
> > removed in 1.3 during the conversion to the new builtin structure, hence
> > breaking, at least, compositeext (on which many other packages depend).
> > Given this, readd the check.
> 
> Is there another file that can be checked, or maybe a symbol we can
> look for in a header?  Or can we dummy up an xextensions.pc file for
> the built-in version?  It seems odd that we're checking for a *.pc
> file since no XFree86 distribution has it.

Hmm, that's a good point.  I don't know if we need to check for any
given symbol in the installed headers, but compositeext works fine with
the builtin xextensions.

So, is the attached patch correct?  It generates a fake .pc file in the
buildlink directory if a real one does not exist.

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/

--=-96uDmgt5zJ7gQ7f/fdVx
Content-Disposition: attachment; filename=patch.diff
Content-Type: text/x-patch; name=patch.diff; charset=UTF-8
Content-Transfer-Encoding: 7bit

Index: builtin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/xextensions/builtin.mk,v
retrieving revision 1.4
diff -u -r1.4 builtin.mk
--- builtin.mk	11 Jun 2005 08:49:33 -0000	1.4
+++ builtin.mk	12 Jun 2005 11:13:48 -0000
@@ -2,11 +2,9 @@
 
 BUILTIN_PKG:=	xextensions
 
-BUILTIN_FIND_FILES_VAR:=		H_XEXTENSIONS PC_XEXTENSIONS
+BUILTIN_FIND_FILES_VAR:=		H_XEXTENSIONS
 BUILTIN_FIND_FILES.H_XEXTENSIONS=	\
 	${X11BASE}/include/X11/extensions/extutil.h
-BUILTIN_FIND_FILES.PC_XEXTENSIONS=	\
-	${X11BASE}/lib/pkgconfig/xextensions.pc
 
 .include "../../mk/buildlink3/bsd.builtin.mk"
 
@@ -21,7 +19,7 @@
 # we'll consider this X11 package to be built-in even if it's a part
 # of one of the pkgsrc-installed X11 distributions.
 #  
-.  if exists(${H_XEXTENSIONS}) && exists(${PC_XEXTENSIONS})
+.  if exists(${H_XEXTENSIONS})
 IS_BUILTIN.xextensions=	yes
 .  endif
 .endif
@@ -67,4 +65,19 @@
 .    include "../../mk/x11.builtin.mk"
 .  endif
 
+# Check whether the implementation we selected has a xextensions.pc file
+# or not.  If the latter, generate a fake one.
+.  if exists(${BUILDLINK_PREFIX.xextensions}/lib/pkgconfig/xextensions.pc)
+BUILDLINK_FILES.xextensions+=	lib/pkgconfig/fontconfig.pc
+.  else
+BUILDLINK_TARGETS+=	xextensions-fake-pc
+
+xextensions-fake-pc:
+	@{ ${ECHO} "Name: XExtensions"; \
+	   ${ECHO} "Description: Sundry X extension headers"; \
+	   ${ECHO} "Version: 1.0.1"; \
+	   ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextensions}/include"; \
+	} >${BUILDLINK_DIR}/lib/pkgconfig/xextensions.pc
+.  endif
+
 .endif	# CHECK_BUILTIN.xextensions

--=-96uDmgt5zJ7gQ7f/fdVx--