[qt3] * Fri Nov 04 2011 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.3.8b-37 - fix aliasing issue in qlocale.

Kevin Kofler kkofler at fedoraproject.org
Fri Nov 4 01:58:29 UTC 2011


commit 9c4ff313af8cb2fa0e515cdcf10d6f1dd5dd43e3
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date:   Fri Nov 4 02:58:19 2011 +0100

    * Fri Nov 04 2011 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.3.8b-37
    - fix aliasing issue in qlocale.cpp
    - build against the system sqlite2-devel (patch from Debian)
    - BuildRequires: sqlite2-devel instead of unused sqlite-devel (SQLite 3)
    - silence compiler warning in qimage.h by adding parentheses

 qt-x11-free-3.3.8b-qimage-parentheses.patch |   24 +++++
 qt-x11-free-3.3.8b-qlocale-aliasing.patch   |   53 ++++++++++
 qt-x11-free-3.3.8b-system-sqlite2.patch     |  141 +++++++++++++++++++++++++++
 qt3.spec                                    |   28 +++++-
 4 files changed, 241 insertions(+), 5 deletions(-)
---
diff --git a/qt-x11-free-3.3.8b-qimage-parentheses.patch b/qt-x11-free-3.3.8b-qimage-parentheses.patch
new file mode 100644
index 0000000..c4e52ae
--- /dev/null
+++ b/qt-x11-free-3.3.8b-qimage-parentheses.patch
@@ -0,0 +1,24 @@
+diff -ur qt-x11-free-3.3.8b/include/qimage.h qt-x11-free-3.3.8b-qimage-parentheses/include/qimage.h
+--- qt-x11-free-3.3.8b/include/qimage.h	2008-01-15 20:09:13.000000000 +0100
++++ qt-x11-free-3.3.8b-qimage-parentheses/include/qimage.h	2011-11-04 02:49:22.000000000 +0100
+@@ -58,7 +58,7 @@
+     QCString lang;
+ 
+     bool operator< (const QImageTextKeyLang& other) const
+-	{ return key < other.key || key==other.key && lang < other.lang; }
++	{ return key < other.key || (key==other.key && lang < other.lang); }
+     bool operator== (const QImageTextKeyLang& other) const
+ 	{ return key==other.key && lang==other.lang; }
+ };
+diff -ur qt-x11-free-3.3.8b/src/kernel/qimage.h qt-x11-free-3.3.8b-qimage-parentheses/src/kernel/qimage.h
+--- qt-x11-free-3.3.8b/src/kernel/qimage.h	2008-01-15 20:09:13.000000000 +0100
++++ qt-x11-free-3.3.8b-qimage-parentheses/src/kernel/qimage.h	2011-11-04 02:49:22.000000000 +0100
+@@ -58,7 +58,7 @@
+     QCString lang;
+ 
+     bool operator< (const QImageTextKeyLang& other) const
+-	{ return key < other.key || key==other.key && lang < other.lang; }
++	{ return key < other.key || (key==other.key && lang < other.lang); }
+     bool operator== (const QImageTextKeyLang& other) const
+ 	{ return key==other.key && lang==other.lang; }
+ };
diff --git a/qt-x11-free-3.3.8b-qlocale-aliasing.patch b/qt-x11-free-3.3.8b-qlocale-aliasing.patch
new file mode 100644
index 0000000..45697bc
--- /dev/null
+++ b/qt-x11-free-3.3.8b-qlocale-aliasing.patch
@@ -0,0 +1,53 @@
+diff -ur qt-x11-free-3.3.8b/src/tools/qlocale.cpp qt-x11-free-3.3.8b-qlocale-aliasing/src/tools/qlocale.cpp
+--- qt-x11-free-3.3.8b/src/tools/qlocale.cpp	2008-01-15 20:09:13.000000000 +0100
++++ qt-x11-free-3.3.8b-qlocale-aliasing/src/tools/qlocale.cpp	2011-11-04 02:38:59.000000000 +0100
+@@ -101,37 +101,37 @@
+ #endif
+ 
+ #if !defined(INFINITY)
+-static const unsigned char be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
+-static const unsigned char le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
++static const union { unsigned char c[8]; double d; } be_inf_bytes = {{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }};
++static const union { unsigned char c[8]; double d; } le_inf_bytes = {{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }};
+ static inline double inf()
+ {
+     return (ByteOrder == BigEndian ?
+-            *((const double *) be_inf_bytes) :
+-            *((const double *) le_inf_bytes));
++            be_inf_bytes.d :
++            le_inf_bytes.d);
+ }
+ #   define INFINITY (::inf())
+ #endif
+ 
+ #if !defined(NAN)
+-static const unsigned char be_nan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
+-static const unsigned char le_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
++static const union { unsigned char c[8]; double d; } be_nan_bytes = {{ 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }};
++static const union { unsigned char c[8]; double d; } le_nan_bytes = {{ 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }};
+ static inline double nan()
+ {
+     return (ByteOrder == BigEndian ?
+-            *((const double *) be_nan_bytes) :
+-            *((const double *) le_nan_bytes));
++            be_nan_bytes.d :
++            le_nan_bytes.d);
+ }
+ #   define NAN (::nan())
+ #endif
+ 
+ // We can't rely on -NAN, since all operations on a NAN should return a NAN.
+-static const unsigned char be_neg_nan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
+-static const unsigned char le_neg_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
++static const union { unsigned char c[8]; double d; } be_neg_nan_bytes = {{ 0xff, 0xf8, 0, 0, 0, 0, 0, 0 }};
++static const union { unsigned char c[8]; double d; } le_neg_nan_bytes = {{ 0, 0, 0, 0, 0, 0, 0xf8, 0xff }};
+ static inline double negNan()
+ {
+     return (ByteOrder == BigEndian ?
+-            *((const double *) be_neg_nan_bytes) :
+-            *((const double *) le_neg_nan_bytes));
++            be_neg_nan_bytes.d :
++            le_neg_nan_bytes.d);
+ }
+ 
+ // Sizes as defined by the ISO C99 standard - fallback
diff --git a/qt-x11-free-3.3.8b-system-sqlite2.patch b/qt-x11-free-3.3.8b-system-sqlite2.patch
new file mode 100644
index 0000000..0337bc7
--- /dev/null
+++ b/qt-x11-free-3.3.8b-system-sqlite2.patch
@@ -0,0 +1,141 @@
+Use sqlite system library on unix.
+
+---
+ configure                                |    5 -
+ plugins/src/sqldrivers/sqlite/sqlite.pro |   95 +++++++++++++++----------------
+ 2 files changed, 51 insertions(+), 49 deletions(-)
+
+--- a/configure
++++ b/configure
+@@ -1683,6 +1683,7 @@
+     TDS_REQ="-lsybdb sybfront.h sybdb.h"
+     DB2_REQ="-ldb2 sqlcli.h sqlcli1.h"
+     IBASE_REQ="-lfbclient ibase.h"
++    SQLITE_REQ="-lsqlite sqlite.h"
+     for _SQLDR in $CFG_SQL_AVAILABLE; do
+ 	case $_SQLDR in
+ 	mysql)
+@@ -1707,9 +1708,7 @@
+ 	    $unixtests/checkavail "IBASE" $OPT_VERBOSE $IBASE_REQ $L_FLAGS $I_FLAGS && CFG_SQL_AUTODETECTED="$CFG_SQL_AUTODETECTED ibase"
+ 	    ;;
+ 	sqlite)
+-	    if [ -f $relpath/src/3rdparty/sqlite/sqlite.h ]; then
+-		CFG_SQL_AUTODETECTED="$CFG_SQL_AUTODETECTED sqlite"
+-	    fi
++	    $unixtests/checkavail "SQLite" $OPT_VERBOSE $SQLITE_REQ $L_FLAGS $I_FLAGS && CFG_SQL_AUTODETECTED="$CFG_SQL_AUTODETECTED sqlite"
+ 	    ;;
+ 	*)
+ 	    if [ "$OPT_VERBOSE" = "yes" ]; then
+--- a/plugins/src/sqldrivers/sqlite/sqlite.pro
++++ b/plugins/src/sqldrivers/sqlite/sqlite.pro
+@@ -10,6 +10,9 @@
+ 
+ unix {
+ 	OBJECTS_DIR = .obj
++	!contains( LIBS, .*sqlite.* ) {
++	    LIBS	*= -lsqlite
++	}
+ }
+ 
+ win32 {
+@@ -21,54 +24,54 @@
+ #	win32-borland: {
+ #		QMAKE_LFLAGS += /dlibsqlite.dll
+ #	}
+-}
+-
+-!contains( LIBS, .*sqlite.* ) {
+-    INCLUDEPATH += ../../../../src/3rdparty/sqlite
+ 
+-    HEADERS += ../../../../src/3rdparty/sqlite/btree.h \
+-               ../../../../src/3rdparty/sqlite/config.h \
+-               ../../../../src/3rdparty/sqlite/hash.h \
+-               ../../../../src/3rdparty/sqlite/opcodes.h \
+-               ../../../../src/3rdparty/sqlite/os.h \
+-               ../../../../src/3rdparty/sqlite/pager.h \
+-               ../../../../src/3rdparty/sqlite/parse.h \
+-               ../../../../src/3rdparty/sqlite/sqlite.h \
+-               ../../../../src/3rdparty/sqlite/sqliteInt.h \
+-               ../../../../src/3rdparty/sqlite/vdbe.h \
+-	       ../../../../src/3rdparty/sqlite/vdbeInt.h
++	!contains( LIBS, .*sqlite.* ) {
++		INCLUDEPATH += ../../../../src/3rdparty/sqlite
+ 
+-    SOURCES += ../../../../src/3rdparty/sqlite/attach.c \
+-               ../../../../src/3rdparty/sqlite/auth.c \
+-               ../../../../src/3rdparty/sqlite/btree.c \
+-               ../../../../src/3rdparty/sqlite/btree_rb.c \
+-               ../../../../src/3rdparty/sqlite/build.c \
+-               ../../../../src/3rdparty/sqlite/copy.c \
+-	       ../../../../src/3rdparty/sqlite/date.c \
+-               ../../../../src/3rdparty/sqlite/delete.c \
+-               ../../../../src/3rdparty/sqlite/expr.c \
+-               ../../../../src/3rdparty/sqlite/func.c \
+-               ../../../../src/3rdparty/sqlite/hash.c \
+-               ../../../../src/3rdparty/sqlite/insert.c \
+-               ../../../../src/3rdparty/sqlite/main.c \
+-               ../../../../src/3rdparty/sqlite/opcodes.c \
+-               ../../../../src/3rdparty/sqlite/os.c \
+-               ../../../../src/3rdparty/sqlite/pager.c \
+-               ../../../../src/3rdparty/sqlite/parse.c \
+-               ../../../../src/3rdparty/sqlite/pragma.c \
+-               ../../../../src/3rdparty/sqlite/printf.c \
+-               ../../../../src/3rdparty/sqlite/random.c \
+-               ../../../../src/3rdparty/sqlite/select.c \
+-               ../../../../src/3rdparty/sqlite/shell.c \
+-               ../../../../src/3rdparty/sqlite/table.c \
+-               ../../../../src/3rdparty/sqlite/tokenize.c \
+-               ../../../../src/3rdparty/sqlite/trigger.c \
+-               ../../../../src/3rdparty/sqlite/update.c \
+-               ../../../../src/3rdparty/sqlite/util.c \
+-               ../../../../src/3rdparty/sqlite/vacuum.c \
+-               ../../../../src/3rdparty/sqlite/vdbe.c \
+-	       ../../../../src/3rdparty/sqlite/vdbeaux.c \
+-               ../../../../src/3rdparty/sqlite/where.c
++		HEADERS += ../../../../src/3rdparty/sqlite/btree.h \
++		           ../../../../src/3rdparty/sqlite/config.h \
++		           ../../../../src/3rdparty/sqlite/hash.h \
++		           ../../../../src/3rdparty/sqlite/opcodes.h \
++		           ../../../../src/3rdparty/sqlite/os.h \
++		           ../../../../src/3rdparty/sqlite/pager.h \
++		           ../../../../src/3rdparty/sqlite/parse.h \
++		           ../../../../src/3rdparty/sqlite/sqlite.h \
++		           ../../../../src/3rdparty/sqlite/sqliteInt.h \
++		           ../../../../src/3rdparty/sqlite/vdbe.h \
++		           ../../../../src/3rdparty/sqlite/vdbeInt.h
++
++		SOURCES += ../../../../src/3rdparty/sqlite/attach.c \
++		           ../../../../src/3rdparty/sqlite/auth.c \
++		           ../../../../src/3rdparty/sqlite/btree.c \
++		           ../../../../src/3rdparty/sqlite/btree_rb.c \
++		           ../../../../src/3rdparty/sqlite/build.c \
++		           ../../../../src/3rdparty/sqlite/copy.c \
++		           ../../../../src/3rdparty/sqlite/date.c \
++		           ../../../../src/3rdparty/sqlite/delete.c \
++		           ../../../../src/3rdparty/sqlite/expr.c \
++		           ../../../../src/3rdparty/sqlite/func.c \
++		           ../../../../src/3rdparty/sqlite/hash.c \
++		           ../../../../src/3rdparty/sqlite/insert.c \
++		           ../../../../src/3rdparty/sqlite/main.c \
++		           ../../../../src/3rdparty/sqlite/opcodes.c \
++		           ../../../../src/3rdparty/sqlite/os.c \
++		           ../../../../src/3rdparty/sqlite/pager.c \
++		           ../../../../src/3rdparty/sqlite/parse.c \
++		           ../../../../src/3rdparty/sqlite/pragma.c \
++		           ../../../../src/3rdparty/sqlite/printf.c \
++		           ../../../../src/3rdparty/sqlite/random.c \
++		           ../../../../src/3rdparty/sqlite/select.c \
++		           ../../../../src/3rdparty/sqlite/shell.c \
++		           ../../../../src/3rdparty/sqlite/table.c \
++		           ../../../../src/3rdparty/sqlite/tokenize.c \
++		           ../../../../src/3rdparty/sqlite/trigger.c \
++		           ../../../../src/3rdparty/sqlite/update.c \
++		           ../../../../src/3rdparty/sqlite/util.c \
++		           ../../../../src/3rdparty/sqlite/vacuum.c \
++		           ../../../../src/3rdparty/sqlite/vdbe.c \
++		           ../../../../src/3rdparty/sqlite/vdbeaux.c \
++		           ../../../../src/3rdparty/sqlite/where.c
++	}
+ }
+ 
+ REQUIRES	= sql
diff --git a/qt3.spec b/qt3.spec
index 8bb4c81..153c3d2 100644
--- a/qt3.spec
+++ b/qt3.spec
@@ -3,7 +3,7 @@
 Summary: The shared library for the Qt 3 GUI toolkit
 Version: 3.3.8b
 Name: qt3
