diff --git a/textproc/Makefile b/textproc/Makefile --- a/textproc/Makefile +++ b/textproc/Makefile @@ -200,6 +200,7 @@ SUBDIR += fcitx5-gtk SUBDIR += fcitx5-lua SUBDIR += fcitx5-qt + SUBDIR += fcitx5-qt-common SUBDIR += fex SUBDIR += ffe SUBDIR += fi-aspell diff --git a/textproc/fcitx5-qt-common/Makefile b/textproc/fcitx5-qt-common/Makefile new file mode 100644 --- /dev/null +++ b/textproc/fcitx5-qt-common/Makefile @@ -0,0 +1,16 @@ +PORTREVISION= 0 + +COMMENT= Fcitx support for Qt (common files) + +PKGNAMESUFFIX= -common + +MASTERDIR= ${.CURDIR}/../fcitx5-qt + +PLIST= ${MASTERDIR}/pkg-plist.common + +FLAVORS= # empty +FLAVOR= # empty + +CMAKE_OFF= ENABLE_QT4 ENABLE_QT5 ENABLE_QT6 + +.include "${MASTERDIR}/Makefile" diff --git a/textproc/fcitx5-qt/Makefile b/textproc/fcitx5-qt/Makefile --- a/textproc/fcitx5-qt/Makefile +++ b/textproc/fcitx5-qt/Makefile @@ -6,7 +6,7 @@ PATCHFILES= f7f983e1e709.patch:-p1 MAINTAINER= khng@FreeBSD.org -COMMENT= Fcitx support for Qt5 +COMMENT= Fcitx support for Qt (${FLAVOR}) WWW= https://github.com/fcitx/fcitx5-qt LICENSE= LGPL21+ BSD3CLAUSE @@ -17,18 +17,39 @@ LIB_DEPENDS= libFcitx5Utils.so:textproc/fcitx5 \ libxkbcommon.so:x11/libxkbcommon -USES= compiler:c++17-lang gettext-tools cmake kde:5 pkgconfig qt:5 xorg +FLAVORS?= qt5 qt6 +FLAVOR?= ${FLAVORS:[1]} +qt5_PKGNAMESUFFIX= 5 +qt6_PKGNAMESUFFIX= 6 + +USES= compiler:c++17-lang gettext-tools cmake kde:5 pkgconfig xorg + +CMAKE_OFF?= ENABLE_QT4 + +.if ${FLAVOR} == qt5 +USES+= qt:5 +USE_QT= concurrent core dbus gui widgets xml buildtools:build qmake:build +CMAKE_ON= ENABLE_QT5 +CMAKE_OFF+= ENABLE_QT6 +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-CMakeLists.txt +RUN_DEPENDS= fcitx5-qt-common>=${DISTVERSION}:textproc/fcitx5-qt-common +.elif ${FLAVOR} == qt6 +USES+= qt:6 +USE_QT= base +CMAKE_ON= ENABLE_QT6 +CMAKE_OFF+= ENABLE_QT5 +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-CMakeLists.txt +RUN_DEPENDS= fcitx5-qt-common>=${DISTVERSION}:textproc/fcitx5-qt-common +.endif + +PLIST?= ${PKGDIR}/pkg-plist.${FLAVOR} PLIST_SUB= VER=${PORTVERSION} USE_GITHUB= yes GH_ACCOUNT= fcitx USE_KDE= ecm -USE_QT= concurrent core dbus widgets buildtools:build qmake:build USE_XORG= x11 xcb USE_LDCONFIG= yes -CMAKE_ON= ENABLE_QT5 -CMAKE_OFF= ENABLE_QT4 ENABLE_QT6 - .include diff --git a/textproc/fcitx5-qt/files/extra-patch-CMakeLists.txt b/textproc/fcitx5-qt/files/extra-patch-CMakeLists.txt new file mode 100644 --- /dev/null +++ b/textproc/fcitx5-qt/files/extra-patch-CMakeLists.txt @@ -0,0 +1,14 @@ +--- CMakeLists.txt.orig 2022-08-31 10:36:00 UTC ++++ CMakeLists.txt +@@ -80,11 +80,6 @@ if(ENABLE_QT6) + add_subdirectory(qt6) + endif() + +-if(NOT BUILD_ONLY_PLUGIN) +-find_package(Gettext REQUIRED) +-add_subdirectory(po) +-endif() +- + enable_testing() + add_subdirectory(test) + diff --git a/textproc/fcitx5-qt/pkg-plist.common b/textproc/fcitx5-qt/pkg-plist.common new file mode 100644 --- /dev/null +++ b/textproc/fcitx5-qt/pkg-plist.common @@ -0,0 +1,11 @@ +share/locale/ca/LC_MESSAGES/fcitx5-qt.mo +share/locale/da/LC_MESSAGES/fcitx5-qt.mo +share/locale/de/LC_MESSAGES/fcitx5-qt.mo +share/locale/es/LC_MESSAGES/fcitx5-qt.mo +share/locale/fr/LC_MESSAGES/fcitx5-qt.mo +share/locale/he/LC_MESSAGES/fcitx5-qt.mo +share/locale/ja/LC_MESSAGES/fcitx5-qt.mo +share/locale/ko/LC_MESSAGES/fcitx5-qt.mo +share/locale/ru/LC_MESSAGES/fcitx5-qt.mo +share/locale/zh_CN/LC_MESSAGES/fcitx5-qt.mo +share/locale/zh_TW/LC_MESSAGES/fcitx5-qt.mo diff --git a/textproc/fcitx5-qt/pkg-plist b/textproc/fcitx5-qt/pkg-plist.qt5 rename from textproc/fcitx5-qt/pkg-plist rename to textproc/fcitx5-qt/pkg-plist.qt5 --- a/textproc/fcitx5-qt/pkg-plist +++ b/textproc/fcitx5-qt/pkg-plist.qt5 @@ -29,14 +29,3 @@ lib/libFcitx5Qt5WidgetsAddons.so.%%VER%% %%QT_PLUGINDIR%%/platforminputcontexts/libfcitx5platforminputcontextplugin.so libexec/fcitx5-qt5-gui-wrapper -share/locale/ca/LC_MESSAGES/fcitx5-qt.mo -share/locale/da/LC_MESSAGES/fcitx5-qt.mo -share/locale/de/LC_MESSAGES/fcitx5-qt.mo -share/locale/es/LC_MESSAGES/fcitx5-qt.mo -share/locale/fr/LC_MESSAGES/fcitx5-qt.mo -share/locale/he/LC_MESSAGES/fcitx5-qt.mo -share/locale/ja/LC_MESSAGES/fcitx5-qt.mo -share/locale/ko/LC_MESSAGES/fcitx5-qt.mo -share/locale/ru/LC_MESSAGES/fcitx5-qt.mo -share/locale/zh_CN/LC_MESSAGES/fcitx5-qt.mo -share/locale/zh_TW/LC_MESSAGES/fcitx5-qt.mo diff --git a/textproc/fcitx5-qt/pkg-plist.qt6 b/textproc/fcitx5-qt/pkg-plist.qt6 new file mode 100644 --- /dev/null +++ b/textproc/fcitx5-qt/pkg-plist.qt6 @@ -0,0 +1,15 @@ +include/Fcitx5Qt6/Fcitx5Qt6DBusAddons/fcitx5qt6dbusaddons_export.h +include/Fcitx5Qt6/Fcitx5Qt6DBusAddons/fcitxqtcontrollerproxy.h +include/Fcitx5Qt6/Fcitx5Qt6DBusAddons/fcitxqtdbustypes.h +include/Fcitx5Qt6/Fcitx5Qt6DBusAddons/fcitxqtinputcontextproxy.h +include/Fcitx5Qt6/Fcitx5Qt6DBusAddons/fcitxqtinputmethodproxy.h +include/Fcitx5Qt6/Fcitx5Qt6DBusAddons/fcitxqtwatcher.h +include/Fcitx5Qt6/fcitx5qt6dbusaddons_version.h +lib/cmake/Fcitx5Qt6DBusAddons/Fcitx5Qt6DBusAddonsConfig.cmake +lib/cmake/Fcitx5Qt6DBusAddons/Fcitx5Qt6DBusAddonsConfigVersion.cmake +lib/cmake/Fcitx5Qt6DBusAddons/Fcitx5Qt6DBusAddonsTargets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/Fcitx5Qt6DBusAddons/Fcitx5Qt6DBusAddonsTargets.cmake +lib/libFcitx5Qt6DBusAddons.so +lib/libFcitx5Qt6DBusAddons.so.1 +lib/libFcitx5Qt6DBusAddons.so.%%VER%% +%%QT_PLUGINDIR%%/platforminputcontexts/libfcitx5platforminputcontextplugin.so