Subject: please build qt3-libs and qt3-tools using buildlink3 (patches
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 07/02/2004 16:48:00
In PR #25753, Joachim Kuebart provided some ideas on making qt3-libs build
using buildlink3.

Early last month, I used these ideas under Linux and NetBSD 1.6.2 to build
and install qt3-libs and qt3-tools and a few packages using qt3.

Please test the following patches. (It also makes qt3-libs pkgview
ready but I did not test that.)

In the qmake.conf patch below, it should probably use
${_COMPILER_LD_FLAG}${_OPSYS_RPATH_NAME} instead and the post-patch SED
work at bottom of Makefile.common should do that too. (If you can test
that instead, please do so.)

Thank you (and thank you to Joachim also).

Index: x11/qt3-libs/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt3-libs/Makefile,v
retrieving revision 1.24
diff -b -u -r1.24 Makefile
--- x11/qt3-libs/Makefile	16 Apr 2004 14:30:44 -0000	1.24
+++ x11/qt3-libs/Makefile	2 Jul 2004 23:37:43 -0000
@@ -3,12 +3,17 @@

 LIBQT=			${WRKSRC}/lib/libqt-mt.la

+# set this before Makefile.common which includes compiler.mk which includes
+# bsd.prefs.mk which sets PKG_INSTALLATION_TYPE to the wrong value.
+PKG_INSTALLATION_TYPES=	overwrite pkgviews
+
 .include "../qt3-libs/Makefile.common"

 PKGNAME=		qt3-libs-${QTVERSION}
+PKGREVISION=		1
 COMMENT=		C++ X GUI toolkit

-USE_BUILDLINK2=		yes
+USE_BUILDLINK3=		yes
 GCC_REQD+=		2.95.3

 ALL_TARGET=		sub-plugins
@@ -34,16 +39,16 @@
 	${LIBTOOL} ${INSTALL_DATA} ${WRKSRC}/plugins/imageformats/libqjpeg.la ${QTPREFIX}/plugins/imageformats
 	${LIBTOOL} ${INSTALL_DATA} ${WRKSRC}/plugins/imageformats/libqmng.la ${QTPREFIX}/plugins/imageformats

-.include "../../devel/zlib/buildlink2.mk"
-.include "../../fonts/Xft2/buildlink2.mk"
-.include "../../graphics/jpeg/buildlink2.mk"
-.include "../../graphics/MesaLib/buildlink2.mk"
-.include "../../graphics/glu/buildlink2.mk"
-.include "../../graphics/mng/buildlink2.mk"
-.include "../../graphics/png/buildlink2.mk"
-.include "../../graphics/freetype2/buildlink2.mk"
-.include "../../x11/Xrandr/buildlink2.mk"
-.include "../../x11/xcursor/buildlink2.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../fonts/Xft2/buildlink3.mk"
+.include "../../graphics/jpeg/buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../graphics/glu/buildlink3.mk"
+.include "../../graphics/mng/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../x11/Xrandr/buildlink3.mk"
+.include "../../x11/xcursor/buildlink3.mk"

-.include "../../mk/pthread.buildlink2.mk"
+.include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: x11/qt3-libs/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt3-libs/Makefile.common,v
retrieving revision 1.30
diff -b -u -r1.30 Makefile.common
--- x11/qt3-libs/Makefile.common	30 Mar 2004 21:50:19 -0000	1.30
+++ x11/qt3-libs/Makefile.common	2 Jul 2004 23:37:43 -0000
@@ -26,8 +26,7 @@
 CONFIGURE_ARGS+=	-shared -sm -thread -no-stl \
 			-system-zlib -system-libpng \
 			-system-libmng -system-libjpeg \
-			-I${BUILDLINK_DIR}/include \
-			-L${BUILDLINK_DIR}/lib
+			${CFLAGS:M-I*} ${LDFLAGS:M-L*} ${LDFLAGS:M-Wl*:S/-Wl,//}
 CONFIGURE_ARGS+=	-qt-gif	# qt3 does not write compressed GIFs

 CONFIGURE_ARGS+=	< ${FILESDIR}/license-acceptance
cvs diff: Diffing x11/qt3-libs/files
Index: x11/qt3-libs/files/qmake.conf
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt3-libs/files/qmake.conf,v
retrieving revision 1.12
diff -b -u -r1.12 qmake.conf
--- x11/qt3-libs/files/qmake.conf	10 Dec 2003 14:24:35 -0000	1.12
+++ x11/qt3-libs/files/qmake.conf	2 Jul 2004 23:37:43 -0000
@@ -62,7 +62,7 @@
 QMAKE_LFLAGS_SHLIB	=
 QMAKE_LFLAGS_PLUGIN	= $$QMAKE_LFLAGS_SHLIB
 QMAKE_LFLAGS_SONAME	=
-QMAKE_RPATH		=
+QMAKE_RPATH		= -Wl,-rpath,

 QMAKE_RUN_CC		= @LIBTOOL@ --mode=compile @CC@ -c $(CFLAGS) $(INCPATH) -o $obj $src
 QMAKE_RUN_CC_IMP	= @LIBTOOL@ --mode=compile @CC@ -c $(CFLAGS) $(INCPATH) -o $@ $<
cvs diff: Diffing x11/qt3-libs/patches
cvs diff: Diffing x11/qt3-tools
Index: x11/qt3-tools/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt3-tools/Makefile,v
retrieving revision 1.25
diff -b -u -r1.25 Makefile
--- x11/qt3-tools/Makefile	16 Apr 2004 14:30:45 -0000	1.25
+++ x11/qt3-tools/Makefile	2 Jul 2004 23:37:43 -0000
@@ -9,7 +9,7 @@
 CONFIGURE_ARGS+=	-I${QTDIR}/include \
 			-L${QTDIR}/lib

-USE_BUILDLINK2=		yes
+USE_BUILDLINK3=		yes
 BUILD_QT3=		yes
 UNLIMIT_RESOURCES=	datasize
 ALL_TARGET=		sub-tools
@@ -37,5 +37,5 @@
 	${INSTALL_DATA_DIR} ${QTPREFIX}/mkspecs
 	${CP} -R ${WRKSRC}/mkspecs ${QTPREFIX}

-.include "../../x11/qt3-libs/buildlink2.mk"
+.include "../../x11/qt3-libs/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"


 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/