From 5704e3c0c5cd78cd6ec908fbdf65fed9107fe6ce Mon Sep 17 00:00:00 2001 From: Juergen Buchmueller Date: Tue, 13 Sep 2016 05:56:23 +0200 Subject: [PATCH] qt: fix gcc6 build + Fix alsa-lib detection which was broken since 1.1.x + Various patches to fix errors when trying to build webkit with gcc6 + Disable webkit for gcc6 because it currently won't compile --- srcpkgs/qt/patches/fix-alsatest.patch | 13 ++++ .../patches/fix-bytecompiler_narrowing.patch | 22 +++++++ srcpkgs/qt/patches/fix-itemviews.patch | 14 +++++ srcpkgs/qt/patches/fix-qcoloroutput_p_h.patch | 13 ++++ srcpkgs/qt/patches/fix-wtf_typetraits.patch | 25 ++++++++ srcpkgs/qt/template | 63 ++++++++++++++----- 6 files changed, 136 insertions(+), 14 deletions(-) create mode 100644 srcpkgs/qt/patches/fix-alsatest.patch create mode 100644 srcpkgs/qt/patches/fix-bytecompiler_narrowing.patch create mode 100644 srcpkgs/qt/patches/fix-itemviews.patch create mode 100644 srcpkgs/qt/patches/fix-qcoloroutput_p_h.patch create mode 100644 srcpkgs/qt/patches/fix-wtf_typetraits.patch diff --git a/srcpkgs/qt/patches/fix-alsatest.patch b/srcpkgs/qt/patches/fix-alsatest.patch new file mode 100644 index 00000000000..900eef2b8a5 --- /dev/null +++ b/srcpkgs/qt/patches/fix-alsatest.patch @@ -0,0 +1,13 @@ +Currently alsa-lib is at 1.1.2, thus accept SND_LIB_MINOR > 0 anyway. + +--- a/config.tests/unix/alsa/alsatest.cpp 2015-05-07 16:14:42.000000000 +0200 ++++ b/config.tests/unix/alsa/alsatest.cpp 2016-09-11 22:51:18.647973737 +0200 +@@ -40,7 +40,7 @@ + ****************************************************************************/ + + #include +-#if(!(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 10)) ++#if(!(SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || (SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 10)))) + #error "Alsa version found too old, require >= 1.0.10" + #endif + diff --git a/srcpkgs/qt/patches/fix-bytecompiler_narrowing.patch b/srcpkgs/qt/patches/fix-bytecompiler_narrowing.patch new file mode 100644 index 00000000000..7a164e8b49b --- /dev/null +++ b/srcpkgs/qt/patches/fix-bytecompiler_narrowing.patch @@ -0,0 +1,22 @@ +Fix gcc6 -Wnarrowing errors by casting to uint32_t + +--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h 2015-05-07 16:14:47.000000000 +0200 ++++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h 2016-09-11 22:26:00.614829051 +0200 +@@ -176,7 +176,7 @@ + // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary. + ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount()); + if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { +- LineInfo info = { instructions().size(), n->lineNo() }; ++ LineInfo info = { (uint32_t)instructions().size(), n->lineNo() }; + m_codeBlock->addLineInfo(info); + } + if (m_emitNodeDepth >= s_maxEmitNodeDepth) +@@ -195,7 +195,7 @@ + void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, bool fallThroughMeansTrue) + { + if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { +- LineInfo info = { instructions().size(), n->lineNo() }; ++ LineInfo info = { (uint32_t)instructions().size(), n->lineNo() }; + m_codeBlock->addLineInfo(info); + } + if (m_emitNodeDepth >= s_maxEmitNodeDepth) diff --git a/srcpkgs/qt/patches/fix-itemviews.patch b/srcpkgs/qt/patches/fix-itemviews.patch new file mode 100644 index 00000000000..5b1d601cf44 --- /dev/null +++ b/srcpkgs/qt/patches/fix-itemviews.patch @@ -0,0 +1,14 @@ +This & seems wrong, but the static_cast to QItemSelectionModel::SelectionFlags +is required anyway to make gcc6 happy. + +--- a/src/plugins/accessible/widgets/itemviews.cpp 2015-05-07 16:14:48.000000000 +0200 ++++ b/src/plugins/accessible/widgets/itemviews.cpp 2016-09-11 23:17:33.960195447 +0200 +@@ -393,7 +393,7 @@ + QModelIndex index = view()->model()->index(0, column, view()->rootIndex()); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) + return false; +- view()->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect); ++ view()->selectionModel()->select(index, static_cast(QItemSelectionModel::Columns & QItemSelectionModel::Deselect)); + return true; + } + diff --git a/srcpkgs/qt/patches/fix-qcoloroutput_p_h.patch b/srcpkgs/qt/patches/fix-qcoloroutput_p_h.patch new file mode 100644 index 00000000000..2132b9d779a --- /dev/null +++ b/srcpkgs/qt/patches/fix-qcoloroutput_p_h.patch @@ -0,0 +1,13 @@ +--- a/src/xmlpatterns/api/qcoloroutput_p.h 2015-05-07 16:14:48.000000000 +0200 ++++ b/src/xmlpatterns/api/qcoloroutput_p.h 2016-09-11 22:21:15.868628553 +0200 +@@ -70,8 +70,8 @@ + ForegroundShift = 10, + BackgroundShift = 20, + SpecialShift = 20, +- ForegroundMask = ((1 << ForegroundShift) - 1) << ForegroundShift, +- BackgroundMask = ((1 << BackgroundShift) - 1) << BackgroundShift ++ ForegroundMask = ((1 << ForegroundShift) - 1), ++ BackgroundMask = ((1 << BackgroundShift) - 1) + }; + + public: diff --git a/srcpkgs/qt/patches/fix-wtf_typetraits.patch b/srcpkgs/qt/patches/fix-wtf_typetraits.patch new file mode 100644 index 00000000000..27d20466c08 --- /dev/null +++ b/srcpkgs/qt/patches/fix-wtf_typetraits.patch @@ -0,0 +1,25 @@ +Fix type_traits for newer compilers (both, gcc-4.9.4 and gcc-6.2.0) +There is no std::tr1::has_trivial_constructor etc. anymore. + +--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h 2016-09-12 01:09:46.592885353 +0200 ++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h 2016-09-12 01:20:07.594161571 +0200 +@@ -166,7 +166,7 @@ + typedef T Type; + }; + +-#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) ++#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && (__GLIBCXX__ < 20160726) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) + + // GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace. + // VC10 (VS2010) and later support C++ TR1 type_traits in the std::tr1 namespace. +--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h 2015-05-07 16:14:45.000000000 +0200 ++++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h 2016-09-12 01:36:22.347445737 +0200 +@@ -179,7 +179,7 @@ + typedef T Type; + }; + +-#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) ++#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && (__GLIBCXX__ < 20160726) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) + + // GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace. + // VC10 (VS2010) and later support C++ TR1 type_traits in the std::tr1 namespace. diff --git a/srcpkgs/qt/template b/srcpkgs/qt/template index db0f091483c..333f57fa35f 100644 --- a/srcpkgs/qt/template +++ b/srcpkgs/qt/template @@ -1,7 +1,7 @@ # Template file for 'qt' pkgname=qt version=4.8.7 -revision=10 +revision=11 _distname=qt-everywhere-opensource-src patch_args="-Np1" wrksrc=${_distname}-${version} @@ -24,8 +24,10 @@ makedepends=" depends="qtchooser hicolor-icon-theme icu-libs" replaces="qt-qtconfig>=0" +CXXFLAGS="-std=gnu++98 -Wno-deprecated" + do_configure() { - local _libdir + local _libdir _opts _gccver export LD_LIBRARY_PATH="${wrksrc}/lib:${LD_LIBRARY_PATH}" export LD="$CXX" @@ -36,23 +38,56 @@ do_configure() { _libdir=lib fi + _gccver=$(gcc --version|awk '/^gcc / { print $3 }') + if [ "${_gccver%%.*}" -gt 5 ]; then + # Enable gcc6 for building webkit (which doesn't build, though) + sed -i configure \ + -e"s;5\*|4\*|3.4\*);6*|&;" + fi + # qmake CFLAGS/LDFLAGS sed -i -e '/outpath\/qmake\".*\"\$MAKE\")/s/)/ QMAKE_CFLAGS="$CFLAGS" QMAKE_CXXFLAGS="$CXXFLAGS" QMAKE_LFLAGS="$LDFLAGS" )/' \ -e 's/\(setBootstrapVariable\s\+\|EXTRA_C\(XX\)\?FLAGS=.*\)QMAKE_C\(XX\)\?FLAGS_\(DEBUG\|RELEASE\).*/:/' \ configure - QMAKE_CFLAGS="${CFLAGS}" \ - QMAKE_CXXFLAGS="${CXXFLAGS}" \ - QMAKE_LFLAGS="${LDFLAGS}" \ - ./configure -confirm-license -opensource \ - -prefix /usr -sysconfdir /etc -docdir /usr/share/doc/qt \ - -plugindir /usr/${_libdir}/qt/plugins -importdir /usr/lib/qt/imports \ - -translationdir /usr/share/qt/translations \ - -datadir /usr/share/qt -bindir /usr/lib/qt/bin \ - -nomake demos -nomake examples -gtkstyle \ - -system-sqlite -no-phonon -no-phonon-backend \ - -graphicssystem raster -openssl-linked -silent -no-pch -no-rpath \ - -optimized-qmake -reduce-relocations -dbus-linked -no-openvg + _opts="-confirm-license" + _opts+=" -opensource" + _opts+=" -prefix /usr" + _opts+=" -sysconfdir /etc" + _opts+=" -bindir /usr/lib/qt/bin" + _opts+=" -datadir /usr/share/qt" + _opts+=" -docdir /usr/share/doc/qt" + _opts+=" -plugindir /usr/${_libdir}/qt/plugins" + _opts+=" -importdir /usr/lib/qt/imports" + _opts+=" -translationdir /usr/share/qt/translations" + _opts+=" -nomake demos" + _opts+=" -nomake examples" + _opts+=" -graphicssystem raster" + _opts+=" -openssl-linked" + _opts+=" -xmlpatterns" + if [ "${_gccver%%.*}" -gt 5 ]; then + # webkit is broken with gcc-6.2.0 + _opts+=" -no-webkit" + else + _opts+=" -webkit" + fi + _opts+=" -gtkstyle" + _opts+=" -system-sqlite" + _opts+=" -no-openvg" + _opts+=" -no-phonon" + _opts+=" -no-phonon-backend" + _opts+=" -no-pch" + _opts+=" -no-rpath" + _opts+=" -optimized-qmake" + _opts+=" -reduce-relocations" + _opts+=" -dbus-linked" + _opts+=" -v" + + echo "./configure ${_opts}" + export QMAKE_CFLAGS="${CFLAGS}" + export QMAKE_CXXFLAGS="${CXXFLAGS}" + export QMAKE_LFLAGS="${LDFLAGS}" + ./configure ${_opts} } do_build() { export LD_LIBRARY_PATH="${wrksrc}/lib:${LD_LIBRARY_PATH}"