-Release: 36%{?dist}.1
+Release: 37%{?dist}
 License: QPL or GPLv2 or GPLv3
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -44,10 +44,16 @@ Patch39: qt-x11-free-3.3.7-arm.patch
 # Try to set some sane defaults, for style, fonts, plugin path
 # FIXME: style doesn't work.  use kde3 plastik, if available
 Patch40: qt-x11-free-3.3.8b-sane_defaults.patch
-# add missing #include <cstdef> to make gcc-4.6 happier
-Patch41: qt-x11-free-3.3.8b-cstddef.patch
 # and/or just use qtrc to do the same thing
 Source10: qtrc
+# add missing #include <cstdef> to make gcc-4.6 happier
+Patch41: qt-x11-free-3.3.8b-cstddef.patch
+# fix aliasing issue in qlocale.cpp
+Patch42: qt-x11-free-3.3.8b-qlocale-aliasing.patch
+# use the system SQLite 2 (Debian's 91_system_sqlite.diff)
+Patch43: qt-x11-free-3.3.8b-system-sqlite2.patch
+# silence compiler warning in qimage.h by adding parentheses
+Patch44: qt-x11-free-3.3.8b-qimage-parentheses.patch
 
 # immodule patches
 Patch50: qt-x11-immodule-unified-qt3.3.8-20071116.diff.bz2
