From 310da71e43938c11c1adb27d634194146ba1f143 Mon Sep 17 00:00:00 2001 From: Chaoting Liu Date: Sat, 18 Feb 2017 08:48:31 +0000 Subject: [PATCH] lib32-qt: rebuild and disable webkit module as it is outdated - add pending lib32-qt to build excluded qtwebkit (but failed currently) - patch ported from x64 packages --- lib32-qt/PKGBUILD | 6 +- lib32-qt/PKGBUILD.pend | 124 ++++++++++++++++++++++++ lib32-qt/disable-sslv3.patch | 54 +++++++++++ lib32-qt/qtwebkit-2.3-debuginfo.patch | 16 +++ lib32-qt/qtwebkit-2.3-save_memory.patch | 12 +++ lib32-qt/qtwebkit-2.3.4-gcc5-1.patch | 81 ++++++++++++++++ 6 files changed, 290 insertions(+), 3 deletions(-) create mode 100644 lib32-qt/PKGBUILD.pend create mode 100644 lib32-qt/disable-sslv3.patch create mode 100644 lib32-qt/qtwebkit-2.3-debuginfo.patch create mode 100644 lib32-qt/qtwebkit-2.3-save_memory.patch create mode 100644 lib32-qt/qtwebkit-2.3.4-gcc5-1.patch diff --git a/lib32-qt/PKGBUILD b/lib32-qt/PKGBUILD index 104cc05..2835248 100644 --- a/lib32-qt/PKGBUILD +++ b/lib32-qt/PKGBUILD @@ -1,12 +1,12 @@ _pkgbasename=qt pkgname="lib32-${_pkgbasename}" pkgver=4.8.7 -pkgrel=5 +pkgrel=6 pkgdesc='A cross-platform application and UI framework. (ELF32)' arch=('x86_64') url='http://www.qt.io' license=('GPL3' 'LGPL') -depends=(lib32-{fontconfig,sqlite3,alsa-lib,glib2,dbus-core,openssl,gstreamer,gst-plugins-base} +depends=(lib32-{fontconfig,sqlite3,alsa-lib,glib2,dbus-core,openssl} lib32-lib{png,tiff,mng,gl,sm,xrandr,xv,xi,xinerama,xcursor,xfixes,ffi,xml2} "${_pkgbasename}=${pkgver}") makedepends=('cups' lib32-{mesa,libcups,libxfixes,icu,clang} ) @@ -53,7 +53,7 @@ build() { -system-sqlite \ -no-phonon \ -no-phonon-backend \ - -webkit \ + -no-webkit \ -graphicssystem raster \ -openssl-linked \ -nomake demos \ diff --git a/lib32-qt/PKGBUILD.pend b/lib32-qt/PKGBUILD.pend new file mode 100644 index 0000000..3270134 --- /dev/null +++ b/lib32-qt/PKGBUILD.pend @@ -0,0 +1,124 @@ +_pkgbasename=qt +pkgname="lib32-${_pkgbasename}" +pkgver=4.8.7 +pkgrel=6 +pkgdesc='A cross-platform application and UI framework. (ELF32)' +arch=('x86_64') +url='http://www.qt.io' +license=('GPL3' 'LGPL') +depends=(lib32-{fontconfig,sqlite3,alsa-lib,glib2,dbus-core,openssl,gst-plugins-base} + lib32-lib{png,tiff,mng,gl,sm,xrandr,xv,xi,xinerama,xcursor,xfixes,ffi,xml2} + "${_pkgbasename}=${pkgver}") +makedepends=('cups' lib32-{mesa,libcups,libxfixes,icu,clang} 'gperf' 'python2' 'ruby' 'git' 'mesa' 'gst-plugins-base-libs') +_pkgfqn="${_pkgbasename}-everywhere-opensource-src-${pkgver}" +source=("http://download.qt.io/official_releases/qt/4.8/${pkgver}/${_pkgfqn}.tar.gz" + 'http://download.kde.org/stable/qtwebkit-2.3/2.3.4/src/qtwebkit-2.3.4.tar.gz' + "kubuntu_14_systemtrayicon.diff" + 'disable-sslv3.patch' + 'qtwebkit-2.3.4-gcc5-1.patch' + 'qtwebkit-2.3-debuginfo.patch' + 'qtwebkit-2.3-save_memory.patch') +md5sums=('d990ee66bf7ab0c785589776f35ba6ad' + '42ef76d0cf7d0c611ef83418e9f297ff' + 'a523644faa8f98a73f55c4aa23c114a6' + '1803ab6313df762d807678e58fc85f53' + 'b12602b7460914994354a5c2cae83df2' + 'ab784b24965ef9bbe42f875e98e43ac0' + 'e588c0c49b72951c68358970db75b4fd') + +prepare() { + cd "${srcdir}/${_pkgfqn}" + patch -Np1 -i ../kubuntu_14_systemtrayicon.diff + + # disable SSLv3 + patch -p1 -i "${srcdir}"/disable-sslv3.patch + + sed -i "/^QMAKE_LINK\s/s|g++|g++ -m32|g" mkspecs/common/g++-base.conf + sed -i "s|-O2|${CXXFLAGS} -m32|" mkspecs/common/g++-base.conf + sed -i "s|-O2|${CXXFLAGS} -m32|" mkspecs/common/gcc-base.conf + sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" mkspecs/common/gcc-base-unix.conf + sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS} -m32|g" mkspecs/common/gcc-base.conf + sed -i "s|-Wl,-O1|-m32 -Wl,-O1|" mkspecs/common/g++-unix.conf + sed -e "s|-O2|$CXXFLAGS -m32|" \ + -e "/^QMAKE_RPATH/s| -Wl,-rpath,||g" \ + -e "/^QMAKE_LINK\s/s|g++|g++ -m32|g" \ + -e "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" \ + -i mkspecs/common/g++.conf + + cd $srcdir/ + + # reduce debug info, to avoid the error "ar: libWebCore.a: File truncated" of 4GB file max exceed + patch -p1 -i "${srcdir}"/qtwebkit-2.3-debuginfo.patch + patch -p1 -i "${srcdir}"/qtwebkit-2.3-save_memory.patch + + # Fix build with GCC 5 (LFS) + patch -p1 -i "$srcdir"/qtwebkit-2.3.4-gcc5-1.patch +} + +build() { + export CC='clang -m32' + export CXX='clang++ -m32' + export QT4DIR=$srcdir/$_pkgfqn + export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH} + export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" + + # The bundled QtWebkit of Qt-4.8.7 requires legacy gstreamer support, but we know that qtwebkit-2.3.4 supports gst1.x + cd "${srcdir}/${_pkgfqn}" + ./configure -confirm-license -opensource -v -platform linux-g++-32 \ + -prefix /usr \ + -libdir /usr/lib32 \ + -plugindir /usr/lib32/qt/plugins \ + -importdir /usr/lib32/qt/imports \ + -datadir /usr/share/qt \ + -translationdir /usr/share/qt/translations \ + -sysconfdir /etc \ + -system-sqlite \ + -no-phonon \ + -no-phonon-backend \ + -no-webkit \ + -graphicssystem raster \ + -openssl-linked \ + -nomake demos \ + -nomake examples \ + -nomake docs \ + -nomake tools \ + -optimized-qmake \ + -no-rpath \ + -dbus-linked \ + -reduce-relocations \ + -no-openvg \ + -xcursor + + make + # + cd $srcdir + export QTDIR=/usr + export PATH=$QT4DIR/bin:$PATH + Tools/Scripts/build-webkit --qt \ + --no-webkit2 \ + --prefix=/usr --install-libs=/usr/lib32 \ + --makeargs="$MAKEFLAGS" \ + --release \ + --qmakearg="CONFIG+=production_build" \ + --system-malloc +} + +package() { + # install QtWebkit + make -C WebKitBuild/Release INSTALL_ROOT="${pkgdir}" install + + # Qt4 part + cd "${srcdir}/${_pkgfqn}" + make install INSTALL_ROOT="${pkgdir}" + + # Fix wrong path in pkgconfig files + find "${pkgdir}/usr/lib32/pkgconfig" -type f -name '*.pc' \ + -exec perl -pi -e "s, -L${srcdir}/?\S+,,g" {} \; + # Fix wrong path in prl files + find "${pkgdir}/usr/lib32" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \; + + rm -rf "${pkgdir}/usr"/{include,share,bin} + mkdir -p "${pkgdir}/usr/share/licenses" + ln -s "${_pkgbasename}" "${pkgdir}/usr/share/licenses/${pkgname}" +} diff --git a/lib32-qt/disable-sslv3.patch b/lib32-qt/disable-sslv3.patch new file mode 100644 index 0000000..5ebd974 --- /dev/null +++ b/lib32-qt/disable-sslv3.patch @@ -0,0 +1,54 @@ +diff -u -r qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl.cpp qt-everywhere-opensource-src-4.8.7-nossl3/src/network/ssl/qsslsocket_openssl.cpp +--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl.cpp 2015-05-07 16:14:44.000000000 +0200 ++++ qt-everywhere-opensource-src-4.8.7-nossl3/src/network/ssl/qsslsocket_openssl.cpp 2016-03-04 11:29:17.119300898 +0100 +@@ -267,7 +267,11 @@ + #endif + break; + case QSsl::SslV3: ++#ifndef OPENSSL_NO_SSL3 + ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method()); ++#else ++ ctx = 0; // SSL 3 not supported by the system, but chosen deliberately -> error ++#endif + break; + case QSsl::SecureProtocols: // SslV2 will be disabled below + case QSsl::TlsV1SslV3: // SslV2 will be disabled below +diff -u -r qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols.cpp qt-everywhere-opensource-src-4.8.7-nossl3/src/network/ssl/qsslsocket_openssl_symbols.cpp +--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols.cpp 2015-05-07 16:14:44.000000000 +0200 ++++ qt-everywhere-opensource-src-4.8.7-nossl3/src/network/ssl/qsslsocket_openssl_symbols.cpp 2016-03-04 11:28:52.806050135 +0100 +@@ -228,13 +228,17 @@ + #ifndef OPENSSL_NO_SSL2 + DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return) + #endif ++#ifndef OPENSSL_NO_SSL3 + DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return) ++#endif + DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return) + DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return) + #ifndef OPENSSL_NO_SSL2 + DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return) + #endif ++#ifndef OPENSSL_NO_SSL3 + DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return) ++#endif + DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return) + DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return) + #else +@@ -822,13 +826,17 @@ + #ifndef OPENSSL_NO_SSL2 + RESOLVEFUNC(SSLv2_client_method) + #endif ++#ifndef OPENSSL_NO_SSL3 + RESOLVEFUNC(SSLv3_client_method) ++#endif + RESOLVEFUNC(SSLv23_client_method) + RESOLVEFUNC(TLSv1_client_method) + #ifndef OPENSSL_NO_SSL2 + RESOLVEFUNC(SSLv2_server_method) + #endif ++#ifndef OPENSSL_NO_SSL3 + RESOLVEFUNC(SSLv3_server_method) ++#endif + RESOLVEFUNC(SSLv23_server_method) + RESOLVEFUNC(TLSv1_server_method) + RESOLVEFUNC(X509_NAME_entry_count) diff --git a/lib32-qt/qtwebkit-2.3-debuginfo.patch b/lib32-qt/qtwebkit-2.3-debuginfo.patch new file mode 100644 index 0000000..77e62c9 --- /dev/null +++ b/lib32-qt/qtwebkit-2.3-debuginfo.patch @@ -0,0 +1,16 @@ +diff -up webkit-qtwebkit-23/Source/WebCore/WebCore.pri.debuginfo webkit-qtwebkit-23/Source/WebCore/WebCore.pri +--- webkit-qtwebkit-23/Source/WebCore/WebCore.pri.debuginfo 2013-02-21 22:28:57.791764043 -0600 ++++ webkit-qtwebkit-23/Source/WebCore/WebCore.pri 2013-02-21 22:31:02.994198797 -0600 +@@ -7,6 +7,12 @@ + + SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore + ++#equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64)|equals(QT_ARCH, powerpc64)|equals(QT_ARCH, powerpc) { ++ message("WebCore workaround for QtWebkit: do not build with -g, but with -g1") ++ QMAKE_CXXFLAGS_RELEASE -= -g ++ QMAKE_CXXFLAGS_RELEASE += -g1 ++#} ++ + QT *= network + haveQt(5): QT *= core-private gui-private + diff --git a/lib32-qt/qtwebkit-2.3-save_memory.patch b/lib32-qt/qtwebkit-2.3-save_memory.patch new file mode 100644 index 0000000..6ccb158 --- /dev/null +++ b/lib32-qt/qtwebkit-2.3-save_memory.patch @@ -0,0 +1,12 @@ +diff -up webkit-qtwebkit-23/Source/WebCore/WebCore.pri.save_memory webkit-qtwebkit-23/Source/WebCore/WebCore.pri +--- webkit-qtwebkit-23/Source/WebCore/WebCore.pri.save_memory 2013-02-15 09:46:12.000000000 -0600 ++++ webkit-qtwebkit-23/Source/WebCore/WebCore.pri 2013-02-21 16:42:30.996634743 -0600 +@@ -336,6 +336,8 @@ mac { + } + unix:!mac:*-g++*:QMAKE_CXXFLAGS += -fdata-sections + unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections ++unix:!mac:*-g++*:!equals(QT_ARCH, powerpc):!equals(QT_ARCH, s390):!equals(QT_ARCH, mips):!equals(QT_ARCH, arm):QMAKE_LFLAGS += -Wl,--no-keep-memory ++unix:!mac:*-g++*:!equals(QT_ARCH, powerpc):!equals(QT_ARCH, s390):!equals(QT_ARCH, mips):!equals(QT_ARCH, arm):QMAKE_LFLAGS += -Wl,--reduce-memory-overheads + linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF + + unix|win32-g++* { diff --git a/lib32-qt/qtwebkit-2.3.4-gcc5-1.patch b/lib32-qt/qtwebkit-2.3.4-gcc5-1.patch new file mode 100644 index 0000000..593fd52 --- /dev/null +++ b/lib32-qt/qtwebkit-2.3.4-gcc5-1.patch @@ -0,0 +1,81 @@ +Submitted By: Bruce Dubbs +Date: 2015-07-07 +Origin: https://bugreports.qt.io/browse/QTBUG-44829 +Initial Package Version: 2.3.4 +Description: Allow qtwebkit to build with gcc-5. +Upstream Status: In repository + +--- a/Source/JavaScriptCore/runtime/JSObject.cpp 2014-09-24 13:42:05.000000000 +0200 ++++ b/Source/JavaScriptCore/runtime/JSObject.cpp 2015-05-26 21:01:40.708178176 +0200 +@@ -1922,6 +1922,10 @@ + } + } + ++template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes(ExecState* exec, unsigned i, JSValue value); ++template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes(ExecState* exec, unsigned i, JSValue value); ++template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes(ExecState* exec, unsigned i, JSValue value); ++ + void JSObject::putByIndexBeyondVectorLengthWithArrayStorage(ExecState* exec, unsigned i, JSValue value, bool shouldThrow, ArrayStorage* storage) + { + JSGlobalData& globalData = exec->globalData(); +--- a/Source/WebCore/loader/icon/IconController.cpp 2014-09-24 13:42:05.000000000 +0200 ++++ b/Source/WebCore/loader/icon/IconController.cpp 2015-05-26 21:01:51.583361817 +0200 +@@ -163,6 +163,10 @@ + } + + if (iconDatabase().supportsAsynchronousMode()) { ++ // FIXME () - We should support in-memory-only private browsing icons in asynchronous icon database mode. ++ if (m_frame->page()->settings()->privateBrowsingEnabled()) ++ return; ++ + m_frame->loader()->documentLoader()->getIconLoadDecisionForIconURL(urlString); + // Commit the icon url mapping to the database just in case we don't end up loading later. + commitToDatabase(iconURL); +@@ -206,10 +210,6 @@ + { + ASSERT(iconLoadDecision != IconLoadUnknown); + +- // FIXME () - We should support in-memory-only private browsing icons in asynchronous icon database mode. +- if (iconDatabase().supportsAsynchronousMode() && m_frame->page()->settings()->privateBrowsingEnabled()) +- return; +- + if (iconLoadDecision == IconLoadNo) { + KURL iconURL(url()); + String urlString(iconURL.string()); +--- a/Source/WebKit/qt/declarative/experimental/experimental.pri 2014-09-24 13:42:05.000000000 +0200 ++++ b/Source/WebKit/qt/declarative/experimental/experimental.pri 2015-05-26 21:01:14.413735319 +0200 +@@ -29,8 +29,8 @@ + + DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name} + +-CONFIG += rpath +-RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib ++#CONFIG += rpath ++#RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib + + SOURCES += plugin.cpp + +--- a/Source/WebKit/qt/declarative/public.pri 2014-09-24 13:42:05.000000000 +0200 ++++ b/Source/WebKit/qt/declarative/public.pri 2015-05-26 21:01:14.413735319 +0200 +@@ -36,8 +36,8 @@ + + DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name} + +-CONFIG += rpath +-RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib ++#CONFIG += rpath ++#RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib + + SOURCES += plugin.cpp + +--- a/Tools/qmake/mkspecs/features/rpath.prf 2014-09-24 13:42:05.000000000 +0200 ++++ b/Tools/qmake/mkspecs/features/rpath.prf 2015-05-26 21:01:14.414735336 +0200 +@@ -6,7 +6,7 @@ + + equals(ROOT_BUILD_DIR, $$dirname(DESTDIR)): RPATHDIR_RELATIVE_TO_DESTDIR = ../lib + +-linux-*:!isEmpty(RPATHDIR_RELATIVE_TO_DESTDIR) { ++linux-rpath_me_harder_no_no_no:!isEmpty(RPATHDIR_RELATIVE_TO_DESTDIR) { + # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR + # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var. + QMAKE_RPATHDIR = \$\$ORIGIN/$${RPATHDIR_RELATIVE_TO_DESTDIR} $${QMAKE_RPATHDIR}