diff --git a/dev-qt/qtdeclarative/files/qtdeclarative-6.10.3-QTBUG-144701.patch b/dev-qt/qtdeclarative/files/qtdeclarative-6.10.3-QTBUG-144701.patch new file mode 100644 index 0000000000000..ccfb43102e970 --- /dev/null +++ b/dev-qt/qtdeclarative/files/qtdeclarative-6.10.3-QTBUG-144701.patch @@ -0,0 +1,33 @@ +Note that this is a non-official backport which required a bit +of adaptation to work with 6.10.3, seems to work but possible +overlooked something. + +https://bugs.gentoo.org/973374 +https://codereview.qt-project.org/c/qt%2Fqtdeclarative/+/733089 +--- a/src/qml/qml/qqmltypecompiler.cpp ++++ b/src/qml/qml/qqmltypecompiler.cpp +@@ -5,4 +5,5 @@ + #include "qqmltypecompiler_p.h" + ++#include + #include + #include +@@ -919,13 +920,12 @@ + // Apply the ordering in the IR + obj->setFirstAlias(ordered[0]); +- if (ordered[0] == defaultPropertyAlias) +- obj->indexOfDefaultPropertyOrAlias = 0; +- for (qsizetype i = 0, end = ordered.size() - 1; i < end; ++i) { ++ for (qsizetype i = 0, end = ordered.size() - 1; i < end; ++i) + ordered[i]->next = ordered[i + 1]; +- if (ordered[i] == defaultPropertyAlias) +- obj->indexOfDefaultPropertyOrAlias = i; +- } + ordered.last()->next = nullptr; + ++ if (defaultPropertyAlias) { ++ auto it = std::find(ordered.constBegin(), ordered.constEnd(), defaultPropertyAlias); ++ obj->indexOfDefaultPropertyOrAlias = std::distance(ordered.constBegin(), it); ++ } + return true; + } diff --git a/dev-qt/qtdeclarative/qtdeclarative-6.10.3-r1.ebuild b/dev-qt/qtdeclarative/qtdeclarative-6.10.3-r1.ebuild new file mode 100644 index 0000000000000..c73bf239a638c --- /dev/null +++ b/dev-qt/qtdeclarative/qtdeclarative-6.10.3-r1.ebuild @@ -0,0 +1,65 @@ +# Copyright 2021-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..14} ) +QT6_HAS_STATIC_LIBS=1 +# behaves very badly when qtdeclarative is not already installed, also +# other more minor issues (installs junk, sandbox/offscreen issues) +QT6_RESTRICT_TESTS=1 +inherit python-any-r1 qt6-build + +DESCRIPTION="Qt Declarative (Quick 2)" + +if [[ ${QT6_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~x86" +fi + +IUSE="accessibility +jit +network opengl qmlls +sql +ssl svg vulkan +widgets" + +RDEPEND=" + ~dev-qt/qtbase-${PV}:6[accessibility=,gui,network=,opengl=,sql?,ssl?,vulkan=,widgets=] + qmlls? ( ~dev-qt/qtlanguageserver-${PV}:6 ) + svg? ( ~dev-qt/qtsvg-${PV}:6 ) +" +DEPEND=" + ${RDEPEND} + vulkan? ( dev-util/vulkan-headers ) +" +BDEPEND=" + ${PYTHON_DEPS} + ~dev-qt/qtshadertools-${PV}:6 +" + +PATCHES=( + "${FILESDIR}"/${PN}-6.10.3-unity-build.patch + "${FILESDIR}"/${PN}-6.10.3-QTBUG-144701.patch +) + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package qmlls Qt6LanguageServerPrivate) + $(cmake_use_find_package sql Qt6Sql) + $(cmake_use_find_package svg Qt6Svg) + $(qt_feature jit qml_jit) + $(qt_feature network qml_network) + $(qt_feature ssl qml_ssl) + ) + + qt6-build_src_configure +} + +src_install() { + qt6-build_src_install + + if [[ ! -e ${D}${QT6_LIBDIR}/libQt6QuickControls2.so.6 ]]; then #940675 + eerror "${CATEGORY}/${PF} seems to have been improperly built and" + eerror "install was aborted to protect the system. Possibly(?) due" + eerror "to a rare portage ordering bug. If using portage, try:" + eerror " emerge -1 qtshadertools:6 qtdeclarative:6" + eerror "If that did not resolve the issue, please provide build.log" + eerror "on https://bugs.gentoo.org/940675" + die "aborting due to incomplete/broken build (see above)" + fi +}