Mail archive
alpine-aports

[alpine-aports] [PATCH 3/3] community/qt5-qtbase: big endian bug on s390x

From: Tuan M. Hoang <tmhoang_at_flatglobe.org>
Date: Wed, 19 Apr 2017 01:12:28 -0400

Ref
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=6f64bfa654fb7e20bb75ec3b0544b81482babb44

---
 community/qt5-qtbase/APKBUILD               |  4 +-
 community/qt5-qtbase/s390x-big-endian.patch | 94 +++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 1 deletion(-)
 create mode 100644 community/qt5-qtbase/s390x-big-endian.patch
diff --git a/community/qt5-qtbase/APKBUILD b/community/qt5-qtbase/APKBUILD
index 36a8f41573..df1606529f 100644
--- a/community/qt5-qtbase/APKBUILD
+++ b/community/qt5-qtbase/APKBUILD
_at_@ -57,6 +57,7 @@ source="http://download.qt-project.org/$_rel/qt/${pkgver%.*}/$_ver/submodules/qt
 	qt-musl-iconv-no-bom.patch
 	libressl-compat.patch
 	hack-openssl_test.patch
+	s390x-big-endian.patch
 	"
 
 _qt5_prefix=/usr/lib/qt5
_at_@ -212,4 +213,5 @@ x11() {
 sha512sums="36a1ba4b0dba02ae65c3b2b0aa3fb3767cbee4dbdf204c9ded7d1700e70144ce85a3a66167f86cc716a1fdd38d832962b2a752e803b0647d03032b2685da5ced  qtbase-opensource-src-5.8.0.tar.xz
 7d68421a14f0259535c977d8a521c98918193c107b76ac664571b12f5b0d7588a0d0e1297af412a26753a393b21f3f44c3274fa8ab5bc87f03705a3a03acb444  qt-musl-iconv-no-bom.patch
 af284ebb51e3d903275f0f43901755fee0d0071a2fa4f5d6e8a4b00d9185d9d9fffba8e5cbda8c4aa2b3acde69fd26a449b23ad104f509fd4156f6908e0b43da  libressl-compat.patch
-3bc1380268f077587114cfa535c58403f59c4c931902d0599633e1365f075d2e253b6f461e22ed3fe3adb12ef45ea97e1dbcbc1bbe0d151435703986f25c44c6  hack-openssl_test.patch"
+3bc1380268f077587114cfa535c58403f59c4c931902d0599633e1365f075d2e253b6f461e22ed3fe3adb12ef45ea97e1dbcbc1bbe0d151435703986f25c44c6  hack-openssl_test.patch
+aef4633243e53dc5c09eafb785d105659ee5f56c6cc9faf927b8207cda774e31df262e2c63dc05496977cd081a9dd9c7545fbcd5b5ed351aab33e4666957909c  s390x-big-endian.patch"
diff --git a/community/qt5-qtbase/s390x-big-endian.patch b/community/qt5-qtbase/s390x-big-endian.patch
new file mode 100644
index 0000000000..384244d44c
--- /dev/null
+++ b/community/qt5-qtbase/s390x-big-endian.patch
_at_@ -0,0 +1,94 @@
+From 6f64bfa654fb7e20bb75ec3b0544b81482babb44 Mon Sep 17 00:00:00 2001
+From: Shawn Rutledge <shawn.rutledge_at_digia.com>
+Date: Fri, 10 Feb 2017 13:56:58 +0100
+Subject: fix VNC platform plugin build on big-endian machines
+
+Task-number: QTBUG-58734
+Change-Id: I3e44ee4be5003acaba2f1b8ed2658a3ff1bd700e
+Reviewed-by: Lars Knoll <lars.knoll_at_qt.io>
+Reviewed-by: Dmitry Shachnev <mitya57_at_gmail.com>
+---
+ src/plugins/platforms/vnc/qvncclient.cpp | 6 +++---
+ src/plugins/platforms/vnc/qvncscreen.cpp | 7 ++++++-
+ src/plugins/platforms/vnc/qvncscreen.h   | 2 +-
+ 3 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/src/plugins/platforms/vnc/qvncclient.cpp b/src/plugins/platforms/vnc/qvncclient.cpp
+index dae3e83..58dcfc9 100644
+--- a/src/plugins/platforms/vnc/qvncclient.cpp
++++ b/src/plugins/platforms/vnc/qvncclient.cpp
+_at_@ -142,7 +142,7 @@ void QVncClient::convertPixels(char *dst, const char *src, int count) const
+         case 16: {
+             quint16 p = *reinterpret_cast<const quint16*>(src);
+ #if Q_BYTE_ORDER == Q_BIG_ENDIAN
+-            if (swapBytes)
++            if (m_swapBytes)
+                 p = ((p & 0xff) << 8) | ((p & 0xff00) >> 8);
+ #endif
+             r = (p >> 11) & 0x1f;
+_at_@ -484,7 +484,7 @@ void QVncClient::setPixelFormat()
+         m_sameEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian) == !!m_pixelFormat.bigEndian;
+         m_needConversion = pixelConversionNeeded();
+ #if Q_BYTE_ORDER == Q_BIG_ENDIAN
+-        m_swapBytes = qvnc_screen->swapBytes();
++        m_swapBytes = server()->screen()->swapBytes();
+ #endif
+     }
+ }
+_at_@ -639,7 +639,7 @@ bool QVncClient::pixelConversionNeeded() const
+         return true;
+ 
+ #if Q_BYTE_ORDER == Q_BIG_ENDIAN
+-    if (qvnc_screen->swapBytes())
++    if (server()->screen()->swapBytes())
+         return true;
+ #endif
+ 
+diff --git a/src/plugins/platforms/vnc/qvncscreen.cpp b/src/plugins/platforms/vnc/qvncscreen.cpp
+index 34def45..64f1bc0 100644
+--- a/src/plugins/platforms/vnc/qvncscreen.cpp
++++ b/src/plugins/platforms/vnc/qvncscreen.cpp
+_at_@ -43,6 +43,7 @@
+ #include <QtFbSupport/private/qfbcursor_p.h>
+ 
+ #include <QtGui/QPainter>
++#include <QtGui/QScreen>
+ #include <QtCore/QRegularExpression>
+ 
+ 
+_at_@ -172,14 +173,18 @@ QPixmap QVncScreen::grabWindow(WId wid, int x, int y, int width, int height) con
+ }
+ 
+ #if Q_BYTE_ORDER == Q_BIG_ENDIAN
+-bool QVNCScreen::swapBytes() const
++bool QVncScreen::swapBytes() const
+ {
++    return false;
++
++    /* TODO
+     if (depth() != 16)
+         return false;
+ 
+     if (screen())
+         return screen()->frameBufferLittleEndian();
+     return frameBufferLittleEndian();
++    */
+ }
+ #endif
+ 
+diff --git a/src/plugins/platforms/vnc/qvncscreen.h b/src/plugins/platforms/vnc/qvncscreen.h
+index 785abd6..0b42c3c 100644
+--- a/src/plugins/platforms/vnc/qvncscreen.h
++++ b/src/plugins/platforms/vnc/qvncscreen.h
+_at_@ -73,7 +73,7 @@ public:
+     void clearDirty() { dirtyRegion = QRegion(); }
+ 
+ #if Q_BYTE_ORDER == Q_BIG_ENDIAN
+-    bool swapBytes() const
++    bool swapBytes() const;
+ #endif
+ 
+     QStringList mArgs;
+-- 
+cgit v1.0-4-g1e03
+
-- 
2.12.2
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed Apr 19 2017 - 01:12:28 GMT