From 45e4e8f97356dcf7429657f553ac7514b218f01a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 7 Jan 2024 01:00:43 -0500 Subject: [PATCH] fcitx5-chinese-addons: build for both qt versions --- .../inputmethods/fcitx5/fcitx5-chinese-addons.nix | 11 +++++++++-- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- pkgs/top-level/qt5-packages.nix | 2 ++ pkgs/top-level/qt6-packages.nix | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix index dda524ce2ac9..0699f23e3aab 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix @@ -1,5 +1,5 @@ { lib -, mkDerivation +, stdenv , fetchurl , fetchFromGitHub , cmake @@ -13,6 +13,7 @@ , opencc , curl , fmt +, qtbase , luaSupport ? true }: @@ -29,7 +30,7 @@ let }; in -mkDerivation rec { +stdenv.mkDerivation rec { pname = "fcitx5-chinese-addons"; version = "5.1.4"; @@ -62,6 +63,12 @@ mkDerivation rec { fmt ] ++ lib.optional luaSupport fcitx5-lua; + cmakeFlags = [ + (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6")) + ]; + + dontWrapQtApps = true; + meta = with lib; { description = "Addons related to Chinese, including IME previous bundled inside fcitx4"; homepage = "https://github.com/fcitx/fcitx5-chinese-addons"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a66e3da5a316..58ed761dc803 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -321,6 +321,7 @@ mapAliases ({ fcitx-engines = throw "fcitx-engines is deprecated, please use fcitx5 instead."; # Added 2023-03-13 fcitx-configtool = throw "fcitx-configtool is deprecated, please use fcitx5 instead."; # Added 2023-03-13 + fcitx5-chinese-addons = libsForQt5.fcitx5-chinese-addons; # Added 2024-03-01 fcitx5-skk-qt = libsForQt5.fcitx5-skk-qt; # Added 2024-03-01 fcitx5-unikey = libsForQt5.fcitx5-unikey; # Added 2024-03-01 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 191e8b385428..76371e6f81fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8048,8 +8048,6 @@ with pkgs; fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { }; - fcitx5-chinese-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; - fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { abseil-cpp = abseil-cpp.override { cxxStandard = "17"; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index bfde2a2c79ef..e5c707fc56e8 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -100,6 +100,8 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; + fcitx5-chinese-addons = callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; + fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; }; fcitx5-unikey = callPackage ../tools/inputmethods/fcitx5/fcitx5-unikey.nix { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 992b8be11825..62ed9c4bb007 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -32,6 +32,8 @@ makeScopeWithSplicing' { accounts-qt = callPackage ../development/libraries/accounts-qt { }; appstream-qt = callPackage ../development/libraries/appstream/qt.nix { }; + fcitx5-chinese-addons = callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; + fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; fcitx5-skk-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-skk.nix { enableQt = true; };