From: vsr Date: Thu, 14 Dec 2006 14:38:34 +0000 (+0000) Subject: patch qt 3.3.3 (and 3.3.4) - fix pb with libGL loading X-Git-Tag: V_3_2_4~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8f86291a2e7147b9fca8d1aea5ad950017a9814b;p=tools%2Finstall.git patch qt 3.3.3 (and 3.3.4) - fix pb with libGL loading --- diff --git a/config_files/patches/qt-3.3.3-load-gl.patch b/config_files/patches/qt-3.3.3-load-gl.patch new file mode 100755 index 0000000..5337b85 --- /dev/null +++ b/config_files/patches/qt-3.3.3-load-gl.patch @@ -0,0 +1,46 @@ +diff -Naur qt-3.3.3-original/src/opengl/qgl_x11.cpp qt-3.3.3-patched/src/opengl/qgl_x11.cpp +--- qt-3.3.3-original/src/opengl/qgl_x11.cpp 2004-08-05 18:42:12.000000000 +0400 ++++ qt-3.3.3-patched/src/opengl/qgl_x11.cpp 2006-12-14 16:26:33.000000000 +0300 +@@ -125,7 +125,7 @@ + if (gl_syms_resolved) + return TRUE; + +- QLibrary gl("GL"); ++ QLibrary gl("libGL.so.1"); + gl.setAutoUnload(FALSE); + + qt_glCallLists = (_glCallLists) gl.resolve("glCallLists"); +diff -Naur qt-3.3.3-original/src/tools/qlibrary.cpp qt-3.3.3-patched/src/tools/qlibrary.cpp +--- qt-3.3.3-original/src/tools/qlibrary.cpp 2004-08-05 18:41:55.000000000 +0400 ++++ qt-3.3.3-patched/src/tools/qlibrary.cpp 2006-12-14 16:29:26.000000000 +0300 +@@ -39,6 +39,7 @@ + #include "qplatformdefs.h" + #include + #include ++#include + #include + + #ifndef QT_NO_LIBRARY +@@ -393,6 +394,8 @@ + return libfile; + + QString filename = libfile; ++ if (QFile::exists(filename)) ++ return filename; + + #if defined(Q_WS_WIN) + if ( filename.findRev( '.' ) <= filename.findRev( '/' ) ) +@@ -422,10 +425,11 @@ + QString path = tmpfilename.left( x + 1 ); + QString file = tmpfilename.right( tmpfilename.length() - x - 1 ); + tmpfilename = QString( "%1lib%2" ).arg( path ).arg( file ); +- } else { ++ } else if (tmpfilename.left(3) != QString("lib")) { + tmpfilename = QString( "lib%1" ).arg( filename ); + } +- tmpfilename += filter; ++ if (!tmpfilename.contains(QRegExp(filter + "((\\.[0-9]+)+)?$"))) ++ tmpfilename += filter; + if(QFile::exists(tmpfilename) || it == filters.end()) { + filename = tmpfilename; + break; diff --git a/config_files/qt-3.3.3.sh b/config_files/qt-3.3.3.sh index 213f593..e1061a8 100755 --- a/config_files/qt-3.3.3.sh +++ b/config_files/qt-3.3.3.sh @@ -87,6 +87,14 @@ source ${INSTALL_WORK}/$SHRC makedir ${PRODUCT_DIR} check_jb tar xfz ${SOURCE_DIR}/qt-3.3.3.tar.gz -C ${INSTALL_WORK} + +# apply patch : fix pb of libGL loading +if [ -f patches/qt-3.3.3-load-gl.patch ] ; then + cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_WORK} + ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.3-load-gl.patch ) + patched_for_gl="yes" +fi + cd ${PRODUCT_WORK} mv -f configure configure-orig @@ -103,8 +111,12 @@ QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpe # use all plugin styles except -plugin-style-windows QT_FLAGS=$QT_FLAGS" -plugin-style-cde -plugin-style-compact -plugin-style-motif -plugin-style-motifplus -plugin-style-platinum -plugin-style-sgi" -# prefix +# add -dlopen-opengl flag (ONLY if the corresponding patch was applied) +if [ "$patched_for_gl" == "yes" ] ; then + QT_FLAGS=$QT_FLAGS" -dlopen-opengl" +fi +# configure check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR} sed -e "s%^all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples%all: symlinks src-qmake src-moc sub-src sub-tools%g" Makefile > _Makefile diff --git a/config_files/qt-3.3.4.sh b/config_files/qt-3.3.4.sh index cf1e7cf..222c67e 100755 --- a/config_files/qt-3.3.4.sh +++ b/config_files/qt-3.3.4.sh @@ -95,6 +95,13 @@ makedir ${PRODUCT_DIR} check_jb tar xfz ${SOURCE_DIR}/qt-3.3.4.tar.gz -C ${INSTALL_WORK} +# apply patch : fix pb of libGL loading +if [ -f patches/qt-3.3.3-load-gl.patch ] ; then + cp patches/qt-3.3.3-load-gl.patch ${PRODUCT_WORK} + ( cd ${PRODUCT_WORK} ; patch -p1 < qt-3.3.3-load-gl.patch ) + patched_for_gl="yes" +fi + # apply patch for 64-bit platforms if test `uname -m` = "x86_64" ; then if [ -f patches/qt-3.3.4-lib64.patch ] ; then @@ -120,8 +127,13 @@ export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH fi # use system graphics libraries QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -lpng -lmng -ljpeg" -# prefix +# add -dlopen-opengl flag (ONLY if the corresponding patch was applied) +if [ "$patched_for_gl" == "yes" ] ; then + QT_FLAGS=$QT_FLAGS" -dlopen-opengl" +fi + +# plugins if [ -e /etc/mandriva-release ] ; then version=`cat /etc/mandriva-release | awk '{print $1$4}'` if [ "$version" == "Mandriva2006.0" ] ; then @@ -129,6 +141,7 @@ if [ -e /etc/mandriva-release ] ; then fi fi +# configure check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR} sed -e "s%^all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples%all: symlinks src-qmake src-moc sub-src sub-tools%g" Makefile > _Makefile