tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: builtin MesaLib



On Fri, Jun 14, 2013 at 09:50:33AM +0200, Thomas Klausner wrote:
 > On Fri, Jun 14, 2013 at 03:40:50AM +0000, David Holland wrote:
 > > It would be helpful if someone who knows how to do that check right
 > > would fix it. Or maybe the lot should be replaced by a pkgconfig
 > > query.
 > 
 > The easiest example for a pkgconfig query in a builtin.mk file I know
 > of is in databases/sqlite3/builtin.mk:
 > 
 > BUILTIN_PKG:=   sqlite3
 > 
 > PKGCONFIG_FILE.sqlite3= /usr/lib/pkgconfig/sqlite3.pc
 > PKGCONFIG_BASE.sqlite3= /usr
 > 
 > .include "../../mk/buildlink3/pkgconfig-builtin.mk"
 > 
 > Perhaps you can play around with something similar for MesaLib until
 > it works?

The following seems to work, although it isn't that tidy:

Index: builtin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/MesaLib/builtin.mk,v
retrieving revision 1.18
diff -u -r1.18 builtin.mk
--- builtin.mk  19 Mar 2012 12:34:13 -0000      1.18
+++ builtin.mk  16 Jun 2013 01:56:16 -0000
@@ -2,8 +2,9 @@
 
 BUILTIN_PKG:=  MesaLib
 
-BUILTIN_FIND_FILES_VAR:=       H_MESALIB
+BUILTIN_FIND_FILES_VAR:=       H_MESALIB PC_GL
 BUILTIN_FIND_FILES.H_MESALIB=  ${X11BASE}/include/GL/glx.h
+BUILTIN_FIND_FILES.PC_GL=      ${X11BASE}/lib/pkgconfig/gl.pc
 
 .include "../../mk/buildlink3/bsd.builtin.mk"
 
@@ -12,7 +13,9 @@
 ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
 ###
 .if !defined(IS_BUILTIN.MesaLib)
-.  if empty(H_MESALIB:M__nonexistent__)
+.  if empty(PC_GL:M__nonexistent__)
+IS_BUILTIN.MesaLib=    yes
+.  elif empty(H_MESALIB:M__nonexistent__)
 IS_BUILTIN.MesaLib=    yes
 .  else
 IS_BUILTIN.MesaLib=    no
@@ -25,10 +28,16 @@
 ### a package name to represent the built-in package.
 ###
 .if !defined(BUILTIN_PKG.MesaLib) && \
-    !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS]) && \
-    empty(H_MESALIB:M__nonexistent__)
-.  include "../../graphics/Mesa/version.mk"
+    !empty(IS_BUILTIN.MesaLib:M[yY][eE][sS])
+.  if empty(PC_GL:M__nonexistent__)
+BUILTIN_VERSION.Mesa!= ${SED} -n -e 's/Version: //p' ${PC_GL}
+.  elif empty(H_MESALIB:M__nonexistent__)
+.    include "../../graphics/Mesa/version.mk"
+.  else # ?
+BUILTIN_VERSION.Mesa:= 0.something-weird-happened
+.  endif
 BUILTIN_PKG.MesaLib=   MesaLib-${BUILTIN_VERSION.Mesa}
+MAKEVARS+=     BUILTIN_VERSION.Mesa
 .endif
 MAKEVARS+=     BUILTIN_PKG.MesaLib
 

One would also apply a matching change to graphics/glu/builtin.mk.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index