extra/qt3 to 3.3.8b-1

This commit is contained in:
Kevin Mihelich 2012-02-08 10:33:01 -05:00
parent 642da4263d
commit 1ff61dbc55
6 changed files with 98 additions and 332 deletions

View file

@ -1,4 +1,4 @@
# $Id: PKGBUILD 145340 2011-12-21 20:47:29Z andrea $
# $Id: PKGBUILD 149356 2012-02-07 05:40:02Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
@ -8,8 +8,9 @@
plugrel=1
pkgname=qt3
pkgver=3.3.8
pkgrel=22
pkgver=3.3.8b
pkgrel=1
epoch=1
pkgdesc="The QT3 gui toolkit"
arch=('i686' 'x86_64')
url="http://www.trolltech.com/products/qt/index.html"
@ -20,18 +21,14 @@ makedepends=('mysql' 'postgresql' 'unixodbc' 'sqlite3')
optdepends=('libmysqlclient' 'postgresql-libs' 'unixodbc')
options=('!libtool')
install=qt.install
source=(ftp://ftp.trolltech.com/qt/source/qt-x11-free-${pkgver}.tar.bz2
qt.profile qt3-png15.patch qt-copy-kde-patches.tar.bz2
qt-patches.tar.bz2 utf8-bug-qt3.diff qt-font-default-subst.diff
mysql.patch eastern_asian_languagues.diff qt-odbc.patch gcc-4.6.patch arm.patch)
sha1sums=('91b192cb8e80679607d24ae35d6e20ed68d149d7'
source=(ftp://ftp.trolltech.com/qt/source/qt-x11-free-${pkgver}.tar.gz
qt.profile qt3-png15.patch qt-copy-kde-patches.tar.bz2 qt-patches.tar.bz2
eastern_asian_languagues.diff qt-odbc.patch gcc-4.6.patch arm.patch)
sha1sums=('745def6250dc7f337dbb265e20bf38dcb41fd854'
'd2e257a9011208b2cb81b9cf47915b9a2f9dab83'
'3d19510c46016a1a211d97bf8f82b01498b1b33c'
'9cb2e5bec782069692ee337cfa171539d9d73753'
'33418e5b117458af23c72cdbffc0c339bc34bdc4'
'116afa0e737bdf27ea27f9b3653aeb56db9ec151'
'ca5ecb29c7f1c826d48703339a3371038e306bb7'
'd928ff55adb52c4bab2fb268df022651551cd70c'
'bb6aad81cce143c23ff7840b1d79f6b2007a0c04'
'40c7b8f06a21f809ddeb8b5560e9da63ccac6a17'
'1346320614f6f86fbeb10b9fbad721dea29f5b61'
'd9b83b8f6f9c8bd98d290dc1d0e9913a00b62c3f'
@ -49,18 +46,12 @@ build() {
cd "${srcdir}"/qt-x11-free-${pkgver}
# apply qt patches from kde.org
for i in ../qt-copy-kde-patches/*; do
patch -Np0 -i $i
patch -p0 -i $i
done
# apply other qt patches and one security fix from debian/gentoo
for i in ../qt-patches/*; do
patch -Np1 -i $i
patch -p1 -i $i
done
# fix utf8 bug
patch -p0 -i "${srcdir}"/utf8-bug-qt3.diff
# fix asia fonts
patch -p0 -i "${srcdir}"/qt-font-default-subst.diff
# fix segfaults on exit when using mysql DB driver
patch -p0 -i "${srcdir}"/mysql.patch
# fix CJK font/chars select error (FS#11245)
patch -p1 -i "${srcdir}"/eastern_asian_languagues.diff
# fix build problem against new unixODBC
@ -68,7 +59,7 @@ build() {
# fix build with gcc 4.6.0
patch -p1 -i "${srcdir}"/gcc-4.6.patch
patch -p0 -i "${srcdir}"/qt3-png15.patch
patch -p0 -i "${srcdir}"/qt3-png15.patch
# Arch Linux ARM patch
patch -p1 -i ${srcdir}/arm.patch

View file

@ -1,47 +0,0 @@
--- 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

View file

@ -1,77 +0,0 @@
--- 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,

View file

@ -4,16 +4,16 @@ $NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $
+++ src/kernel/qpngio.cpp
@@ -43,6 +43,7 @@
#include "qiodevice.h"
#include <png.h>
+#include <zlib.h>
#ifdef Q_OS_TEMP
@@ -123,9 +124,24 @@ void setup_qt( QImage& image, png_struct
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
0, 0, 0);
0, 0, 0);
+ png_colorp info_ptr_palette = NULL;
+ int info_ptr_num_palette = 0;
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) {
@ -30,44 +30,44 @@ $NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $
+
+
if ( color_type == PNG_COLOR_TYPE_GRAY ) {
// Black & White or 8-bit grayscale
// Black & White or 8-bit grayscale
- if ( bit_depth == 1 && info_ptr->channels == 1 ) {
+ if ( bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1 ) {
png_set_invert_mono( png_ptr );
png_read_update_info( png_ptr, info_ptr );
if (!image.create( width, height, 1, 2, QImage::BigEndian ))
png_set_invert_mono( png_ptr );
png_read_update_info( png_ptr, info_ptr );
if (!image.create( width, height, 1, 2, QImage::BigEndian ))
@@ -159,7 +175,7 @@ void setup_qt( QImage& image, png_struct
image.setColor( i, qRgba(c,c,c,0xff) );
}
if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
image.setColor( i, qRgba(c,c,c,0xff) );
}
if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
- const int g = info_ptr->trans_values.gray;
+ const int g = info_ptr_trans_color->gray;
if (g < ncols) {
image.setAlphaBuffer(TRUE);
image.setColor(g, image.color(g) & RGB_MASK);
if (g < ncols) {
image.setAlphaBuffer(TRUE);
image.setColor(g, image.color(g) & RGB_MASK);
@@ -168,7 +184,7 @@ void setup_qt( QImage& image, png_struct
}
}
} else if ( color_type == PNG_COLOR_TYPE_PALETTE
&& png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)
- && info_ptr->num_palette <= 256 )
+ && info_ptr_num_palette <= 256 )
{
// 1-bit and 8-bit color
if ( bit_depth != 1 )
// 1-bit and 8-bit color
if ( bit_depth != 1 )
@@ -176,28 +192,28 @@ void setup_qt( QImage& image, png_struct
png_read_update_info( png_ptr, info_ptr );
png_get_IHDR(png_ptr, info_ptr,
&width, &height, &bit_depth, &color_type, 0, 0, 0);
png_read_update_info( png_ptr, info_ptr );
png_get_IHDR(png_ptr, info_ptr,
&width, &height, &bit_depth, &color_type, 0, 0, 0);
- if (!image.create(width, height, bit_depth, info_ptr->num_palette,
+ if (!image.create(width, height, bit_depth, info_ptr_num_palette,
QImage::BigEndian))
return;
int i = 0;
if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
image.setAlphaBuffer( TRUE );
QImage::BigEndian))
return;
int i = 0;
if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
image.setAlphaBuffer( TRUE );
- while ( i < info_ptr->num_trans ) {
+ while ( i < info_ptr_num_trans ) {
image.setColor(i, qRgba(
image.setColor(i, qRgba(
- info_ptr->palette[i].red,
- info_ptr->palette[i].green,
- info_ptr->palette[i].blue,
@ -76,104 +76,104 @@ $NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $
+ info_ptr_palette[i].green,
+ info_ptr_palette[i].blue,
+ info_ptr_trans_alpha[i]
)
);
i++;
}
}
)
);
i++;
}
}
- while ( i < info_ptr->num_palette ) {
+ while ( i < info_ptr_num_palette ) {
image.setColor(i, qRgba(
image.setColor(i, qRgba(
- info_ptr->palette[i].red,
- info_ptr->palette[i].green,
- info_ptr->palette[i].blue,
+ info_ptr_palette[i].red,
+ info_ptr_palette[i].green,
+ info_ptr_palette[i].blue,
0xff
)
);
0xff
)
);
@@ -284,7 +300,7 @@ void read_png_image(QImageIO* iio)
return;
return;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
iio->setStatus(-4);
return;
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
iio->setStatus(-4);
return;
@@ -469,7 +485,7 @@ bool QPNGImageWriter::writeImage(const Q
return FALSE;
return FALSE;
}
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr, &info_ptr);
return FALSE;
png_destroy_write_struct(&png_ptr, &info_ptr);
return FALSE;
}
@@ -491,10 +507,16 @@ bool QPNGImageWriter::writeImage(const Q
png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn);
+#warning XXXtnn not too sure about this
+/*
+/*
+according to png.h, channels is only used on read, not writes, so we
+should be able to comment this out.
+
info_ptr->channels =
(image.depth() == 32)
? (image.hasAlphaBuffer() ? 4 : 3)
: 1;
(image.depth() == 32)
? (image.hasAlphaBuffer() ? 4 : 3)
: 1;
+*/
png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
image.depth() == 1 ? 1 : 8 /* per channel */,
image.depth() == 1 ? 1 : 8 /* per channel */,
@@ -504,11 +526,12 @@ bool QPNGImageWriter::writeImage(const Q
: PNG_COLOR_TYPE_RGB
: PNG_COLOR_TYPE_PALETTE, 0, 0, 0);
: PNG_COLOR_TYPE_RGB
: PNG_COLOR_TYPE_PALETTE, 0, 0, 0);
+ png_color_8 sig_bit;
+ sig_bit.red = 8;
+ sig_bit.green = 8;
+ sig_bit.blue = 8;
+ png_set_sBIT(png_ptr, info_ptr, &sig_bit);
- //png_set_sBIT(png_ptr, info_ptr, 8);
- info_ptr->sig_bit.red = 8;
- info_ptr->sig_bit.green = 8;
- info_ptr->sig_bit.blue = 8;
if (image.depth() == 1 && image.bitOrder() == QImage::LittleEndian)
png_set_packswap(png_ptr);
@@ -522,11 +545,14 @@ bool QPNGImageWriter::writeImage(const Q
png_set_PLTE(png_ptr, info_ptr, palette, num_palette);
int* trans = new int[num_palette];
int num_trans = 0;
png_set_PLTE(png_ptr, info_ptr, palette, num_palette);
int* trans = new int[num_palette];
int num_trans = 0;
+ png_colorp info_ptr_palette = NULL;
+ int tmp;
+ png_get_PLTE(png_ptr, info_ptr, &info_ptr_palette, &tmp);
for (int i=0; i<num_palette; i++) {
QRgb rgb=image.color(i);
for (int i=0; i<num_palette; i++) {
QRgb rgb=image.color(i);
- info_ptr->palette[i].red = qRed(rgb);
- info_ptr->palette[i].green = qGreen(rgb);
- info_ptr->palette[i].blue = qBlue(rgb);
+ info_ptr_palette[i].red = qRed(rgb);
+ info_ptr_palette[i].green = qGreen(rgb);
+ info_ptr_palette[i].blue = qBlue(rgb);
if (image.hasAlphaBuffer()) {
trans[i] = rgb >> 24;
if (trans[i] < 255) {
if (image.hasAlphaBuffer()) {
trans[i] = rgb >> 24;
if (trans[i] < 255) {
@@ -534,6 +560,7 @@ bool QPNGImageWriter::writeImage(const Q
}
}
}
}
}
}
+ png_set_PLTE(png_ptr, info_ptr, info_ptr_palette, num_palette);
if (num_trans) {
copy_trans = new png_byte[num_trans];
for (int i=0; i<num_trans; i++)
if (num_trans) {
copy_trans = new png_byte[num_trans];
for (int i=0; i<num_trans; i++)
@@ -544,7 +571,10 @@ bool QPNGImageWriter::writeImage(const Q
}
if ( image.hasAlphaBuffer() ) {
- info_ptr->sig_bit.alpha = 8;
+ png_color_8p sig_bit;
@ -181,26 +181,26 @@ $NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $
+ sig_bit->alpha = 8;
+ png_set_sBIT(png_ptr, info_ptr, sig_bit);
}
// Swap ARGB to RGBA (normal PNG format) before saving on
@@ -1030,7 +1060,7 @@ int QPNGFormat::decode(QImage& img, QIma
return -1;
}
return -1;
}
- if (setjmp((png_ptr)->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, 0);
image = 0;
return -1;
png_destroy_read_struct(&png_ptr, &info_ptr, 0);
image = 0;
return -1;
@@ -1057,7 +1087,7 @@ int QPNGFormat::decode(QImage& img, QIma
if ( !png_ptr ) return 0;
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_read_struct(&png_ptr, &info_ptr, 0);
image = 0;
state = MovieStart;
png_destroy_read_struct(&png_ptr, &info_ptr, 0);
image = 0;
state = MovieStart;
@@ -1117,7 +1147,7 @@ void QPNGFormat::end(png_structp png, pn
consumer->frameDone(QPoint(offx,offy),r);
consumer->end();
@ -208,5 +208,5 @@ $NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $
- unused_data = (int)png->buffer_size; // Since libpng doesn't tell us
+ unused_data = png_process_data_pause(png, 0);
}
#ifdef PNG_USER_CHUNKS_SUPPORTED

View file

@ -1,101 +0,0 @@
--- 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);