]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
patch qt 3.3.3 (and 3.3.4) - fix pb with libGL loading
authorvsr <vsr@opencascade.com>
Thu, 14 Dec 2006 14:38:34 +0000 (14:38 +0000)
committervsr <vsr@opencascade.com>
Thu, 14 Dec 2006 14:38:34 +0000 (14:38 +0000)
config_files/patches/qt-3.3.3-load-gl.patch [new file with mode: 0755]
config_files/qt-3.3.3.sh
config_files/qt-3.3.4.sh

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 (executable)
index 0000000..5337b85
--- /dev/null
@@ -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 <private/qlibrary_p.h>
+ #include <qstringlist.h>
++#include <qregexp.h>
+ #include <qfile.h>
+ #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;
index 213f593df501bfbbb922477f1f38e819b75723b8..e1061a879c6dcbe80e40072541f01dd57aca77b1 100755 (executable)
@@ -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
index cf1e7cf2faddb94fef92ecbe0eaebab56d3aa6ba..222c67e12f7695bb4833d963c5c79cb5cc70f6e8 100755 (executable)
@@ -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