public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx-qt/, app-i18n/fcitx-qt/files/
@ 2023-12-11 13:33 Yixun Lan
  0 siblings, 0 replies; 2+ messages in thread
From: Yixun Lan @ 2023-12-11 13:33 UTC (permalink / raw
  To: gentoo-commits

commit:     c3889c979bf324c6c32bddeb2e30c7bebb41389d
Author:     Yongxiang Liang <tanekliang <AT> gmail <DOT> com>
AuthorDate: Thu Nov 30 15:40:43 2023 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Mon Dec 11 13:33:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3889c97

app-i18n/fcitx-qt: new package, add 5.1.3

After fcitx5, the qt frontend for fcitx was split into separate package

Signed-off-by: Yongxiang Liang <tanekliang <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 app-i18n/fcitx-qt/Manifest                         |   1 +
 app-i18n/fcitx-qt/fcitx-qt-5.1.3.ebuild            |  63 ++++++++
 ...t-5.1.3-make-qwayland-workaround-optional.patch | 158 +++++++++++++++++++++
 app-i18n/fcitx-qt/metadata.xml                     |  24 ++++
 4 files changed, 246 insertions(+)

diff --git a/app-i18n/fcitx-qt/Manifest b/app-i18n/fcitx-qt/Manifest
new file mode 100644
index 000000000000..36a15ecbc431
--- /dev/null
+++ b/app-i18n/fcitx-qt/Manifest
@@ -0,0 +1 @@
+DIST fcitx-qt-5.1.3.tar.xz 92312 BLAKE2B 84dda11e955ab1317379e0f5a0e95efb1b3108844b52c0e8fd08a02f0d5d6d16094c8729820ad7dce51e3d77994c217710f69edff4d566251f9272a125ffc936 SHA512 7d02409ac8359cea5e199f16b3b06ecfe47886edb00bb2163f9fbe1c319bbef425387e58db25fdfcd2b35261eada35f2acfb93ff0b65ed497da62d35363e8947

diff --git a/app-i18n/fcitx-qt/fcitx-qt-5.1.3.ebuild b/app-i18n/fcitx-qt/fcitx-qt-5.1.3.ebuild
new file mode 100644
index 000000000000..e231ad2105f7
--- /dev/null
+++ b/app-i18n/fcitx-qt/fcitx-qt-5.1.3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="fcitx5-qt"
+
+inherit cmake
+
+DESCRIPTION="Qt library and IM module for fcitx5"
+HOMEPAGE="https://github.com/fcitx/fcitx5-qt"
+SRC_URI="https://download.fcitx-im.org/fcitx5/${MY_PN}/${MY_PN}-${PV}.tar.xz -> ${P}.tar.xz"
+
+LICENSE="BSD LGPL-2.1+"
+SLOT="5"
+KEYWORDS="~amd64 ~x86"
+IUSE="+qt5 onlyplugin staticplugin qt6 wayland"
+REQUIRED_USE="
+	|| ( qt5 qt6 )
+	staticplugin? ( onlyplugin )
+"
+
+RDEPEND="
+	x11-libs/libX11
+	x11-libs/libxcb
+	x11-libs/libxkbcommon
+	!onlyplugin? (
+		>=app-i18n/fcitx-5.1.5:5
+		qt5? ( dev-qt/qtconcurrent:5 )
+	)
+	qt5? (
+		dev-qt/qtcore:5
+		dev-qt/qtdbus:5
+		dev-qt/qtgui:5=
+		dev-qt/qtwidgets:5
+	)
+	qt6? (
+		dev-qt/qtbase:6[dbus,gui,widgets,wayland?]
+		wayland? ( dev-qt/qtwayland:6 )
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	kde-frameworks/extra-cmake-modules:0
+	virtual/pkgconfig
+	!onlyplugin? ( sys-devel/gettext )
+"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+PATCHES="${FILESDIR}/${P}-make-qwayland-workaround-optional.patch"
+
+src_configure() {
+	local mycmakeargs=(
+		-DENABLE_QT4=no
+		-DENABLE_QT5=$(usex qt5)
+		-DENABLE_QT6=$(usex qt6)
+		-DENABLE_QT6_WAYLAND_WORKAROUND=$(usex wayland)
+		-DBUILD_ONLY_PLUGIN=$(usex onlyplugin)
+		-DBUILD_STATIC_PLUGIN=$(usex staticplugin)
+	)
+	cmake_src_configure
+}

diff --git a/app-i18n/fcitx-qt/files/fcitx-qt-5.1.3-make-qwayland-workaround-optional.patch b/app-i18n/fcitx-qt/files/fcitx-qt-5.1.3-make-qwayland-workaround-optional.patch
new file mode 100644
index 000000000000..0ef5fc8652a7
--- /dev/null
+++ b/app-i18n/fcitx-qt/files/fcitx-qt-5.1.3-make-qwayland-workaround-optional.patch
@@ -0,0 +1,158 @@
+Backport of https://github.com/fcitx/fcitx5-qt/commit/af535e7e106f69e7dc6dc28db3653601d1e6156a
+
+Backport upstream commit af535e7e making QtWayland optional.
+All QtWayland-related code is guarded behind `isWayland` checks anyways.
+This benefits users of pure X11 setups.
+
+Author: Lucio Sauer <watermanpaint@posteo.net>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -16,6 +16,7 @@ option(ENABLE_QT6 "Enable Qt 6" Off)
+ option(BUILD_ONLY_PLUGIN "Build only plugin" Off)
+ option(BUILD_STATIC_PLUGIN "Build plugin as static" Off)
+ option(WITH_FCITX_PLUGIN_NAME "Enable plugin name with fcitx" On)
++option(ENABLE_QT6_WAYLAND_WORKAROUND "Enable Qt6 Wayland workaround" On)
+ 
+ if (BUILD_ONLY_PLUGIN)
+   set(LIBRARY_TYPE OBJECT)
+--- a/qt5/platforminputcontext/fcitxcandidatewindow.cpp
++++ b/qt5/platforminputcontext/fcitxcandidatewindow.cpp
+@@ -21,7 +21,7 @@
+ #include <QtMath>
+ #include <utility>
+ 
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
++#if defined(FCITX_ENABLE_QT6_WAYLAND_WORKAROUND) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+ #include <QtWaylandClient/private/qwayland-xdg-shell.h>
+ #include <QtWaylandClient/private/qwaylanddisplay_p.h>
+ #include <QtWaylandClient/private/qwaylandintegration_p.h>
+@@ -34,7 +34,7 @@ namespace fcitx {
+ 
+ namespace {
+ 
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
++#if defined(FCITX_ENABLE_QT6_WAYLAND_WORKAROUND) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+ class XdgWmBase : public QtWayland::xdg_wm_base {
+ public:
+     using xdg_wm_base::xdg_wm_base;
+@@ -120,7 +120,7 @@ FcitxCandidateWindow::FcitxCandidateWindow(QWindow *window,
+         // Not using Qt::BypassWindowManagerHint ensures wayland handle
+         // fractional scale.
+         setFlags(Qt::ToolTip | commonFlags);
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
++#if defined(FCITX_ENABLE_QT6_WAYLAND_WORKAROUND) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+         if (auto instance = QtWaylandClient::QWaylandIntegration::instance()) {
+             for (QtWaylandClient::QWaylandDisplay::RegistryGlobal global :
+                  instance->display()->globals()) {
+@@ -132,7 +132,6 @@ FcitxCandidateWindow::FcitxCandidateWindow(QWindow *window,
+                 }
+             }
+         }
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+         setProperty("_q_waylandPopupAnchor",
+                     QVariant::fromValue(Qt::BottomEdge | Qt::LeftEdge));
+         setProperty("_q_waylandPopupGravity",
+@@ -142,7 +141,6 @@ FcitxCandidateWindow::FcitxCandidateWindow(QWindow *window,
+             static_cast<unsigned int>(
+                 QtWayland::xdg_positioner::constraint_adjustment_slide_x |
+                 QtWayland::xdg_positioner::constraint_adjustment_flip_y));
+-#endif
+ #endif
+     } else {
+         // Qt::Popup ensures X11 doesn't apply tooltip animation under kwin.
+@@ -484,7 +482,7 @@ void FcitxCandidateWindow::updateClientSideUI(
+     QRect cursorRect = context_->cursorRectangleWrapper();
+     QRect screenGeometry;
+ 
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
++#if defined(FCITX_ENABLE_QT6_WAYLAND_WORKAROUND) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+     if (isWayland_) {
+         auto waylandWindow =
+             static_cast<QtWaylandClient::QWaylandWindow *>(window->handle());
+@@ -520,12 +518,10 @@ void FcitxCandidateWindow::updateClientSideUI(
+         }
+         bool wasVisible = isVisible();
+         bool cursorRectChanged = false;
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+         if (property("_q_waylandPopupAnchorRect") != cursorRect) {
+             cursorRectChanged = true;
+             setProperty("_q_waylandPopupAnchorRect", cursorRect);
+         }
+-#endif
+         // This try to ensure xdg_popup is available.
+         show();
+         xdg_popup *xdgPopup = static_cast<xdg_popup *>(
+@@ -553,7 +549,6 @@ void FcitxCandidateWindow::updateClientSideUI(
+             positioner->destroy();
+             return;
+         }
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+         // Check if we need remap.
+         // If it was invisible, nothing need to be done.
+         // If cursor rect changed, the window must be remapped.
+@@ -570,7 +565,6 @@ void FcitxCandidateWindow::updateClientSideUI(
+             show();
+         }
+         return;
+-#endif
+     }
+ #endif
+     // Try to apply the screen edge detection over the window, because if we
+--- a/qt5/platforminputcontext/fcitxcandidatewindow.h
++++ b/qt5/platforminputcontext/fcitxcandidatewindow.h
+@@ -19,7 +19,7 @@
+ #include <qscopedpointer.h>
+ #include <vector>
+ 
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
++#if defined(FCITX_ENABLE_QT6_WAYLAND_WORKAROUND) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+ #include <QtWaylandClient/private/qwayland-xdg-shell.h>
+ #endif
+ 
+@@ -93,7 +93,7 @@ public Q_SLOTS:
+     std::vector<QRect> candidateRegions_;
+     QPointer<QWindow> parent_;
+ 
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
++#if defined(FCITX_ENABLE_QT6_WAYLAND_WORKAROUND) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
+     QScopedPointer<QtWayland::xdg_wm_base> xdgWmBase_;
+ #endif
+ };
+--- a/qt6/CMakeLists.txt
++++ b/qt6/CMakeLists.txt
+@@ -1,8 +1,10 @@
+ 
+ find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED Core DBus Widgets)
+ find_package(Qt6Gui ${REQUIRED_QT6_VERSION} REQUIRED Private)
+-find_package(Qt6WaylandClient ${REQUIRED_QT6_VERSION} REQUIRED Private)
+-find_package(Qt6WaylandGlobalPrivate ${REQUIRED_QT6_VERSION} REQUIRED)
++if (ENABLE_QT6_WAYLAND_WORKAROUND)
++  find_package(Qt6WaylandClient ${REQUIRED_QT6_VERSION} REQUIRED Private)
++  find_package(Qt6WaylandGlobalPrivate ${REQUIRED_QT6_VERSION} REQUIRED)
++endif()
+ 
+ add_subdirectory(dbusaddons)
+ add_subdirectory(platforminputcontext)
+--- a/qt6/platforminputcontext/CMakeLists.txt
++++ b/qt6/platforminputcontext/CMakeLists.txt
+@@ -49,11 +49,16 @@ target_link_libraries(fcitx5platforminputcontextplugin-qt6
+                           XCB::XCB
+                           Fcitx5Qt6::DBusAddons
+                           XKBCommon::XKBCommon
+-                          Qt6::WaylandGlobalPrivate
+-                          Qt6::WaylandClient
+-                          Qt6::WaylandClientPrivate
+                          )
+ 
++if (ENABLE_QT6_WAYLAND_WORKAROUND)
++    target_compile_definitions(fcitx5platforminputcontextplugin-qt6 PRIVATE "-DFCITX_ENABLE_QT6_WAYLAND_WORKAROUND")
++    target_link_libraries(fcitx5platforminputcontextplugin-qt6
++        Qt6::WaylandGlobalPrivate
++        Qt6::WaylandClient
++        Qt6::WaylandClientPrivate)
++endif()
++
+ get_target_property(_QT6_QMAKE_EXECUTABLE Qt6::qmake LOCATION)
+ execute_process(
+     COMMAND ${_QT6_QMAKE_EXECUTABLE} -query "QT_INSTALL_PLUGINS"

diff --git a/app-i18n/fcitx-qt/metadata.xml b/app-i18n/fcitx-qt/metadata.xml
new file mode 100644
index 000000000000..446ffdc2c7c1
--- /dev/null
+++ b/app-i18n/fcitx-qt/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person" proxied="yes">
+		<email>tanekliang@gmail.com</email>
+		<name>Yongxiang Liang</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>cjk@gentoo.org</email>
+		<name>Cjk</name>
+	</maintainer>
+	<use>
+		<flag name="onlyplugin">Build only plugin</flag>
+		<flag name="qt6">Build support for QT6</flag>
+		<flag name="staticplugin">Build plugin as static</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">fcitx/fcitx5-qt</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx-qt/, app-i18n/fcitx-qt/files/
@ 2025-10-03  0:07 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-10-03  0:07 UTC (permalink / raw
  To: gentoo-commits

commit:     0ce90935247c25feeecd3cb31fe3f19e829a68fb
Author:     Yongxiang Liang <tanekliang <AT> gmail <DOT> com>
AuthorDate: Thu Oct  2 13:20:56 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct  2 23:57:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ce90935

app-i18n/fcitx-qt: fix cmake for qt 6.10.0 RC

Fixes already accepted in upstream repo

Closes: https://bugs.gentoo.org/963558
Signed-off-by: Yongxiang Liang <tanekliang <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44004
Closes: https://github.com/gentoo/gentoo/pull/44004
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-i18n/fcitx-qt/fcitx-qt-5.1.10-r1.ebuild        |  2 +
 .../files/fcitx-qt-5.1.10-fix-cmake-for-qt6.patch  | 44 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/app-i18n/fcitx-qt/fcitx-qt-5.1.10-r1.ebuild b/app-i18n/fcitx-qt/fcitx-qt-5.1.10-r1.ebuild
index f759582b7040..0d097465efc2 100644
--- a/app-i18n/fcitx-qt/fcitx-qt-5.1.10-r1.ebuild
+++ b/app-i18n/fcitx-qt/fcitx-qt-5.1.10-r1.ebuild
@@ -51,6 +51,8 @@ BDEPEND="
 	!onlyplugin? ( sys-devel/gettext )
 "
 
+PATCHES=( "${FILESDIR}"/${P}-fix-cmake-for-qt6.patch )
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_QT4=no

diff --git a/app-i18n/fcitx-qt/files/fcitx-qt-5.1.10-fix-cmake-for-qt6.patch b/app-i18n/fcitx-qt/files/fcitx-qt-5.1.10-fix-cmake-for-qt6.patch
new file mode 100644
index 000000000000..efb6c779b30f
--- /dev/null
+++ b/app-i18n/fcitx-qt/files/fcitx-qt-5.1.10-fix-cmake-for-qt6.patch
@@ -0,0 +1,44 @@
+https://github.com/fcitx/fcitx5-qt/commit/46a07a85d191fd77a1efc39c8ed43d0cd87788d2
+https://github.com/fcitx/fcitx5-qt/commit/6ac4fdd8e90ff9c25a5219e15e83740fa38c9c71
+https://github.com/fcitx/fcitx5-qt/commit/1d07f7e8d6a7ae8651eda658f87ab0c9df08bef4
+
+fix cmake for QT 6.10.0 RC
+
+--- a/qt6/CMakeLists.txt
++++ b/qt6/CMakeLists.txt
+@@ -1,11 +1,20 @@
+ 
+-find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED Core DBus Widgets)
+-find_package(Qt6Gui ${REQUIRED_QT6_VERSION} REQUIRED Private)
++set(QT6_REQUIRED_COMPONENTS Core Gui DBus Widgets)
++
+ if (ENABLE_QT6_WAYLAND_WORKAROUND)
+-  find_package(Qt6WaylandClient ${REQUIRED_QT6_VERSION} REQUIRED Private)
+-  find_package(Qt6WaylandGlobalPrivate ${REQUIRED_QT6_VERSION} REQUIRED)
++  list(APPEND QT6_REQUIRED_COMPONENTS WaylandClient WaylandGlobalPrivate)
++endif()
++find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED COMPONENTS ${QT6_REQUIRED_COMPONENTS})
++
++if (NOT TARGET Qt6::GuiPrivate)
++    find_package(Qt6GuiPrivate CONFIG REQUIRED)
+ endif()
+ 
++if (ENABLE_QT6_WAYLAND_WORKAROUND AND NOT TARGET Qt6::WaylandClientPrivate)
++    find_package(Qt6WaylandClientPrivate CONFIG REQUIRED)
++endif()
++
++
+ add_subdirectory(dbusaddons)
+ add_subdirectory(platforminputcontext)
+ 
+--- a/qt6/immodule-probing/CMakeLists.txt
++++ b/qt6/immodule-probing/CMakeLists.txt
+@@ -1,5 +1,4 @@
+ add_executable(fcitx5-qt6-immodule-probing main.cpp)
+-target_include_directories(fcitx5-qt6-immodule-probing PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
+-target_link_libraries(fcitx5-qt6-immodule-probing Qt6::Gui)
++target_link_libraries(fcitx5-qt6-immodule-probing Qt6::Gui Qt6::GuiPrivate)
+ 
+-install(TARGETS fcitx5-qt6-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}")
+\ No newline at end of file
++install(TARGETS fcitx5-qt6-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}")


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-03  0:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-03  0:07 [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx-qt/, app-i18n/fcitx-qt/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-12-11 13:33 Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox