diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix index 202886e4e8e1..5311d20ffa32 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix @@ -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 ]; diff --git a/pkgs/tools/inputmethods/fcitx5/with-addons.nix b/pkgs/tools/inputmethods/fcitx5/with-addons.nix index 75fac87b6285..614074595f51 100644 --- a/pkgs/tools/inputmethods/fcitx5/with-addons.nix +++ b/pkgs/tools/inputmethods/fcitx5/with-addons.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cac142d0461c..37a6bfb96058 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index f346dec9f603..68f73dad7634 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-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { }; + kdsoap = callPackage ../development/libraries/kdsoap { }; kcolorpicker = callPackage ../development/libraries/kcolorpicker { };