diff options
author | 2023-12-05 20:45:01 -0800 | |
---|---|---|
committer | 2023-12-05 20:45:01 -0800 | |
commit | 01b8d17052426cdf9c0bc440f94529d226419b8a (patch) | |
tree | 994971117cd75441e25edfae2c826b8548ae5950 /dev-qt | |
parent | dev-qt/qtbase: stabilize 6.5.3-r1 for amd64 (diff) | |
download | libressl-01b8d17052426cdf9c0bc440f94529d226419b8a.tar.gz libressl-01b8d17052426cdf9c0bc440f94529d226419b8a.tar.bz2 libressl-01b8d17052426cdf9c0bc440f94529d226419b8a.zip |
dev-qt/qtbase: drop 6.5.2-r2
Signed-off-by: orbea <orbea@riseup.net>
Diffstat (limited to 'dev-qt')
-rw-r--r-- | dev-qt/qtbase/Manifest | 1 | ||||
-rw-r--r-- | dev-qt/qtbase/files/qtbase-6.5.2-CVE-2023-38197.patch | 404 | ||||
-rw-r--r-- | dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch | 25 | ||||
-rw-r--r-- | dev-qt/qtbase/qtbase-6.5.2-r2.ebuild | 355 |
4 files changed, 0 insertions, 785 deletions
diff --git a/dev-qt/qtbase/Manifest b/dev-qt/qtbase/Manifest index dc81a32..71ca1f2 100644 --- a/dev-qt/qtbase/Manifest +++ b/dev-qt/qtbase/Manifest @@ -1,4 +1,3 @@ -DIST qtbase-everywhere-src-6.5.2.tar.xz 48410716 BLAKE2B 578c69ede6f45a8b21cba0a24674d5d8801722503d13ab9578b06b2446ce15e6a84bcdbd0c5d2c9aa868ec70862f0845406c959ed79b695f82bb398ecf299c63 SHA512 8d97029aae5b73a3e03624c9a8495dbf2fe54a4f5e992071c06f3d93935e64c80f2121b33eeb60a92d96ceb288cb25d74906a5bf47b45bb018d859d4a2d13f20 DIST qtbase-everywhere-src-6.5.3.tar.xz 47142456 BLAKE2B 5b4c774b7199563dc7f2aebf9b2b531d851ee49bc038212f4970eeb43a17c364710432708f82a518eee6692ab123d78b642c234d9548d5b553f689a43aa05ee6 SHA512 31c6c01d466f1e01f18d6dcee593360c08ee83ad0a6be495a8eba023faad628cf07ce7285426fabfd247db306319e9a64da329682c99a712a282e32f7493cdb9 DIST qtbase-everywhere-src-6.6.0.tar.xz 48350308 BLAKE2B 719e265dfafb4fd95f972a317acb95e2d83f8d62175c28ab97837c635435bdcd79bdca113362dea2f04dab799d4749e23056ddb9583908ee20ab23cedeca19b7 SHA512 4e85acefeddc0a3cd6ba615b4768f435c4e237a605172153a1777a10285dab83d9cf220c18ce6d723d051b8b432f3e92be94925b54c2eb972c2c1d9ace849e17 DIST qtbase-everywhere-src-6.6.1.tar.xz 48370760 BLAKE2B 2dd551d15eef30c7d9a5f4c406143d6f8908d7ebade9daf9fbd3d82a25765425956f2cb8689c50f87f6477de2150eee7b820ef25bb4355c51e7e7fad3ef73005 SHA512 93e77b9b077a3acd5607b643db282fdd7ed0bdfa07df74c3f0d2285afeb1672a6fa229a7e7a6c8a462701305fc22ffef20c212d906484e50fb5cdb706a7b72e1 diff --git a/dev-qt/qtbase/files/qtbase-6.5.2-CVE-2023-38197.patch b/dev-qt/qtbase/files/qtbase-6.5.2-CVE-2023-38197.patch deleted file mode 100644 index 220e94d..0000000 --- a/dev-qt/qtbase/files/qtbase-6.5.2-CVE-2023-38197.patch +++ /dev/null @@ -1,404 +0,0 @@ -Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/490550 -Upstream: https://lists.qt-project.org/pipermail/development/2023-July/044166.html - -From c216c3d9859a20b3aeec985512e89316423fc3a8 Mon Sep 17 00:00:00 2001 -From: Axel Spoerl <axel.spoerl@qt.io> -Date: Fri, 30 Jun 2023 12:43:59 +0200 -Subject: [PATCH] QXmlStreamReader: Raise error on unexpected tokens - -QXmlStreamReader accepted multiple DOCTYPE elements, containing DTD -fragments in the XML prolog, and in the XML body. -Well-formed but invalid XML files - with multiple DTD fragments in -prolog and body, combined with recursive entity expansions - have -caused infinite loops in QXmlStreamReader. - -This patch implements a token check in QXmlStreamReader. -A stream is allowed to start with an XML prolog. StartDocument -and DOCTYPE elements are only allowed in this prolog, which -may also contain ProcessingInstruction and Comment elements. -As soon as anything else is seen, the prolog ends. -After that, the prolog-specific elements are treated as unexpected. -Furthermore, the prolog can contain at most one DOCTYPE element. - -Update the documentation to reflect the new behavior. -Add an autotest that checks the new error cases are correctly detected, -and no error is raised for legitimate input. - -The original OSS-Fuzz files (see bug reports) are not included in this -patch for file size reasons. They have been tested manually. Each of -them has more than one DOCTYPE element, causing infinite loops in -recursive entity expansions. The newly implemented functionality -detects those invalid DTD fragments. By raising an error, it aborts -stream reading before an infinite loop occurs. - -Thanks to OSS-Fuzz for finding this. - -Fixes: QTBUG-92113 -Fixes: QTBUG-95188 -Change-Id: I0a082b9188b2eee50b396c4d5b1c9e1fd237bbdd -Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> -(cherry picked from commit c4301be7d5f94852e1b17f2c2989d5ca807855d4) ---- - src/corelib/serialization/qxmlstream.cpp | 145 +++++++++++++++++++-- - src/corelib/serialization/qxmlstream_p.h | 11 ++ - .../qxmlstream/tokenError/dtdInBody.xml | 20 +++ - .../qxmlstream/tokenError/multipleDtd.xml | 20 +++ - .../qxmlstream/tokenError/wellFormed.xml | 15 +++ - .../serialization/qxmlstream/tst_qxmlstream.cpp | 39 ++++++ - 6 files changed, 242 insertions(+), 8 deletions(-) - create mode 100644 tests/auto/corelib/serialization/qxmlstream/tokenError/dtdInBody.xml - create mode 100644 tests/auto/corelib/serialization/qxmlstream/tokenError/multipleDtd.xml - create mode 100644 tests/auto/corelib/serialization/qxmlstream/tokenError/wellFormed.xml - -diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp -index 6e34d4da6e5a..cf46d690f122 100644 ---- a/src/corelib/serialization/qxmlstream.cpp -+++ b/src/corelib/serialization/qxmlstream.cpp -@@ -185,7 +185,7 @@ WRAP(indexOf, QLatin1StringView) - addData() or by waiting for it to arrive on the device(). - - \value UnexpectedElementError The parser encountered an element -- that was different to those it expected. -+ or token that was different to those it expected. - - */ - -@@ -322,13 +322,34 @@ QXmlStreamEntityResolver *QXmlStreamReader::entityResolver() const - - QXmlStreamReader is a well-formed XML 1.0 parser that does \e not - include external parsed entities. As long as no error occurs, the -- application code can thus be assured that the data provided by the -- stream reader satisfies the W3C's criteria for well-formed XML. For -- example, you can be certain that all tags are indeed nested and -- closed properly, that references to internal entities have been -- replaced with the correct replacement text, and that attributes have -- been normalized or added according to the internal subset of the -- DTD. -+ application code can thus be assured, that -+ \list -+ \li the data provided by the stream reader satisfies the W3C's -+ criteria for well-formed XML, -+ \li tokens are provided in a valid order. -+ \endlist -+ -+ Unless QXmlStreamReader raises an error, it guarantees the following: -+ \list -+ \li All tags are nested and closed properly. -+ \li References to internal entities have been replaced with the -+ correct replacement text. -+ \li Attributes have been normalized or added according to the -+ internal subset of the \l DTD. -+ \li Tokens of type \l StartDocument happen before all others, -+ aside from comments and processing instructions. -+ \li At most one DOCTYPE element (a token of type \l DTD) is present. -+ \li If present, the DOCTYPE appears before all other elements, -+ aside from StartDocument, comments and processing instructions. -+ \endlist -+ -+ In particular, once any token of type \l StartElement, \l EndElement, -+ \l Characters, \l EntityReference or \l EndDocument is seen, no -+ tokens of type StartDocument or DTD will be seen. If one is present in -+ the input stream, out of order, an error is raised. -+ -+ \note The token types \l Comment and \l ProcessingInstruction may appear -+ anywhere in the stream. - - If an error occurs while parsing, atEnd() and hasError() return - true, and error() returns the error that occurred. The functions -@@ -659,6 +680,7 @@ QXmlStreamReader::TokenType QXmlStreamReader::readNext() - d->token = -1; - return readNext(); - } -+ d->checkToken(); - return d->type; - } - -@@ -743,6 +765,11 @@ static constexpr auto QXmlStreamReader_tokenTypeString = qOffsetStringArray( - "ProcessingInstruction" - ); - -+static constexpr auto QXmlStreamReader_XmlContextString = qOffsetStringArray( -+ "Prolog", -+ "Body" -+); -+ - /*! - \property QXmlStreamReader::namespaceProcessing - \brief the namespace-processing flag of the stream reader. -@@ -777,6 +804,15 @@ QString QXmlStreamReader::tokenString() const - return QLatin1StringView(QXmlStreamReader_tokenTypeString.at(d->type)); - } - -+/*! -+ \internal -+ \return \param loc (Prolog/Body) as a string. -+ */ -+static constexpr QLatin1StringView contextString(QXmlStreamReaderPrivate::XmlContext ctxt) -+{ -+ return QLatin1StringView(QXmlStreamReader_XmlContextString.at(static_cast<int>(ctxt))); -+} -+ - #endif // QT_NO_XMLSTREAMREADER - - QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack() -@@ -864,6 +900,8 @@ void QXmlStreamReaderPrivate::init() - - type = QXmlStreamReader::NoToken; - error = QXmlStreamReader::NoError; -+ currentContext = XmlContext::Prolog; -+ foundDTD = false; - } - - /* -@@ -3838,6 +3876,97 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader) - } - } - -+static constexpr bool isTokenAllowedInContext(QXmlStreamReader::TokenType type, -+ QXmlStreamReaderPrivate::XmlContext loc) -+{ -+ switch (type) { -+ case QXmlStreamReader::StartDocument: -+ case QXmlStreamReader::DTD: -+ return loc == QXmlStreamReaderPrivate::XmlContext::Prolog; -+ -+ case QXmlStreamReader::StartElement: -+ case QXmlStreamReader::EndElement: -+ case QXmlStreamReader::Characters: -+ case QXmlStreamReader::EntityReference: -+ case QXmlStreamReader::EndDocument: -+ return loc == QXmlStreamReaderPrivate::XmlContext::Body; -+ -+ case QXmlStreamReader::Comment: -+ case QXmlStreamReader::ProcessingInstruction: -+ return true; -+ -+ case QXmlStreamReader::NoToken: -+ case QXmlStreamReader::Invalid: -+ return false; -+ } -+ -+ // GCC 8.x does not treat __builtin_unreachable() as constexpr -+#if !defined(Q_CC_GNU_ONLY) || (Q_CC_GNU >= 900) -+ Q_UNREACHABLE_RETURN(false); -+#else -+ return false; -+#endif -+} -+ -+/*! -+ \internal -+ \brief QXmlStreamReader::isValidToken -+ \return \c true if \param type is a valid token type. -+ \return \c false if \param type is an unexpected token, -+ which indicates a non-well-formed or invalid XML stream. -+ */ -+bool QXmlStreamReaderPrivate::isValidToken(QXmlStreamReader::TokenType type) -+{ -+ // Don't change currentContext, if Invalid or NoToken occur in the prolog -+ if (type == QXmlStreamReader::Invalid || type == QXmlStreamReader::NoToken) -+ return false; -+ -+ // If a token type gets rejected in the body, there is no recovery -+ const bool result = isTokenAllowedInContext(type, currentContext); -+ if (result || currentContext == XmlContext::Body) -+ return result; -+ -+ // First non-Prolog token observed => switch context to body and check again. -+ currentContext = XmlContext::Body; -+ return isTokenAllowedInContext(type, currentContext); -+} -+ -+/*! -+ \internal -+ Checks token type and raises an error, if it is invalid -+ in the current context (prolog/body). -+ */ -+void QXmlStreamReaderPrivate::checkToken() -+{ -+ Q_Q(QXmlStreamReader); -+ -+ // The token type must be consumed, to keep track if the body has been reached. -+ const XmlContext context = currentContext; -+ const bool ok = isValidToken(type); -+ -+ // Do nothing if an error has been raised already (going along with an unexpected token) -+ if (error != QXmlStreamReader::Error::NoError) -+ return; -+ -+ if (!ok) { -+ raiseError(QXmlStreamReader::UnexpectedElementError, -+ QObject::tr("Unexpected token type %1 in %2.") -+ .arg(q->tokenString(), contextString(context))); -+ return; -+ } -+ -+ if (type != QXmlStreamReader::DTD) -+ return; -+ -+ // Raise error on multiple DTD tokens -+ if (foundDTD) { -+ raiseError(QXmlStreamReader::UnexpectedElementError, -+ QObject::tr("Found second DTD token in %1.").arg(contextString(context))); -+ } else { -+ foundDTD = true; -+ } -+} -+ - /*! - \fn bool QXmlStreamAttributes::hasAttribute(QAnyStringView qualifiedName) const - -diff --git a/src/corelib/serialization/qxmlstream_p.h b/src/corelib/serialization/qxmlstream_p.h -index 070424a9f523..f09adaa37e66 100644 ---- a/src/corelib/serialization/qxmlstream_p.h -+++ b/src/corelib/serialization/qxmlstream_p.h -@@ -297,6 +297,17 @@ public: - QStringDecoder decoder; - bool atEnd; - -+ enum class XmlContext -+ { -+ Prolog, -+ Body, -+ }; -+ -+ XmlContext currentContext = XmlContext::Prolog; -+ bool foundDTD = false; -+ bool isValidToken(QXmlStreamReader::TokenType type); -+ void checkToken(); -+ - /*! - \sa setType() - */ -diff --git a/tests/auto/corelib/serialization/qxmlstream/tokenError/dtdInBody.xml b/tests/auto/corelib/serialization/qxmlstream/tokenError/dtdInBody.xml -new file mode 100644 -index 000000000000..1c3ca4e2711f ---- /dev/null -+++ b/tests/auto/corelib/serialization/qxmlstream/tokenError/dtdInBody.xml -@@ -0,0 +1,20 @@ -+<!DOCTYPE TEST [ -+ <!ELEMENT TESTATTRIBUTE (CASE+)> -+ <!ELEMENT CASE (CLASS, FUNCTION)> -+ <!ELEMENT CLASS (#PCDATA)> -+ -+ <!-- adding random ENTITY statement, as this is typical DTD content --> -+ <!ENTITY unite "∪"> -+ -+ <!ATTLIST CASE CLASS CDATA #REQUIRED> -+]> -+<TEST> -+ <CASE> -+ <CLASS>tst_QXmlStream</CLASS> -+ </CASE> -+ <!-- invalid DTD in XML body follows --> -+ <!DOCTYPE DTDTEST [ -+ <!ELEMENT RESULT (CASE+)> -+ <!ATTLIST RESULT OUTPUT CDATA #REQUIRED> -+ ]> -+</TEST> -diff --git a/tests/auto/corelib/serialization/qxmlstream/tokenError/multipleDtd.xml b/tests/auto/corelib/serialization/qxmlstream/tokenError/multipleDtd.xml -new file mode 100644 -index 000000000000..cd398c0f9fde ---- /dev/null -+++ b/tests/auto/corelib/serialization/qxmlstream/tokenError/multipleDtd.xml -@@ -0,0 +1,20 @@ -+<!DOCTYPE TEST [ -+ <!ELEMENT TESTATTRIBUTE (CASE+)> -+ <!ELEMENT CASE (CLASS, FUNCTION, DATASET, COMMENTS)> -+ <!ELEMENT CLASS (#PCDATA)> -+ -+ <!-- adding random ENTITY statements, as this is typical DTD content --> -+ <!ENTITY iff "⇔"> -+ -+ <!ATTLIST CASE CLASS CDATA #REQUIRED> -+]> -+<!-- invalid second DTD follows --> -+<!DOCTYPE SECOND [ -+ <!ELEMENT SECONDATTRIBUTE (#PCDATA)> -+ <!ENTITY on "∘"> -+]> -+<TEST> -+ <CASE> -+ <CLASS>tst_QXmlStream</CLASS> -+ </CASE> -+</TEST> -diff --git a/tests/auto/corelib/serialization/qxmlstream/tokenError/wellFormed.xml b/tests/auto/corelib/serialization/qxmlstream/tokenError/wellFormed.xml -new file mode 100644 -index 000000000000..1b61a3f06225 ---- /dev/null -+++ b/tests/auto/corelib/serialization/qxmlstream/tokenError/wellFormed.xml -@@ -0,0 +1,15 @@ -+<!DOCTYPE TEST [ -+ <!ELEMENT TESTATTRIBUTE (CASE+)> -+ <!ELEMENT CASE (CLASS, FUNCTION, DATASET, COMMENTS)> -+ <!ELEMENT CLASS (#PCDATA)> -+ -+ <!-- adding random ENTITY statements, as this is typical DTD content --> -+ <!ENTITY unite "∪"> -+ -+ <!ATTLIST CASE CLASS CDATA #REQUIRED> -+]> -+<TEST> -+ <CASE> -+ <CLASS>tst_QXmlStream</CLASS> -+ </CASE> -+</TEST> -diff --git a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp -index 2a340e11bff5..30f54999e7c8 100644 ---- a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp -+++ b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp -@@ -590,6 +590,9 @@ private slots: - - void entityExpansionLimit() const; - -+ void tokenErrorHandling_data() const; -+ void tokenErrorHandling() const; -+ - private: - static QByteArray readFile(const QString &filename); - -@@ -1855,5 +1858,41 @@ void tst_QXmlStream::test_fastScanName() const - QCOMPARE(reader.error(), errorType); - } - -+void tst_QXmlStream::tokenErrorHandling_data() const -+{ -+ QTest::addColumn<QString>("fileName"); -+ QTest::addColumn<QXmlStreamReader::Error>("expectedError"); -+ QTest::addColumn<QString>("errorKeyWord"); -+ -+ constexpr auto invalid = QXmlStreamReader::Error::UnexpectedElementError; -+ constexpr auto valid = QXmlStreamReader::Error::NoError; -+ QTest::newRow("DtdInBody") << "dtdInBody.xml" << invalid << "DTD"; -+ QTest::newRow("multipleDTD") << "multipleDtd.xml" << invalid << "second DTD"; -+ QTest::newRow("wellFormed") << "wellFormed.xml" << valid << ""; -+} -+ -+void tst_QXmlStream::tokenErrorHandling() const -+{ -+ QFETCH(const QString, fileName); -+ QFETCH(const QXmlStreamReader::Error, expectedError); -+ QFETCH(const QString, errorKeyWord); -+ -+ const QDir dir(QFINDTESTDATA("tokenError")); -+ QFile file(dir.absoluteFilePath(fileName)); -+ -+ // Cross-compiling: File will be on host only -+ if (!file.exists()) -+ QSKIP("Testfile not found."); -+ -+ file.open(QIODevice::ReadOnly); -+ QXmlStreamReader reader(&file); -+ while (!reader.atEnd()) -+ reader.readNext(); -+ -+ QCOMPARE(reader.error(), expectedError); -+ if (expectedError != QXmlStreamReader::Error::NoError) -+ QVERIFY(reader.errorString().contains(errorKeyWord)); -+} -+ - #include "tst_qxmlstream.moc" - // vim: et:ts=4:sw=4:sts=4 --- -2.16.3 - diff --git a/dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch b/dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch deleted file mode 100644 index 431d89a..0000000 --- a/dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch +++ /dev/null @@ -1,25 +0,0 @@ -https://bugreports.qt.io/browse/QTBUG-114785 -https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3e801b5477a7abfe4b87f20639e345bf3dc7eca8 -From: Martin Jansa <Martin.Jansa@gmail.com> -Date: Sat, 29 Apr 2023 13:01:56 +0200 -Subject: [PATCH] tinycbor: fix build with gcc-13 - -Fixes: QTBUG-114785 -Pick-to: 6.6 6.5 -Change-Id: I4876ebd8890eee883a0d1a2bef8cb7aec4fd0f2f -Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> ---- a/src/3rdparty/tinycbor/tests/encoder/data.cpp -+++ b/src/3rdparty/tinycbor/tests/encoder/data.cpp -@@ -239,9 +239,9 @@ - QTest::newRow("0.f16") << raw("\xf9\0\0") << QVariant::fromValue(qfloat16(0)); - QTest::newRow("-1.f16") << raw("\xf9\xbc\0") << QVariant::fromValue(qfloat16(-1)); - QTest::newRow("1.5f16") << raw("\xf9\x3e\0") << QVariant::fromValue(qfloat16(1.5)); -- QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf()); -- QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff()); -- QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff()); -+ QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(qfloat16(myNaNf())); -+ QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(qfloat16(myNInff())); -+ QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(qfloat16(myInff())); - #endif - - QTest::newRow("0.f") << raw("\xfa\0\0\0\0") << QVariant::fromValue(0.f); diff --git a/dev-qt/qtbase/qtbase-6.5.2-r2.ebuild b/dev-qt/qtbase/qtbase-6.5.2-r2.ebuild deleted file mode 100644 index dd808c8..0000000 --- a/dev-qt/qtbase/qtbase-6.5.2-r2.ebuild +++ /dev/null @@ -1,355 +0,0 @@ -# Copyright 2021-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit flag-o-matic qt6-build toolchain-funcs - -DESCRIPTION="Cross-platform application development framework" - -if [[ ${QT6_BUILD_TYPE} == release ]]; then - KEYWORDS="amd64 ~arm ~arm64 ~hppa ~loong ~x86" -fi - -declare -A QT6_IUSE=( - [global]="+ssl +udev zstd" - [core]="icu" - [modules]="+concurrent +dbus +gui +network +sql +xml" - - [gui]=" - +X accessibility eglfs evdev gles2-only +libinput - opengl tslib vulkan +widgets - " - [network]="brotli gssapi libproxy sctp" - [sql]="mysql oci8 odbc postgres +sqlite" - [widgets]="cups gtk" - - [optfeature]="nls wayland" #810802,864509 -) -IUSE="${QT6_IUSE[*]}" -REQUIRED_USE=" - $( - printf '%s? ( gui ) ' ${QT6_IUSE[gui]//+/} - printf '%s? ( network ) ' ${QT6_IUSE[network]//+/} - printf '%s? ( sql ) ' ${QT6_IUSE[sql]//+/} - printf '%s? ( gui widgets ) ' ${QT6_IUSE[widgets]//+/} - ) - accessibility? ( X dbus ) - eglfs? ( opengl ) - gles2-only? ( opengl ) - gui? ( || ( X eglfs wayland ) ) - libinput? ( udev ) - sql? ( || ( ${QT6_IUSE[sql]//+/} ) ) - test? ( icu sql? ( sqlite ) ) -" - -# groups: -# - global (configure.cmake) -# - qtcore (src/corelib/configure.cmake) -# - qtgui (src/gui/configure.cmake) -# - qtnetwork (src/network/configure.cmake) -# - qtprintsupport (src/printsupport/configure.cmake) [gui+widgets] -# - qtsql (src/plugins/sqldrivers/configure.cmake) -RDEPEND=" - sys-libs/zlib:= - ssl? ( dev-libs/openssl:= ) - udev? ( virtual/libudev:= ) - zstd? ( app-arch/zstd:= ) - - app-crypt/libb2 - dev-libs/double-conversion:= - dev-libs/glib:2 - dev-libs/libpcre2:=[pcre16,unicode(+)] - icu? ( dev-libs/icu:= ) - - dbus? ( sys-apps/dbus ) - gui? ( - media-libs/fontconfig - media-libs/freetype:2 - media-libs/harfbuzz:= - media-libs/libjpeg-turbo:= - media-libs/libpng:= - x11-libs/libdrm - x11-libs/libxkbcommon[X?] - X? ( - x11-libs/libICE - x11-libs/libSM - x11-libs/libX11 - x11-libs/libxcb:= - x11-libs/xcb-util-cursor - x11-libs/xcb-util-image - x11-libs/xcb-util-keysyms - x11-libs/xcb-util-renderutil - x11-libs/xcb-util-wm - ) - accessibility? ( app-accessibility/at-spi2-core:2 ) - eglfs? ( media-libs/mesa[gbm(+)] ) - evdev? ( sys-libs/mtdev ) - libinput? ( dev-libs/libinput:= ) - opengl? ( - gles2-only? ( media-libs/libglvnd ) - !gles2-only? ( media-libs/libglvnd[X?] ) - ) - tslib? ( x11-libs/tslib ) - widgets? ( - cups? ( net-print/cups ) - gtk? ( - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3 - x11-libs/pango - ) - ) - ) - network? ( - brotli? ( app-arch/brotli:= ) - gssapi? ( virtual/krb5 ) - libproxy? ( net-libs/libproxy ) - ) - sql? ( - mysql? ( dev-db/mysql-connector-c:= ) - oci8? ( dev-db/oracle-instantclient:=[sdk] ) - odbc? ( dev-db/unixODBC ) - postgres? ( dev-db/postgresql:* ) - sqlite? ( dev-db/sqlite:3 ) - ) -" -DEPEND=" - ${RDEPEND} - <x11-libs/libxkbcommon-1.6 - X? ( x11-base/xorg-proto ) - gui? ( - vulkan? ( dev-util/vulkan-headers ) - ) - network? ( - sctp? ( net-misc/lksctp-tools ) - ) - test? ( - elibc_musl? ( sys-libs/timezone-data ) - ) -" -BDEPEND="zstd? ( app-arch/libarchive[zstd] )" #910392 -PDEPEND=" - nls? ( ~dev-qt/qttranslations-${PV}:6 ) - wayland? ( ~dev-qt/qtwayland-${PV}:6 ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-6.5.0-libressl.patch - "${FILESDIR}"/${PN}-6.5.2-hppa-forkfd-grow-stack.patch - "${FILESDIR}"/${PN}-6.5.2-no-glx.patch - "${FILESDIR}"/${PN}-6.5.2-no-symlink-check.patch - "${FILESDIR}"/${P}-CVE-2023-38197.patch - "${FILESDIR}"/${P}-tests-gcc13.patch -) - -src_prepare() { - qt6-build_src_prepare - - if use test; then - # test itself has -Werror=strict-aliasing issues, drop for simplicity - sed -e '/add_subdirectory(qsharedpointer)/d' \ - -i tests/auto/corelib/tools/CMakeLists.txt || die - fi -} - -src_configure() { - local mycmakeargs=( - -DBUILD_WITH_PCH=OFF - - -DINSTALL_ARCHDATADIR="${QT6_ARCHDATADIR}" - -DINSTALL_BINDIR="${QT6_BINDIR}" - -DINSTALL_DATADIR="${QT6_DATADIR}" - -DINSTALL_DOCDIR="${QT6_DOCDIR}" - -DINSTALL_EXAMPLESDIR="${QT6_EXAMPLESDIR}" - -DINSTALL_INCLUDEDIR="${QT6_HEADERDIR}" - -DINSTALL_LIBDIR="${QT6_LIBDIR}" - -DINSTALL_LIBEXECDIR="${QT6_LIBEXECDIR}" - -DINSTALL_MKSPECSDIR="${QT6_MKSPECSDIR}" - -DINSTALL_PLUGINSDIR="${QT6_PLUGINDIR}" - -DINSTALL_QMLDIR="${QT6_QMLDIR}" - -DINSTALL_SYSCONFDIR="${QT6_SYSCONFDIR}" - -DINSTALL_TRANSLATIONSDIR="${QT6_TRANSLATIONDIR}" - - $(qt_feature ssl openssl) - $(qt_feature ssl openssl_linked) - $(qt_feature udev libudev) - $(qt_feature zstd) - - # qtcore - $(qt_feature icu) - - # tools - -DQT_FEATURE_androiddeployqt=OFF - - # modules - $(qt_feature concurrent) - $(qt_feature dbus) - $(qt_feature gui) - $(qt_feature network) - $(qt_feature sql) - -DQT_FEATURE_testlib=ON # trivial and often needed to build revdeps - $(qt_feature xml) - ) - - use gui && mycmakeargs+=( - $(qt_feature X xcb) - $(qt_feature X system_xcb_xinput) - $(qt_feature X xkbcommon_x11) - $(cmake_use_find_package X X11) # needed for truly no automagic - $(qt_feature accessibility accessibility_atspi_bridge) - $(qt_feature eglfs) - $(qt_feature evdev) - $(qt_feature evdev mtdev) - $(qt_feature libinput) - $(qt_feature tslib) - $(qt_feature vulkan) - $(qt_feature widgets) - -DINPUT_opengl=$(usex opengl $(usex gles2-only es2 desktop) no) - -DQT_FEATURE_system_textmarkdownreader=OFF # TODO?: package md4c - ) && use widgets && mycmakeargs+=( - # note: qtprintsupport is enabled w/ gui+widgets regardless of USE=cups - $(qt_feature cups) - $(qt_feature gtk gtk3) - ) - - use network && mycmakeargs+=( - $(qt_feature brotli) - $(qt_feature gssapi) - $(qt_feature libproxy) - $(qt_feature sctp) - $(usev test -DQT_SKIP_DOCKER_COMPOSE=ON) - - # Required for LibreSSL - -DQT_FEATURE_dtls=OFF - ) - - use sql && mycmakeargs+=( - -DQT_FEATURE_sql_db2=OFF # unpackaged - -DQT_FEATURE_sql_ibase=OFF # unpackaged - $(qt_feature mysql sql_mysql) - $(qt_feature oci8 sql_oci) - $(usev oci8 -DOracle_ROOT="${ESYSROOT}"/usr/$(get_libdir)/oracle/client) - $(qt_feature odbc sql_odbc) - $(qt_feature postgres sql_psql) - $(qt_feature sqlite sql_sqlite) - $(qt_feature sqlite system_sqlite) - -DQT_FEATURE_sql_tds=OFF # currently a no-op in CMakeLists.txt - ) - - if use amd64 || use x86; then - # see bug #913400 for explanations - local cpufeats=( - # list of checked cpu features in configure.cmake - avx avx2 avx512{bw,cd,dq,er,f,ifma,pf,vbmi,vbmi2,vl} - f16c rdrnd rdseed sse2 sse3 sse4_1 sse4_2 ssse3 vaes - ) - # handle odd ones out not matching -m* and macros (keep same order) - local cpuflags=( "${cpufeats[@]}" aes sha ) - local cpufeats+=( aesni shani ) - - local -a intrins - IFS=' ' read -ra intrins < <( - : "$(test-flags-CXX "${cpuflags[@]/#/-m}")" - $(tc-getCXX) -E -P ${_} ${CXXFLAGS} ${CPPFLAGS} - <<-EOF | tail -n 1 - #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) - #include <x86intrin.h> - #endif - $(printf '__%s__ ' "${cpuflags[@]^^}") - EOF - assert - ) - - # do nothing and leave to qtbase if no macros expanded (test failed?) - if [[ \ ${intrins[*]} == *\ [^_\ ]* ]]; then - local -i i - for ((i=0; i<${#cpufeats[@]}; i++)); do - [[ ${intrins[i]} == __* ]] && - mycmakeargs+=( -DQT_FEATURE_${cpufeats[i]}=OFF ) - done - mycmakeargs+=( -DTEST_x86intrin=ON ) - fi - fi - - qt6-build_src_configure -} - -src_test() { - local -x TZ=UTC - local -x LC_TIME=C - - local CMAKE_SKIP_TESTS=( - # broken with out-of-source + if qtbase is not already installed - tst_moc - tst_qmake - # needs x11/opengl, we *could* run these but tend to be flaky - # when opengl rendering is involved (even if software-only) - tst_qopengl{,config,widget,window} - tst_qgraphicsview - tst_qx11info - # fails with network sandbox - tst_qdnslookup - # typical to lack SCTP support on non-generic kernels - tst_qsctpsocket - # these can be flaky depending on the environment/toolchain - tst_qlogging # backtrace log test can easily vary - tst_q{,raw}font # affected by available fonts / settings (bug #914737) - tst_qstorageinfo # checks mounted filesystems - # flaky due to using different test framework and fails with USE=-gui - tst_selftests - # known failing when using clang+glibc+stdc++, needs looking into - tst_qthread - # partially failing on x86 chroots and seemingly(?) harmless (dev-qt - # revdeps tests pass), skip globally to avoid keywording flakiness - tst_json - tst_qcolorspace - tst_qdoublevalidator - tst_qglobal - tst_qglyphrun - tst_qvectornd - tst_rcc - # similarly, but on armv7 and potentially others (bug #914028) - tst_qlineedit - tst_qpainter - # likewise, known failing at least on BE arches (bug #914033,914371) - tst_qimagereader - tst_qimagewriter - tst_qpluginloader - # partially broken on llvm-musl, needs looking into but skip to have - # a baseline for regressions (rest of dev-qt still passes with musl) - $(usev elibc_musl ' - tst_qfiledialog2 - tst_qicoimageformat - tst_qimagereader - tst_qimage - ') - # fails due to hppa's NaN handling, needs looking into (bug #914371) - $(usev hppa ' - tst_qcborvalue - tst_qnumeric - ') - # note: for linux, upstream only really runs+maintains tests for amd64 - # https://doc.qt.io/qt-6/supported-platforms.html - ) - - qt6-build_src_test -} - -src_install() { - qt6-build_src_install - - if use test; then - local delete_bins=( # need a better way to handle this - clientserver copier crashingServer desktopsettingsaware_helper - echo fileWriterProcess modal_helper nospace 'one space' - paster qcommandlineparser_test_helper qfileopeneventexternal - socketprocess syslocaleapp tst_qhashseed_helper 'two space s' - write-read-write - ) - local delete=( # sigh - "${D}${QT6_BINDIR}"/test* - "${delete_bins[@]/#/${D}${QT6_BINDIR}/}" - ) - # using -f given not tracking which tests may be skipped or not - rm -rf -- "${delete[@]}" || die - fi -} |