* [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx-configtool/, app-i18n/fcitx-configtool/files/
@ 2024-11-28 11:04 Yixun Lan
0 siblings, 0 replies; only message in thread
From: Yixun Lan @ 2024-11-28 11:04 UTC (permalink / raw
To: gentoo-commits
commit: 3b2cc734746d777a881ea9e3c7337ca20510065e
Author: Yongxiang Liang <tanekliang <AT> gmail <DOT> com>
AuthorDate: Sun Nov 24 08:22:04 2024 +0000
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Thu Nov 28 11:03:52 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b2cc734
app-i18n/fcitx-configtool: fix build with pure wayland
Closes: https://bugs.gentoo.org/937340
Closes: https://github.com/gentoo/gentoo/pull/39443
Signed-off-by: Yongxiang Liang <tanekliang <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
...-r2.ebuild => fcitx-configtool-5.1.6-r3.ebuild} | 13 ++-
...1.7.ebuild => fcitx-configtool-5.1.7-r1.ebuild} | 13 ++-
...configtool-make-x11-dependencies-optional.patch | 112 +++++++++++++++++++++
3 files changed, 130 insertions(+), 8 deletions(-)
diff --git a/app-i18n/fcitx-configtool/fcitx-configtool-5.1.6-r2.ebuild b/app-i18n/fcitx-configtool/fcitx-configtool-5.1.6-r3.ebuild
similarity index 87%
rename from app-i18n/fcitx-configtool/fcitx-configtool-5.1.6-r2.ebuild
rename to app-i18n/fcitx-configtool/fcitx-configtool-5.1.6-r3.ebuild
index ce5113443197..8c7ba7f35343 100644
--- a/app-i18n/fcitx-configtool/fcitx-configtool-5.1.6-r2.ebuild
+++ b/app-i18n/fcitx-configtool/fcitx-configtool-5.1.6-r3.ebuild
@@ -15,7 +15,7 @@ S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="GPL-2+"
SLOT="5"
KEYWORDS="amd64"
-IUSE="kcm +config-qt test"
+IUSE="kcm +config-qt test X"
RESTRICT="!test? ( test )"
RDEPEND="
@@ -27,9 +27,11 @@ RDEPEND="
kde-frameworks/kwidgetsaddons:6
sys-devel/gettext
virtual/libintl
- x11-libs/libX11
- x11-libs/libxkbfile
- x11-misc/xkeyboard-config
+ X? (
+ x11-libs/libX11
+ x11-libs/libxkbfile
+ x11-misc/xkeyboard-config
+ )
config-qt? ( kde-frameworks/kitemviews:6 )
kcm? (
dev-qt/qtdeclarative:6
@@ -53,11 +55,14 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=( "${FILESDIR}"/${PN}-make-x11-dependencies-optional.patch )
+
src_configure() {
local mycmakeargs=(
-DKDE_INSTALL_USE_QT_SYS_PATHS=yes
-DENABLE_KCM=$(usex kcm)
-DENABLE_CONFIG_QT=$(usex config-qt)
+ -DENABLE_X11=$(usex X)
-DENABLE_TEST=$(usex test)
-DUSE_QT6=ON
)
diff --git a/app-i18n/fcitx-configtool/fcitx-configtool-5.1.7.ebuild b/app-i18n/fcitx-configtool/fcitx-configtool-5.1.7-r1.ebuild
similarity index 87%
rename from app-i18n/fcitx-configtool/fcitx-configtool-5.1.7.ebuild
rename to app-i18n/fcitx-configtool/fcitx-configtool-5.1.7-r1.ebuild
index 2e4cdd69bfab..b6a11e2f109d 100644
--- a/app-i18n/fcitx-configtool/fcitx-configtool-5.1.7.ebuild
+++ b/app-i18n/fcitx-configtool/fcitx-configtool-5.1.7-r1.ebuild
@@ -15,7 +15,7 @@ S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="GPL-2+"
SLOT="5"
KEYWORDS="~amd64"
-IUSE="kcm +config-qt test"
+IUSE="kcm +config-qt test X"
RESTRICT="!test? ( test )"
RDEPEND="
@@ -27,9 +27,11 @@ RDEPEND="
kde-frameworks/kwidgetsaddons:6
sys-devel/gettext
virtual/libintl
- x11-libs/libX11
- x11-libs/libxkbfile
- x11-misc/xkeyboard-config
+ X? (
+ x11-libs/libX11
+ x11-libs/libxkbfile
+ x11-misc/xkeyboard-config
+ )
config-qt? ( kde-frameworks/kitemviews:6 )
kcm? (
dev-qt/qtdeclarative:6
@@ -53,11 +55,14 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=( "${FILESDIR}"/${PN}-make-x11-dependencies-optional.patch )
+
src_configure() {
local mycmakeargs=(
-DKDE_INSTALL_USE_QT_SYS_PATHS=yes
-DENABLE_KCM=$(usex kcm)
-DENABLE_CONFIG_QT=$(usex config-qt)
+ -DENABLE_X11=$(usex X)
-DENABLE_TEST=$(usex test)
-DUSE_QT6=ON
)
diff --git a/app-i18n/fcitx-configtool/files/fcitx-configtool-make-x11-dependencies-optional.patch b/app-i18n/fcitx-configtool/files/fcitx-configtool-make-x11-dependencies-optional.patch
new file mode 100644
index 000000000000..53fd3da8b34c
--- /dev/null
+++ b/app-i18n/fcitx-configtool/files/fcitx-configtool-make-x11-dependencies-optional.patch
@@ -0,0 +1,112 @@
+https://github.com/fcitx/fcitx5-configtool/pull/79
+
+Add configure option "ENABLE_X11". When turned off, most parts of
+fcitx5-configtool except kbd-layout-viewer5 could be built without X11
+dependencies. This includes no behavior change.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -40,9 +40,13 @@ include(GenerateExportHeader)
+ option(ENABLE_KCM "Enable KDE Config Module" On)
+ option(ENABLE_CONFIG_QT "Enable fcitx5-config-qt" On)
+ option(ENABLE_TEST "Enable test" Off)
++option(ENABLE_X11 "Enable X11 integration" On)
+ add_definitions(-DTRANSLATION_DOMAIN=\"kcm_fcitx5\")
+ add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-configtool\")
+ add_definitions(-DQT_NO_KEYWORDS)
++if (ENABLE_X11)
++add_definitions(-DENABLE_X11)
++endif ()
+
+ if (ENABLE_CONFIG_QT)
+ find_package(KF${QT_MAJOR_VERSION}ItemViews REQUIRED)
+@@ -95,15 +99,19 @@ include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cma
+
+ find_package(PkgConfig REQUIRED)
+ find_package(Gettext REQUIRED)
++if (ENABLE_X11)
+ find_package(X11 REQUIRED)
+ find_package(XKeyboardConfig REQUIRED)
+ pkg_check_modules(XkbFile "xkbfile" REQUIRED IMPORTED_TARGET)
++endif ()
+
+ configure_file(config.h.in config.h)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+ add_subdirectory(po)
+ add_subdirectory(src)
++if (ENABLE_X11)
+ add_subdirectory(layout)
++endif ()
+
+ feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
+--- a/src/lib/configwidgetslib/CMakeLists.txt
++++ b/src/lib/configwidgetslib/CMakeLists.txt
+@@ -28,5 +28,7 @@ target_link_libraries(configwidgetslib
+ Fcitx5::Utils
+ Fcitx5Qt${QT_MAJOR_VERSION}::DBusAddons
+ Fcitx5Qt${QT_MAJOR_VERSION}::WidgetsAddons
+- configlib
+- layoutlib)
++ configlib)
++if (ENABLE_X11)
++target_link_libraries(configwidgetslib layoutlib)
++endif ()
+--- a/src/lib/configwidgetslib/layoutselector.cpp
++++ b/src/lib/configwidgetslib/layoutselector.cpp
+@@ -6,7 +6,9 @@
+
+ #include "layoutselector.h"
+ #include "dbusprovider.h"
++#ifdef ENABLE_X11
+ #include "keyboardlayoutwidget.h"
++#endif // ENABLE_X11
+ #include "layoutmodel.h"
+ #include "ui_layoutselector.h"
+ #include <QDBusPendingCallWatcher>
+@@ -45,6 +47,7 @@ LayoutSelector::LayoutSelector(DBusProvider *dbus, QWidget *parent)
+ connect(ui_->variantComboBox,
+ qOverload<int>(&QComboBox::currentIndexChanged), this,
+ &LayoutSelector::variantComboBoxChanged);
++#ifdef ENABLE_X11
+ if (qApp->platformName() == "xcb") {
+ keyboardLayoutWidget_ = new KeyboardLayoutWidget(this);
+ keyboardLayoutWidget_->setMinimumSize(QSize(400, 200));
+@@ -52,6 +55,7 @@ LayoutSelector::LayoutSelector(DBusProvider *dbus, QWidget *parent)
+ QSizePolicy::Expanding);
+ ui_->verticalLayout->addWidget(keyboardLayoutWidget_);
+ }
++#endif // ENABLE_X11
+ }
+
+ LayoutSelector::~LayoutSelector() {}
+@@ -128,6 +132,7 @@ void LayoutSelector::layoutComboBoxChanged() {
+ ui_->variantComboBox->setCurrentIndex(0);
+ }
+
++#ifdef ENABLE_X11
+ void LayoutSelector::variantComboBoxChanged() {
+ if (!keyboardLayoutWidget_) {
+ return;
+@@ -142,6 +147,9 @@ void LayoutSelector::variantComboBoxChanged() {
+ keyboardLayoutWidget_->setVisible(true);
+ }
+ }
++#else
++void LayoutSelector::variantComboBoxChanged() { return; }
++#endif // ENABLE_X11
+
+ } // namespace kcm
+ } // namespace fcitx
+--- a/src/lib/configwidgetslib/layoutselector.h
++++ b/src/lib/configwidgetslib/layoutselector.h
+@@ -53,7 +53,9 @@ private Q_SLOTS:
+ std::unique_ptr<Ui::LayoutSelector> ui_;
+ DBusProvider *dbus_;
+ LayoutProvider *layoutProvider_;
++#ifdef ENABLE_X11
+ KeyboardLayoutWidget *keyboardLayoutWidget_ = nullptr;
++#endif
+ Iso639 iso639_;
+
+ QString preSelectLayout_;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-28 11:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-28 11:04 [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx-configtool/, app-i18n/fcitx-configtool/files/ Yixun Lan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox