From d7aaf31869621480977d0a8f2faee199b83fd699 Mon Sep 17 00:00:00 2001
From: Richard Purdie <rpurdie@linux.intel.com>
Date: Mon, 1 Dec 2008 20:55:25 +0000
Subject: meta-moblin: Add basic qt support (from OE)

---
 .../uicmoc3-native-3.3.5/64bit-cleanup.patch       | 160 +++++++++++++++++++++
 .../uicmoc/uicmoc3-native-3.3.5/no-examples.patch  |  16 +++
 .../packages/uicmoc/uicmoc3-native_3.3.5.bb        |  51 +++++++
 meta-moblin/packages/uicmoc/uicmoc4-native.inc     |  62 ++++++++
 .../packages/uicmoc/uicmoc4-native_4.3.2.bb        |   1 +
 5 files changed, 290 insertions(+)
 create mode 100644 meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/64bit-cleanup.patch
 create mode 100644 meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/no-examples.patch
 create mode 100644 meta-moblin/packages/uicmoc/uicmoc3-native_3.3.5.bb
 create mode 100644 meta-moblin/packages/uicmoc/uicmoc4-native.inc
 create mode 100644 meta-moblin/packages/uicmoc/uicmoc4-native_4.3.2.bb

(limited to 'meta-moblin/packages/uicmoc')

diff --git a/meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/64bit-cleanup.patch b/meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/64bit-cleanup.patch
new file mode 100644
index 000000000..0e5d3ff15
--- /dev/null
+++ b/meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/64bit-cleanup.patch
@@ -0,0 +1,160 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- qt-embedded-free-3.3.5/src/embedded/qgfxlinuxfb_qws.cpp~64bit-cleanup.patch
++++ qt-embedded-free-3.3.5/src/embedded/qgfxlinuxfb_qws.cpp
+@@ -40,6 +40,7 @@
+ 
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+@@ -176,7 +177,7 @@
+ 				 MAP_SHARED, fd, 0);
+     data += dataoffset;
+ 
+-    if ((int)data == -1) {
++    if ((intptr_t)data == -1) {
+ 	perror("mapping /dev/fb0");
+ 	qWarning("Error: failed to map framebuffer device to memory.");
+ 	return FALSE;
+@@ -737,7 +738,7 @@
+     psize += 8;     // for alignment
+     psize &= ~0x7;  // align
+ 
+-    unsigned int pos=(unsigned int)data;
++    uintptr_t pos=(uintptr_t)data;
+     pos += psize;
+     entryp = ((int *)pos);
+     lowest = ((unsigned int *)pos)+1;
+--- qt-embedded-free-3.3.5/src/kernel/qsharedmemory_p.cpp~64bit-cleanup.patch
++++ qt-embedded-free-3.3.5/src/kernel/qsharedmemory_p.cpp
+@@ -31,6 +31,7 @@
+ **********************************************************************/
+ 
+ #include "qsharedmemory_p.h"
++#include <stdint.h>
+ 
+ #if !defined(QT_QWS_NO_SHM)
+ 
+@@ -132,7 +133,7 @@
+     shmId = shmget (key, shmSize, 0);
+ 
+   shmBase = shmat (shmId, 0, 0);
+-  if ((int) shmBase == -1 || shmBase == 0)
++  if ((intptr_t) shmBase == -1 || shmBase == 0)
+     return FALSE;
+   else
+     return TRUE;
+--- qt-embedded-free-3.3.5/src/kernel/qapplication_qws.cpp~64bit-cleanup.patch
++++ qt-embedded-free-3.3.5/src/kernel/qapplication_qws.cpp
+@@ -107,6 +107,7 @@
+ #include <locale.h>
+ #include <errno.h>
+ #include <sys/time.h>
++#include <stdint.h>
+ 
+ #if defined(Q_OS_QNX)
+ #include <sys/select.h>
+@@ -1879,7 +1880,7 @@
+ 	w = widgetAt(*qt_last_x, *qt_last_y, FALSE);
+     if ( !w )
+ 	w = desktop();
+-    QPaintDevice::qwsDisplay()->selectCursor(w, (int)app_cursor->handle());
++    QPaintDevice::qwsDisplay()->selectCursor(w, (intptr_t)app_cursor->handle());
+ }
+ 
+ void QApplication::restoreOverrideCursor()
+@@ -1898,11 +1899,11 @@
+ 	cursorStack = 0;
+ 	qws_overrideCursor = FALSE;
+ 	if ( w->testWState(WState_OwnCursor) )
+-	    QPaintDevice::qwsDisplay()->selectCursor(w, (int)w->cursor().handle());
++	    QPaintDevice::qwsDisplay()->selectCursor(w, (intptr_t)w->cursor().handle());
+ 	else
+ 	    QPaintDevice::qwsDisplay()->selectCursor(w, ArrowCursor);
+     } else {
+-	QPaintDevice::qwsDisplay()->selectCursor(w, (int)app_cursor->handle());
++	QPaintDevice::qwsDisplay()->selectCursor(w, (intptr_t)app_cursor->handle());
+     }
+ }
+ #endif// QT_NO_CURSOR
+@@ -2130,7 +2131,7 @@
+ 		    }
+ 		    if ( !qws_overrideCursor ) {
+ 			if (curs)
+-			    QPaintDevice::qwsDisplay()->selectCursor(widget, (int)curs->handle());
++			    QPaintDevice::qwsDisplay()->selectCursor(widget, (intptr_t)curs->handle());
+ 			else
+ 			    QPaintDevice::qwsDisplay()->selectCursor(widget, ArrowCursor);
+ 		    }
+--- qt-embedded-free-3.3.5/src/kernel/qfont_qws.cpp~64bit-cleanup.patch
++++ qt-embedded-free-3.3.5/src/kernel/qfont_qws.cpp
+@@ -49,6 +49,7 @@
+ #include "qgfx_qws.h"
+ #include "qtextengine_p.h"
+ #include "qfontengine_p.h"
++#include <stdint.h>
+ 
+ QFont::Script QFontPrivate::defaultScript = QFont::UnknownScript;
+ 
+@@ -133,7 +134,7 @@
+ 	req.pointSize = req.pixelSize*10;
+ 
+     if ( ! engineData ) {
+-	QFontCache::Key key( req, QFont::NoScript, (int)paintdevice );
++	QFontCache::Key key( req, QFont::NoScript, (intptr_t)paintdevice );
+ 
+ 	// look for the requested font in the engine data cache
+ 	engineData = QFontCache::instance->findEngineData( key );
+--- qt-embedded-free-3.3.5/src/kernel/qwsregionmanager_qws.cpp~64bit-cleanup.patch
++++ qt-embedded-free-3.3.5/src/kernel/qwsregionmanager_qws.cpp
+@@ -32,6 +32,7 @@
+ #include "qwsdisplay_qws.h"
+ #include "qwsregionmanager_qws.h"
+ #include <stdlib.h>
++#include <stdint.h>
+ 
+ #ifndef QT_NO_QWS_MULTIPROCESS
+ #include <sys/types.h>
+@@ -288,7 +289,7 @@
+ 	    data = (unsigned char *)shmat( shmId, 0, 0 );
+     }
+ 
+-    return ( shmId != -1 && (int)data != -1 );
++    return ( shmId != -1 && (intptr_t)data != -1 );
+ #else
+ 	int dataSize = sizeof(QWSRegionHeader)                // header
+ 		    + sizeof(QWSRegionIndex) * QT_MAX_REGIONS // + index
+--- qt-embedded-free-3.3.5/src/kernel/qwidget_qws.cpp~64bit-cleanup.patch
++++ qt-embedded-free-3.3.5/src/kernel/qwidget_qws.cpp
+@@ -53,6 +53,7 @@
+ #include "qwsmanager_qws.h"
+ #include "qwsregionmanager_qws.h"
+ #include "qinputcontext_p.h"
++#include <stdint.h>
+ 
+ void qt_insert_sip( QWidget*, int, int );	// defined in qapplication_x11.cpp
+ int  qt_sip_count( QWidget* );			// --- "" ---
+@@ -631,7 +632,7 @@
+ 	qt_mouseGrb->releaseMouse();
+ 
+     qwsDisplay()->grabMouse(this,TRUE);
+-    qwsDisplay()->selectCursor(this, (unsigned int)cursor.handle());
++    qwsDisplay()->selectCursor(this, (uintptr_t)cursor.handle());
+     qt_mouseGrb = this;
+     qt_pressGrab = 0;
+ }
+@@ -1845,7 +1846,7 @@
+ 	QSize s( qt_screen->width(), qt_screen->height() );
+ 	QPoint pos = qt_screen->mapToDevice(QPoint(*qt_last_x, *qt_last_y), s);
+ 	if ( r.contains(pos) )
+-	    qwsDisplay()->selectCursor((QWidget*)this, (unsigned int)cursor().handle());
++	    qwsDisplay()->selectCursor((QWidget*)this, (uintptr_t)cursor().handle());
+     }
+ }
+ #endif
diff --git a/meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/no-examples.patch b/meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/no-examples.patch
new file mode 100644
index 000000000..b0ee6374e
--- /dev/null
+++ b/meta-moblin/packages/uicmoc/uicmoc3-native-3.3.5/no-examples.patch
@@ -0,0 +1,16 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- qt-embedded-free-3.3.2/Makefile~no-examples	2003-08-11 16:37:25.000000000 +0200
++++ qt-embedded-free-3.3.2/Makefile	2004-05-11 15:53:53.000000000 +0200
+@@ -11,7 +11,7 @@
+ install: FORCE
+ 	@$(MAKE) qt.install
+ 
+-all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples
++all: symlinks src-qmake src-moc sub-src sub-tools
+ 	@echo
+ 	@echo "The Qt library is now built in ./lib"
+ 	@echo "The Qt examples are built in the directories in ./examples"
diff --git a/meta-moblin/packages/uicmoc/uicmoc3-native_3.3.5.bb b/meta-moblin/packages/uicmoc/uicmoc3-native_3.3.5.bb
new file mode 100644
index 000000000..11b0c506d
--- /dev/null
+++ b/meta-moblin/packages/uicmoc/uicmoc3-native_3.3.5.bb
@@ -0,0 +1,51 @@
+DESCRIPTION = "User Interface Generator and Meta Object Compiler (moc) for Qt(E) 3.x"
+HOMEPAGE = "http://www.trolltech.com"
+SECTION = "devel"
+PRIORITY = "optional"
+LICENSE = "GPL QPL"
+DEPENDS = "qmake-native"
+PR = "r3"
+
+SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-embedded-free-${PV}.tar.bz2 \
+           file://no-examples.patch;patch=1 \
+           file://64bit-cleanup.patch;patch=1"
+S = "${WORKDIR}/qt-embedded-free-${PV}"
+
+inherit native qmake_base qt3e
+
+export QTDIR = "${S}"
+export OE_QMAKE_LINK="${CXX}"
+CXXFLAGS += " -DQWS"
+
+QT_CONFIG_FLAGS = "-release -static -depths 8,16 -qt-zlib -no-nas-sound \
+                   -no-sm -no-libjpeg -no-libmng -no-gif -no-xshape -no-xinerama \
+                   -no-xcursor -no-xrandr -no-xrender -no-xft -no-tablet \
+                   -no-xkb -no-dlopen-opengl -no-freetype -no-thread \
+                   -no-nis -no-cups -prefix ${prefix} \
+                   -xplatform ${OE_QMAKE_PLATFORM} \
+                   -platform ${OE_QMAKE_PLATFORM}"
+
+do_configure() {
+    oe_qmake_mkspecs
+    echo "yes" | ./configure ${QT_CONFIG_FLAGS}
+}
+
+do_compile() {
+    oe_runmake symlinks  || die "Can't symlink include files"
+    oe_runmake src-moc   || die "Building moc failed"
+    oe_runmake sub-tools || die "Building tools failed"
+}
+
+do_stage() {
+	install -d ${OE_QMAKE_INCDIR_QT}
+	install -d ${OE_QMAKE_LIBDIR_QT}
+
+	install -m 0755 bin/moc ${OE_QMAKE_MOC}
+	install -m 0755 bin/uic ${OE_QMAKE_UIC}
+	install -m 0655 lib/*.a ${OE_QMAKE_LIBDIR_QT}
+
+	for f in include/*.h
+	do
+		install -m 0644 $f ${OE_QMAKE_INCDIR_QT}/
+	done
+}
diff --git a/meta-moblin/packages/uicmoc/uicmoc4-native.inc b/meta-moblin/packages/uicmoc/uicmoc4-native.inc
new file mode 100644
index 000000000..8c4787866
--- /dev/null
+++ b/meta-moblin/packages/uicmoc/uicmoc4-native.inc
@@ -0,0 +1,62 @@
+DESCRIPTION = "User-Interface-, Meta-Object-, and Resource Compiler for Qt/[X11|Mac|Embedded] version 4.x"
+DEPENDS = "zlib-native"
+SECTION = "libs"
+HOMEPAGE = "http://www.trolltech.com"
+PRIORITY = "optional"
+LICENSE = "GPL"
+PR = "r1"
+
+SRC_URI = "ftp://ftp.trolltech.com/qt/source/qtopia-core-opensource-src-${PV}.tar.gz"
+S = "${WORKDIR}/qtopia-core-opensource-src-${PV}"
+
+inherit native
+
+EXTRA_OECONF = "-prefix ${STAGING_DIR_NATIVE}/qt4 \
+                -qt-libjpeg -qt-gif -system-zlib \
+                -no-nis -no-cups -no-exceptions  \
+                -no-accessibility -no-libjpeg    \
+                -no-nas-sound -no-sm             \
+                -no-xshape    -no-xinerama       \
+                -no-xcursor   -no-xrandr         \
+                -no-xrender   -no-fontconfig     \
+                -no-tablet    -no-xkb            \
+                -no-libpng                       \
+                -verbose -release  -fast -static \
+                -L ${STAGING_LIBDIR_NATIVE}      \
+                -qt3support "
+# yank default -e
+EXTRA_OEMAKE = " "
+
+do_configure() {
+	sed -i 's:^QT += xml qt3support$:QT += xml qt3support network:' "${S}"/src/tools/uic3/uic3.pro
+	echo yes | ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}"
+}
+
+TOBUILD = "\
+  src/tools/moc \
+  src/corelib \
+  src/sql \
+  src/qt3support \
+  src/xml \
+  src/tools/uic \
+  src/tools/rcc \
+  src/network \
+  src/gui \
+  src/tools/uic3 \
+"
+
+do_compile() {
+	unset CC CXX CFLAGS LFLAGS CXXFLAGS CPPFLAGS
+	for i in ${TOBUILD}; do
+		cd ${S}/$i && oe_runmake CC="${CC}" CXX="${CXX}"
+	done
+}
+
+do_stage() {
+        install -m 0755 bin/moc ${STAGING_BINDIR}/moc4
+        install -m 0755 bin/uic ${STAGING_BINDIR}/uic4
+        install -m 0755 bin/uic3 ${STAGING_BINDIR}/uic34
+        install -m 0755 bin/rcc ${STAGING_BINDIR}/rcc4
+        install -d ${STAGING_DIR_NATIVE}/qt4/
+        install -m 0644 tools/porting/src/q3porting.xml ${STAGING_DIR_NATIVE}/qt4/
+}
diff --git a/meta-moblin/packages/uicmoc/uicmoc4-native_4.3.2.bb b/meta-moblin/packages/uicmoc/uicmoc4-native_4.3.2.bb
new file mode 100644
index 000000000..1950f6306
--- /dev/null
+++ b/meta-moblin/packages/uicmoc/uicmoc4-native_4.3.2.bb
@@ -0,0 +1 @@
+require uicmoc4-native.inc
-- 
cgit v1.2.3