@@ -60,7 +66,7 @@ Patch100: 0038-dragobject-dont-prefer-unknown.patch
 Patch101: 0047-fix-kmenu-width.diff
 Patch102: 0048-qclipboard_hack_80072.patch
 Patch103: 0056-khotkeys_input_84434.patch
-patch105: 0073-xinerama-aware-qpopup.patch
+Patch105: 0073-xinerama-aware-qpopup.patch
 Patch107: 0079-compositing-types.patch
 Patch108: 0080-net-wm-sync-request-2.patch
 Patch110: 0084-compositing-properties.patch
@@ -130,7 +136,7 @@ BuildRequires: desktop-file-utils
 BuildRequires: mysql-devel
 BuildRequires: postgresql-devel
 BuildRequires: unixODBC-devel
-BuildRequires: sqlite-devel
+BuildRequires: sqlite2-devel
 
 
 %package config
@@ -284,6 +290,9 @@ sed -i.KDE3_PLUGIN_PATH \
   -e "s|@@KDE3_PLUGIN_PATH@@|%{_libdir}/kde3/plugins|" \
   src/kernel/qapplication.cpp
 %patch41 -p1 -b .cstddef
+%patch42 -p1 -b .qlocale-aliasing
+%patch43 -p1 -b .system-sqlite2
+%patch44 -p1 -b .qimage-parentheses
 
 # immodule patches
 %if %{immodule}
@@ -311,6 +320,9 @@ sed -i.KDE3_PLUGIN_PATH \
 iconv -f iso-8859-1 -t utf-8 < doc/man/man3/qdial.3qt > doc/man/man3/qdial.3qt_
 mv doc/man/man3/qdial.3qt_ doc/man/man3/qdial.3qt
 
+# get rid of bundled libraries to ensure they won't be used
+rm -rf src/3rdparty/{lib*,sqlite,zlib}
+
 %build
 export QTDIR=`/bin/pwd`
 export LD_LIBRARY_PATH="$QTDIR/lib:$LD_LIBRARY_PATH"
@@ -590,6 +602,12 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Fri Nov 04 2011 Kevin Kofler <Kevin at tigcc.ticalc.org> - 3.3.8b-37
+- fix aliasing issue in qlocale.cpp
+- build against the system sqlite2-devel (patch from Debian)
+- BuildRequires: sqlite2-devel instead of unused sqlite-devel (SQLite 3)
+- silence compiler warning in qimage.h by adding parentheses
+
 * Sun Aug 14 2011 Rex Dieter <rdieter at fedoraproject.org> - 3.3.8b-36.1
 - Rebuilt for rpm (#728707)
 


More information about the scm-commits mailing list