Subject: Re: pkg/30537: graphics/MesaLib pthread usage
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Johnny C. Lam <jlam@NetBSD.org>
List: pkgsrc-bugs
Date: 06/16/2005 18:55:02
The following reply was made to PR pkg/30537; it has been noted by GNATS.

From: "Johnny C. Lam" <jlam@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: krister@netbsd.org
Subject: Re: pkg/30537: graphics/MesaLib pthread usage
Date: Thu, 16 Jun 2005 18:54:38 +0000

 --G4iJoqBmSsgzjUCe
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Thu, Jun 16, 2005 at 09:58:00AM +0000, kristerw@netbsd.org wrote:
 > >Description:
 > The graphics/MesaLib does not have any dependencies on pthreads, but
 > the linking of libGL.so does add -lpthread.  This makes libtool
 > add --lpthread in .la file, with the result that all packages
 > linking to libGL.so need to add an explicit dependency on pthread,
 > even if they don't use threads.
 > 
 > I think the -lpthread should be removed -- no pthreads .h files
 > are available during the build, so the package cannot be using
 > any thread functionality?  Otherwise a proper pthread dependency
 > should be added to the package (and its buildlink3.mk)
 
 If we want to add the proper pthread dependency to MesaLib, the attached
 patch is the way to do it.  I'm in favor of going this way so that
 the pkgsrc MesaLib is thread-safe.  This will cause packages that
 include MesaLib/buildlink3.mk to indirectly pull in pthread.buildlink3.mk
 so that -lpthread will resolve correctly.  However, this needs testing
 on a NetBSD-1.6.2 system to see if it builds correcty using GNU pth.
 
 	Cheers,
 
 	-- Johnny Lam <jlam@NetBSD.org>
 
 --G4iJoqBmSsgzjUCe
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="MesaLib.patch"
 
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/graphics/MesaLib/Makefile,v
 retrieving revision 1.39
 diff -u -r1.39 Makefile
 --- Makefile	5 Jun 2005 15:39:06 -0000	1.39
 +++ Makefile	16 Jun 2005 18:49:40 -0000
 @@ -1,7 +1,7 @@
  # $NetBSD: Makefile,v 1.39 2005/06/05 15:39:06 minskim Exp $
  
  PKGNAME=	MesaLib-${MESA_VERSION}
 -PKGREVISION=	1
 +PKGREVISION=	2
  COMMENT=	Graphics library similar to SGI's OpenGL
  
  .include "../Mesa/Makefile.common"
 @@ -19,6 +19,8 @@
  BUILDLINK_TRANSFORM+=   rm:-O[23]
  .endif
  
 +.include "../../mk/pthread.buildlink3.mk"
 +
  pre-build:
  	cd ${WRKSRC} && ${RM} -fr src/glu src/glut progs
  
 Index: builtin.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/graphics/MesaLib/builtin.mk,v
 retrieving revision 1.9
 diff -u -r1.9 builtin.mk
 --- builtin.mk	3 Jun 2005 19:12:49 -0000	1.9
 +++ builtin.mk	16 Jun 2005 18:49:40 -0000
 @@ -68,7 +68,11 @@
  .if !empty(CHECK_BUILTIN.MesaLib:M[nN][oO])
  
  .  if !empty(USE_BUILTIN.MesaLib:M[nN][oO])
 -BUILDLINK_DEPENDS.MesaLib+=	MesaLib>=6.0
 +BUILDLINK_DEPENDS.MesaLib+=	MesaLib>=6.2.1nb2
 +BUILDLINK_DEPTH:=		${BUILDLINK_DEPTH}+
 +.    include "../../mk/pthread.buildlink3.mk"
 +.    include "../../mk/pthread.builtin.mk"
 +BUILDLINK_DEPTH:=		${BUILDLINK_DEPTH:S/+$//}
  .  endif
  
  .  if !empty(USE_BUILTIN.MesaLib:M[yY][eE][sS])
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/graphics/MesaLib/distinfo,v
 retrieving revision 1.28
 diff -u -r1.28 distinfo
 --- distinfo	7 Jun 2005 14:31:48 -0000	1.28
 +++ distinfo	16 Jun 2005 18:49:40 -0000
 @@ -7,7 +7,7 @@
  RMD160 (Mesa-6.2.1/MesaDemos-6.2.1.tar.bz2) = 62b3ebc47e822c4704b69c9888e74bae12a1391b
  Size (Mesa-6.2.1/MesaDemos-6.2.1.tar.bz2) = 1004511 bytes
  SHA1 (patch-aa) = 90457ea124a42150e3a37b48e1e0691597668606
 -SHA1 (patch-ab) = 8de78b793e384578d8821a4ef487bb2b39ebfcb6
 +SHA1 (patch-ab) = c257a57d4570576f160e9a4c029384718402c1bd
  SHA1 (patch-ac) = 9a0717105fef41e84b5faebaa8bd91d1c0964b86
  SHA1 (patch-ad) = 000d115933e3f75ca096effa47e8d19c900fe95c
  SHA1 (patch-ae) = a92133c77b1b958dcfe9b37ddc317d6ff31157d0
 Index: patches/patch-ab
 ===================================================================
 RCS file: /cvsroot/pkgsrc/graphics/MesaLib/patches/patch-ab,v
 retrieving revision 1.13
 diff -u -r1.13 patch-ab
 --- patches/patch-ab	27 Oct 2004 19:20:33 -0000	1.13
 +++ patches/patch-ab	16 Jun 2005 18:49:40 -0000
 @@ -10,6 +10,6 @@
  +CONFIG_NAME = pkgsrc
  +
  +# Compiler and flags
 -+CFLAGS+= -DUSE_XSHM
 ++CFLAGS+= -DUSE_XSHM -DPTHREADS
  +APP_LIB_DEPS = -L$(LIB_DIR) -L${PREFIX}/lib -L${X11PREFIX}/lib -lXext -lXmu -lXi -lX11 -lm
  +
 
 --G4iJoqBmSsgzjUCe--