[arch-commits] CVS update of extra/lib/qt3 (7 files)

Pierre Schmitz pierre at archlinux.org
Sat Nov 10 15:03:17 UTC 2007


    Date: Saturday, November 10, 2007 @ 10:03:17
  Author: pierre
    Path: /home/cvs-extra/extra/lib/qt3

   Added: PKGBUILD (1.1) mysql.patch (1.1) qt-copy-kde-patches.tar.bz2 (1.1)
          qt-font-default-subst.diff (1.1) qt-patches.tar.bz2 (1.1)
          qt.profile (1.1) utf8-bug-qt3.diff (1.1)

upgpkg: qt3 3.3.8-5
rename old qt to qt3


-----------------------------+
 PKGBUILD                    |  108 ++++++++++++++++++++++++++++++++++++++++++
 mysql.patch                 |   47 ++++++++++++++++++
 qt-copy-kde-patches.tar.bz2 |    <<Binary file>>
 qt-font-default-subst.diff  |   77 +++++++++++++++++++++++++++++
 qt-patches.tar.bz2          |    <<Binary file>>
 qt.profile                  |    6 ++
 utf8-bug-qt3.diff           |  101 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 341 insertions(+)


Index: extra/lib/qt3/PKGBUILD
diff -u /dev/null extra/lib/qt3/PKGBUILD:1.1
--- /dev/null	Sat Nov 10 10:03:17 2007
+++ extra/lib/qt3/PKGBUILD	Sat Nov 10 10:03:17 2007
@@ -0,0 +1,108 @@
+# $Id: PKGBUILD,v 1.1 2007/11/10 15:03:17 pierre Exp $
+# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
+# Contributor: John Proctor <jproctor at prium.net>
+pkgname=qt3
+pkgver=3.3.8
+pkgrel=5
+pkgdesc="The QT gui toolkit."
+arch=(i686 x86_64)
+license=('GPL')
+url="http://www.trolltech.com/products/qt/index.html"
+pkgfqn=qt-x11-free-${pkgver}
+install=qt.install
+depends=('libpng' 'libjpeg' 'libxmu' 'libxcursor' 'libxinerama' 'mesa' \
+	 'libxft' 'libxrandr')
+makedepends=('mysql' 'postgresql>=8.2.3' 'sqlite3' 'unixodbc' 'libmng')
+source=(ftp://ftp.trolltech.com/qt/source/${pkgfqn}.tar.bz2 qt.profile \
+        qt-copy-kde-patches.tar.bz2 qt-patches.tar.bz2 utf8-bug-qt3.diff \
+	qt-font-default-subst.diff mysql.patch)
+md5sums=('cf3c43a7dfde5bfb76f8001102fe6e85'
+         '71fee534492524002eb06ddceecc98d9'
+         'f2a2dbdbfee9422c90efc3ef3f86197c'
+         'c8937968e9807b3cdcdf0505728d99ce'
+         'f6b3b39040f2b8f19ba1cf1445468c28'
+         '9370d82e85f2c799335ed0dcc1d53189'
+         '7d40ed1bd40d33d8b9b27a2076a5d22a')
+# qt-copy-kde-patches come from http://websvn.kde.org/trunk/qt-copy/patches/
+# other qt-patches come from fedora and gentoo
+
+build() {
+  export QTDIR=$startdir/src/$pkgfqn
+  export PATH=${QTDIR}/bin:${PATH}
+  export LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}
+  export QMAKESPEC=$QTDIR/mkspecs/linux-g++
+  cd $startdir/src/$pkgfqn
+  # apply qt patches from kde.org
+  for i in ../qt-copy-kde-patches/*; do
+    patch -Np0 -i $i || return 1
+  done
+  # apply other qt patches and one security fix from debian/gentoo
+  for i in ../qt-patches/*; do
+    patch -Np1 -i $i || return 1
+  done
+  # fix utf8 bug
+  patch -Np0 -i ../utf8-bug-qt3.diff || return 1
+  # fix asia fonts
+  patch -Np0 -i ../qt-font-default-subst.diff || return 1
+  # fix segfaults on exit when using mysql DB driver
+  patch -Np0 -i ../mysql.patch || return 1
+  # start compiling qt
+  sed -i 's|-cp -P -f|-cp -L -f|' qmake/Makefile.unix
+  rm -rf doc/html examples tutorial
+  sed -i "s|sub-tutorial sub-examples||" Makefile
+  sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++/qmake.conf
+  sed -i "s|-I. |$CXXFLAGS -I. |" qmake/Makefile.unix
+  sed -i "s|read acceptance|acceptance=yes|" configure
+
+  if [ "$CARCH" = "x86_64" ]; then
+      export ARCH="-64"	
+    else unset ARCH
+  fi
+
+  ./configure -prefix /opt/qt -platform linux-g++$ARCH \
+    -system-zlib -qt-gif -release -shared -sm -nis -thread -stl \
+    -{system-lib,plugin-imgfmt-}{png,jpeg,mng} \
+    -no-g++-exceptions -plugin-sql-{mysql,psql,sqlite,odbc}
+
+  # fix /opt/qt/lib path
+  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/src/Makefile
+  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/designer/designer/Makefile
+  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/designer/editor/Makefile
+  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/assistant/lib/Makefile
+  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/designer/uilib/Makefile
+
+  cd $startdir/src/$pkgfqn
+  make -C qmake || return 1
+  cd $startdir/src/$pkgfqn/plugins/src/sqldrivers/mysql
+  $startdir/src/$pkgfqn/bin/qmake -o Makefile "INCPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient" mysql.pro
+  cd $startdir/src/$pkgfqn/plugins/src/sqldrivers/psql
+  $startdir/src/$pkgfqn/bin/qmake -o Makefile "INCPATH+=/usr/src/include /usr/include/postgresql/server" "LIBS+=-L/usr/lib -lpq" psql.pro
+
+  cd $startdir/src/$pkgfqn
+  # fix the broken makefiles
+  #sed -i 's|[[:space:]]*strip.*doc/html.*$|#|g' src/Makefile
+  make || return 1
+  make INSTALL_ROOT=$startdir/pkg install
+  rm -rf `find $startdir/pkg/opt/qt/mkspecs/* | grep -v linux-g++$ARCH`
+  rm -rf $startdir/pkg/opt/qt/{phrasebooks,templates,translations}
+  sed -i "s|-L$startdir/src/$pkgfqn/lib ||g" $startdir/pkg/opt/qt/lib/*.prl
+  install -D -m755 qmake/qmake $startdir/pkg/opt/qt/bin/qmake
+  # disable the profile by default
+  install -D -m644 $startdir/qt.profile $startdir/pkg/etc/profile.d/qt3.sh
+  [ "$CARCH" = "x86_64" ] && sed -i "s|linux-g++|linux-g++-64|g" $startdir/pkg/etc/profile.d/qt3.sh
+
+  rm -f $startdir/pkg/opt/qt/mkspecs/linux-g++$ARCH/linux-g++$ARCH
+  # install man pages
+  mkdir -p $startdir/pkg/opt/qt/man
+  cp -r $startdir/src/$pkgfqn/doc/man/{man1,man3} $startdir/pkg/opt/qt/man/
+  #libtoolslay
+  find $startdir/pkg -name '*.la' -exec rm {} \;
+
+  # Arch64 fix
+  if [ "$CARCH" = "x86_64" ]; then
+    mkdir $startdir/pkg/opt/qt/mkspecs/linux-g++
+    cd  $startdir/pkg/opt/qt/mkspecs/linux-g++
+    ln -s -v ../linux-g++-64/* .
+  fi
+}
+
Index: extra/lib/qt3/mysql.patch
diff -u /dev/null extra/lib/qt3/mysql.patch:1.1
--- /dev/null	Sat Nov 10 10:03:17 2007
+++ extra/lib/qt3/mysql.patch	Sat Nov 10 10:03:17 2007
@@ -0,0 +1,47 @@
+--- src/sql/drivers/mysql/qsql_mysql.cpp
++++ src/sql/drivers/mysql/qsql_mysql.cpp
+@@ -37,7 +37,6 @@
+ #include "qsql_mysql.h"
+ #include <private/qsqlextension_p.h>
+ 
+-#include <qapplication.h>
+ #include <qdatetime.h>
+ #include <qvaluevector.h>
+ #include <qsqlrecord.h>
+@@ -341,14 +340,6 @@ int QMYSQLResult::numRowsAffected()
+ }
+ 
+ /////////////////////////////////////////////////////////
+-static void qServerEnd()
+-{
+-#ifndef Q_NO_MYSQL_EMBEDDED
+-# if MYSQL_VERSION_ID >= 40000
+-    mysql_server_end();
+-# endif // MYSQL_VERSION_ID
+-#endif // Q_NO_MYSQL_EMBEDDED
+-}
+ 
+ static void qServerInit()
+ {
+@@ -366,9 +357,7 @@ static void qServerInit()
+ 	qWarning( "QMYSQLDriver::qServerInit: unable to start server." );
+ #  endif
+     }
+-    qAddPostRoutine(qServerEnd);
+     init = TRUE;    
+-    
+ # endif // MYSQL_VERSION_ID
+ #endif // Q_NO_MYSQL_EMBEDDED
+ }
+@@ -411,6 +400,11 @@ QMYSQLDriver::~QMYSQLDriver()
+ 	QSqlOpenExtension *ext = qSqlOpenExtDict()->take( this );
+ 	delete ext;
+     }
++#ifndef Q_NO_MYSQL_EMBEDDED
++# if MYSQL_VERSION_ID > 40000
++    mysql_server_end();
++# endif
++#endif
+ }
+ 
+ bool QMYSQLDriver::hasFeature( DriverFeature f ) const
Index: extra/lib/qt3/qt-copy-kde-patches.tar.bz2
<<Binary file>>
Index: extra/lib/qt3/qt-font-default-subst.diff
diff -u /dev/null extra/lib/qt3/qt-font-default-subst.diff:1.1
--- /dev/null	Sat Nov 10 10:03:17 2007
+++ extra/lib/qt3/qt-font-default-subst.diff	Sat Nov 10 10:03:17 2007
@@ -0,0 +1,77 @@
+--- src/kernel/qfontdatabase_x11.cpp
++++ src/kernel/qfontdatabase_x11.cpp
+@@ -1589,15 +1589,6 @@ QFontEngine *loadEngine( QFont::Script s
+ 	    if (script == QFont::Latin)
+ 		// add Euro character
+ 		FcCharSetAddChar(cs, 0x20ac);
+-	    if (script == QFont::Han_SimplifiedChinese)
+-		FcCharSetAddChar(cs, 0x3400);
+-	    if (script == QFont::Han_TraditionalChinese){
+-		FcCharSetAddChar(cs, 0x3435);
+-		FcCharSetAddChar(cs, 0xE000);
+-		FcCharSetAddChar(cs, 0xF6B1);
+-	    }
+-	    if (script == QFont::MiscellaneousSymbols)
+-		FcCharSetAddChar(cs, 0x2714);
+ 	    FcPatternAddCharSet(pattern, FC_CHARSET, cs);
+ 	    FcCharSetDestroy(cs);
+ 	}
+@@ -1813,7 +1804,11 @@ static QFontEngine *loadFontConfigFont(c
+     FcPatternPrint(pattern);
+ #endif
+ 
++    // XftFontMatch calls the right ConfigSubstitute variants, but as we use
++    // FcFontMatch/Sort here we have to do it manually.
+     FcConfigSubstitute(0, pattern, FcMatchPattern);
++    XftDefaultSubstitute(QPaintDevice::x11AppDisplay(), QPaintDevice::x11AppScreen(), pattern);
++
+ //     qDebug("1: pattern contains:");
+ //     FcPatternPrint(pattern);
+ 
+@@ -1847,10 +1842,6 @@ static QFontEngine *loadFontConfigFont(c
+ 	    value.u.s = (const FcChar8 *)cs.data();
+ 	    FcPatternAddWeak(pattern, FC_FAMILY, value, FcTrue);
+ 	}
+-#ifdef FONT_MATCH_DEBUG
+-	printf("final pattern contains:\n");
+-	FcPatternPrint(pattern);
+-#endif
+     }
+ 
+     if (script != QFont::Unicode) {
+@@ -1860,19 +1851,15 @@ static QFontEngine *loadFontConfigFont(c
+         if (script == QFont::Latin)
+             // add Euro character
+             FcCharSetAddChar(cs, 0x20ac);
+-	if (script == QFont::Han_SimplifiedChinese)
+-	    FcCharSetAddChar(cs, 0x3400);
+-	if (script == QFont::Han_TraditionalChinese) {
+-	    FcCharSetAddChar(cs, 0x3435);
+-	    FcCharSetAddChar(cs, 0xE000);
+-	    FcCharSetAddChar(cs, 0xF6B1);
+-	}
+-	if (script == QFont::MiscellaneousSymbols)
+-	    FcCharSetAddChar(cs, 0x2714);
+         FcPatternAddCharSet(pattern, FC_CHARSET, cs);
+         FcCharSetDestroy(cs);
+     }
+ 
++#ifdef FONT_MATCH_DEBUG
++	printf("final pattern contains:\n");
++	FcPatternPrint(pattern);
++#endif
++
+     QFontEngine *fe = 0;
+ 
+     for( int jj = (FcGetVersion() >= 20392 ? 0 : 1); jj < 2; ++jj ) {
+--- src/kernel/qfontdatabase.cpp
++++ src/kernel/qfontdatabase.cpp
+@@ -554,7 +554,7 @@ static const unsigned short sample_chars
+     // GeometricSymbols,
+     { 0x2500, 0x0 },
+     // MiscellaneousSymbols,
+-    { 0x2640, 0x0 },
++    { 0x2640, 0x2714, 0x0 },
+     // EnclosedAndSquare,
+     { 0x2460, 0x0 },
+     // Braille,
Index: extra/lib/qt3/qt-patches.tar.bz2
<<Binary file>>
Index: extra/lib/qt3/qt.profile
diff -u /dev/null extra/lib/qt3/qt.profile:1.1
--- /dev/null	Sat Nov 10 10:03:17 2007
+++ extra/lib/qt3/qt.profile	Sat Nov 10 10:03:17 2007
@@ -0,0 +1,6 @@
+export QTDIR=/opt/qt
+export QT_XFT=true
+export QMAKESPEC=$QTDIR/mkspecs/linux-g++
+export PATH=$PATH:$QTDIR/bin
+export MANPATH=$MANPATH:$QTDIR/man
+export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig
Index: extra/lib/qt3/utf8-bug-qt3.diff
diff -u /dev/null extra/lib/qt3/utf8-bug-qt3.diff:1.1
--- /dev/null	Sat Nov 10 10:03:17 2007
+++ extra/lib/qt3/utf8-bug-qt3.diff	Sat Nov 10 10:03:17 2007
@@ -0,0 +1,101 @@
+--- src/codecs/qutfcodec.cpp
++++ src/codecs/qutfcodec.cpp
+@@ -154,6 +154,7 @@
+ 
+ class QUtf8Decoder : public QTextDecoder {
+     uint uc;
++    uint min_uc;
+     int need;
+     bool headerDone;
+ public:
+@@ -167,8 +168,9 @@
+ 	result.setLength( len ); // worst case
+ 	QChar *qch = (QChar *)result.unicode();
+ 	uchar ch;
++        int error = -1;
+ 	for (int i=0; i<len; i++) {
+-	    ch = *chars++;
++	    ch = chars[i];
+ 	    if (need) {
+ 		if ( (ch&0xc0) == 0x80 ) {
+ 		    uc = (uc << 6) | (ch & 0x3f);
+@@ -182,6 +184,8 @@
+ 			    *qch++ = QChar(high);
+ 			    *qch++ = QChar(low);
+ 			    headerDone = TRUE;
++			} else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) {
++                            *qch++ = QChar::replacement;
+ 			} else {
+ 			    if (headerDone || QChar(uc) != QChar::byteOrderMark)
+ 				*qch++ = uc;
+@@ -190,6 +194,7 @@
+ 		    }
+ 		} else {
+ 		    // error
++                    i = error;
+ 		    *qch++ = QChar::replacement;
+ 		    need = 0;
+ 		}
+@@ -200,12 +205,21 @@
+ 		} else if ((ch & 0xe0) == 0xc0) {
+ 		    uc = ch & 0x1f;
+ 		    need = 1;
++                    error = i;
++		    min_uc = 0x80;
+ 		} else if ((ch & 0xf0) == 0xe0) {
+ 		    uc = ch & 0x0f;
+ 		    need = 2;
++                    error = i;
++		    min_uc = 0x800;
+ 		} else if ((ch&0xf8) == 0xf0) {
+ 		    uc = ch & 0x07;
+ 		    need = 3;
++                    error = i;
++                    min_uc = 0x10000;
++                } else {
++                    // error
++                    *qch++ = QChar::replacement;
+ 		}
+ 	    }
+ 	}
+--- src/tools/qstring.cpp
++++ src/tools/qstring.cpp
+@@ -5805,6 +5805,7 @@
+     result.setLength( len ); // worst case
+     QChar *qch = (QChar *)result.unicode();
+     uint uc = 0;
++    uint min_uc = 0;
+     int need = 0;
+     int error = -1;
+     uchar ch;
+@@ -5822,6 +5823,12 @@
+ 			unsigned short low = uc%0x400 + 0xdc00;
+ 			*qch++ = QChar(high);
+ 			*qch++ = QChar(low);
++		    } else if (uc < min_uc || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) {
++			// overlong seqence, UTF16 surrogate or BOM
++                        i = error;
++                        qch = addOne(qch, result);
++                        *qch++ = QChar(0xdbff);
++                        *qch++ = QChar(0xde00+((uchar)utf8[i]));
+ 		    } else {
+ 			*qch++ = uc;
+ 		    }
+@@ -5844,14 +5851,17 @@
+ 		uc = ch & 0x1f;
+ 		need = 1;
+ 		error = i;
++		min_uc = 0x80;
+ 	    } else if ((ch & 0xf0) == 0xe0) {
+ 		uc = ch & 0x0f;
+ 		need = 2;
+ 		error = i;
++		min_uc = 0x800;
+ 	    } else if ((ch&0xf8) == 0xf0) {
+ 		uc = ch & 0x07;
+ 		need = 3;
+ 		error = i;
++		min_uc = 0x10000;
+ 	    } else {
+ 	        // Error
+                 qch = addOne(qch, result);




More information about the arch-commits mailing list