logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git
commit: d9a7064f80a7d4a4971b501959ee4db3f8bcd6ea
parent 6b481293b759eb7c98765cb13f6c0ef7817fac1a
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 21 Sep 2022 09:04:50 +0200

app-i18n/fcitx-qt: New package, based on ::ryans

Diffstat:

Aapp-i18n/fcitx-qt/Manifest1+
Aapp-i18n/fcitx-qt/fcitx-qt-5.0.15.ebuild56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aapp-i18n/fcitx-qt/files/0001-CMake-Add-option-to-disable-X11-support.patch63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aapp-i18n/fcitx-qt/files/0002-CMake-Add-option-to-disable-DBus-support.patch74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aapp-i18n/fcitx-qt/metadata.xml12++++++++++++
5 files changed, 206 insertions(+), 0 deletions(-)

diff --git a/app-i18n/fcitx-qt/Manifest b/app-i18n/fcitx-qt/Manifest @@ -0,0 +1 @@ +DIST fcitx-qt-5.0.15.tar.gz 127719 BLAKE2B aad90e53c2491817b2d667fa04758d4025f368258ffb5888c8e9c97c2e1eeaaf3809bf111872da3d742ea9a784bb4662ecfe8833adf514bac14a9ad36e0d45d1 SHA512 221ca9bccc080a59de52d5f5614a290add38908f9bd1d623d720e320782852fbe04bf711cf510a2fc2135501690aa5c02b7a1e8889a23c5eab9530b793f4dba3 diff --git a/app-i18n/fcitx-qt/fcitx-qt-5.0.15.ebuild b/app-i18n/fcitx-qt/fcitx-qt-5.0.15.ebuild @@ -0,0 +1,56 @@ +# Copyright 2021-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +MY_PN="fcitx5-qt" +DESCRIPTION="Qt library and IM module for fcitx5" +HOMEPAGE="https://fcitx-im.org/ https://github.com/fcitx/fcitx5-qt" +SRC_URI="https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD LGPL-2.1+" +SLOT="5" +KEYWORDS="~amd64 ~x86" +IUSE="dbus only-plugin static-plugin X" +REQUIRED_USE="static-plugin? ( only-plugin )" + +DEPEND=" + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtwidgets:5 + x11-libs/libxkbcommon + !only-plugin? ( >=app-i18n/fcitx-5.0.16:5 ) + dbus? ( dev-qt/qtdbus:5 ) + X? ( + x11-libs/libX11 + x11-libs/libxcb + ) +" +RDEPEND="${DEPEND}" +BDEPEND=" + !only-plugin? ( sys-devel/gettext ) + kde-frameworks/extra-cmake-modules + virtual/pkgconfig +" + +S="${WORKDIR}/${MY_PN}-${PV}" + +PATCHES=( + "${FILESDIR}/0001-CMake-Add-option-to-disable-X11-support.patch" + "${FILESDIR}/0002-CMake-Add-option-to-disable-DBus-support.patch" +) + +src_configure() { + # gentoo only support qt5 officially, disable qt4 & qt6 for now + local mycmakeargs=( + -DENABLE_DBUS=$(usex dbus) + -DENABLE_QT4=no + -DENABLE_QT6=no + -DENABLE_X11=$(usex X) + -DBUILD_ONLY_PLUGIN=$(usex only-plugin) + -DBUILD_STATIC_PLUGIN=$(usex static-plugin) + ) + cmake_src_configure +} diff --git a/app-i18n/fcitx-qt/files/0001-CMake-Add-option-to-disable-X11-support.patch b/app-i18n/fcitx-qt/files/0001-CMake-Add-option-to-disable-X11-support.patch @@ -0,0 +1,63 @@ +From 24618aa9f95b6e029b97a0153e11ede846330fd9 Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> +Date: Wed, 21 Sep 2022 08:59:16 +0200 +Subject: [PATCH 1/2] CMake: Add option to disable X11 support + +--- + CMakeLists.txt | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9050810..83c96fd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + option(ENABLE_QT4 "Enable Qt 4" On) + option(ENABLE_QT5 "Enable Qt 5" On) + option(ENABLE_QT6 "Enable Qt 6" Off) ++option(ENABLE_X11 "Enable X11" On) + 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) +@@ -43,24 +44,26 @@ include(ECMSetupVersion) + include(ECMGenerateHeaders) + include(ECMUninstallTarget) + +-find_package(XCB REQUIRED COMPONENTS XCB) + find_package(XKBCommon 0.5.0 REQUIRED COMPONENTS XKBCommon) + if (NOT BUILD_ONLY_PLUGIN) +-find_package(Fcitx5Utils 5.0.16 REQUIRED) ++ find_package(Fcitx5Utils 5.0.16 REQUIRED) ++endif() ++if (ENABLE_X11) ++ find_package(XCB REQUIRED COMPONENTS XCB) ++ find_package(X11 REQUIRED) ++ ++ add_library(X11Import UNKNOWN IMPORTED) ++ set_target_properties(X11Import PROPERTIES ++ IMPORTED_LOCATION "${X11_X11_LIB}" ++ INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}") + endif() +-find_package(X11 REQUIRED) +- +-add_library(X11Import UNKNOWN IMPORTED) +-set_target_properties(X11Import PROPERTIES +- IMPORTED_LOCATION "${X11_X11_LIB}" +- INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}") + + if (BUILD_ONLY_PLUGIN) +-# Dup a little bit option here. +-include(CompilerSettings) ++ # Dup a little bit option here. ++ include(CompilerSettings) + else() +-include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") +-find_package(Gettext REQUIRED) ++ include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") ++ find_package(Gettext REQUIRED) + endif() + + set(Fcitx5Qt6_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/Fcitx5Qt6) +-- +2.35.1 + diff --git a/app-i18n/fcitx-qt/files/0002-CMake-Add-option-to-disable-DBus-support.patch b/app-i18n/fcitx-qt/files/0002-CMake-Add-option-to-disable-DBus-support.patch @@ -0,0 +1,74 @@ +From 2912d6fa4bbd0bda774ed82e77e3ce48671533e7 Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> +Date: Wed, 21 Sep 2022 08:59:30 +0200 +Subject: [PATCH 2/2] CMake: Add option to disable DBus support + +--- + CMakeLists.txt | 13 ++++++++++--- + qt5/CMakeLists.txt | 10 +++++++--- + 2 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 83c96fd..1c963cb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,6 +10,7 @@ find_package(ECM 1.4.0 REQUIRED) + + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + ++option(ENABLE_DBUS "Enable DBus" On) + option(ENABLE_QT4 "Enable Qt 4" On) + option(ENABLE_QT5 "Enable Qt 5" On) + option(ENABLE_QT6 "Enable Qt 6" Off) +@@ -76,19 +77,25 @@ if(ENABLE_QT4) + endif() + + if(ENABLE_QT5) +- find_package(Qt5 ${REQUIRED_QT5_VERSION} CONFIG REQUIRED Core DBus Widgets) ++ find_package(Qt5 ${REQUIRED_QT5_VERSION} CONFIG REQUIRED Core Widgets) + find_package(Qt5Gui ${REQUIRED_QT5_VERSION} REQUIRED Private) ++ if(ENABLE_DBUS) ++ find_package(Qt5 ${REQUIRED_QT5_VERSION} CONFIG REQUIRED DBus) ++ endif() + add_subdirectory(qt5) + endif() + + if(ENABLE_QT6) +- find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED Core DBus) ++ find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED Core) + find_package(Qt6Gui ${REQUIRED_QT6_VERSION} REQUIRED Private) ++ if (ENABLE_DBUS) ++ find_package(Qt6 ${REQUIRED_QT6_VERSION} CONFIG REQUIRED DBus) ++ endif() + add_subdirectory(qt6) + endif() + + if(NOT BUILD_ONLY_PLUGIN) +-add_subdirectory(po) ++ add_subdirectory(po) + endif() + + enable_testing() +diff --git a/qt5/CMakeLists.txt b/qt5/CMakeLists.txt +index f9ada81..c54d0a1 100644 +--- a/qt5/CMakeLists.txt ++++ b/qt5/CMakeLists.txt +@@ -1,8 +1,12 @@ +-add_subdirectory(dbusaddons) +-add_subdirectory(platforminputcontext) ++if (ENABLE_DBUS) ++ add_subdirectory(dbusaddons) ++ add_subdirectory(platforminputcontext) ++endif() + + if(NOT BUILD_ONLY_PLUGIN) +- add_subdirectory(guiwrapper) ++ if (ENABLE_DBUS) ++ add_subdirectory(guiwrapper) ++ endif() + add_subdirectory(widgetsaddons) + add_subdirectory(quickphrase-editor) + endif() +-- +2.35.1 + diff --git a/app-i18n/fcitx-qt/metadata.xml b/app-i18n/fcitx-qt/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream> + <remote-id type="github">fcitx/fcitx5-qt</remote-id> + <bugs-to>https://github.com/fcitx/fcitx5-qt/issues</bugs-to> + </upstream> + <use> + <flag name="only-plugin">Build only plugin</flag> + <flag name="static-plugin">Build plugin as static</flag> + </use> +</pkgmetadata>