Merge pull request #292232 from NickCao/fcitx5-qt-split

qt6Packages.fcitx5-qt: init
This commit is contained in:
Nick Cao 2024-02-29 13:14:35 -05:00 committed by GitHub
commit b5f6e3881a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 23 deletions

View file

@ -1,19 +1,19 @@
{ lib
, mkDerivation
, stdenv
, fetchFromGitHub
, cmake
, extra-cmake-modules
, fcitx5
, qtx11extras
, libxcb
, libXdmcp
, qtbase
, qt6
, qtwayland
, wrapQtAppsHook
, wayland
}:
mkDerivation rec {
pname = "fcitx5-qt";
let
majorVersion = lib.versions.major qtbase.version;
in
stdenv.mkDerivation rec {
pname = "fcitx5-qt${majorVersion}";
version = "5.1.4";
src = fetchFromGitHub {
@ -23,30 +23,28 @@ mkDerivation rec {
sha256 = "sha256-bVH2US/uEZGERslnAh/fyUbzR9fK1UfG4J+mOmrIE8Y=";
};
preConfigure = ''
substituteInPlace qt5/platforminputcontext/CMakeLists.txt \
--replace \$"{CMAKE_INSTALL_QT5PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
substituteInPlace qt6/platforminputcontext/CMakeLists.txt \
--replace \$"{CMAKE_INSTALL_QT6PLUGINDIR}" $out/${qt6.qtbase.qtPluginPrefix}
postPatch = ''
substituteInPlace qt${majorVersion}/platforminputcontext/CMakeLists.txt \
--replace \$"{CMAKE_INSTALL_QT${majorVersion}PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
'';
cmakeFlags = [
# adding qt6 to buildInputs would result in error: detected mismatched Qt dependencies
"-DCMAKE_PREFIX_PATH=${qt6.qtbase};${qt6.qtwayland}"
"-DENABLE_QT4=0"
"-DENABLE_QT6=1"
"-DENABLE_QT4=OFF"
"-DENABLE_QT5=OFF"
"-DENABLE_QT6=OFF"
"-DENABLE_QT${majorVersion}=ON"
];
nativeBuildInputs = [
cmake
extra-cmake-modules
wrapQtAppsHook
];
buildInputs = [
qtbase
qtwayland
fcitx5
qtx11extras
libxcb
libXdmcp
wayland
];

View file

@ -4,7 +4,8 @@
, fcitx5
, withConfigtool ? true
, fcitx5-configtool
, fcitx5-qt
, libsForQt5
, qt6Packages
, fcitx5-gtk
, addons ? [ ]
}:
@ -14,7 +15,8 @@ symlinkJoin {
paths = [
fcitx5
fcitx5-qt
libsForQt5.fcitx5-qt
qt6Packages.fcitx5-qt
fcitx5-gtk
] ++ lib.optionals withConfigtool [
fcitx5-configtool

View file

@ -8044,7 +8044,7 @@ with pkgs;
fcitx5 = libsForQt5.callPackage ../tools/inputmethods/fcitx5 { };
fcitx5-with-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/with-addons.nix { };
fcitx5-with-addons = callPackage ../tools/inputmethods/fcitx5/with-addons.nix { };
fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { };

View file

@ -32,6 +32,8 @@ makeScopeWithSplicing' {
accounts-qt = callPackage ../development/libraries/accounts-qt { };
appstream-qt = callPackage ../development/libraries/appstream/qt.nix { };
fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { };
kdsoap = callPackage ../development/libraries/kdsoap { };
kcolorpicker = callPackage ../development/libraries/kcolorpicker { };