From 6479f63ecb8c8649f78e91b12c079b387686bc73 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Wed, 28 Feb 2024 22:28:22 -0500 Subject: [PATCH 1/2] qt6Packages.fcitx5-qt: init --- pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix | 38 ++++++++++---------- pkgs/top-level/qt6-packages.nix | 2 ++ 2 files changed, 20 insertions(+), 20 deletions(-) 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/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 { }; From dfbc49a58a64ab1386ff2e2d983ed84989688c4d Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Wed, 28 Feb 2024 22:32:04 -0500 Subject: [PATCH 2/2] fcitx5-with-addons: include both fcitx5-qt5 and fcitx5-qt6 --- pkgs/tools/inputmethods/fcitx5/with-addons.nix | 6 ++++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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 3eb23f160f6d..b8b610382dd5 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 { };