Skip to content

Commit b5f6e38

Browse files
authored
Merge pull request #292232 from NickCao/fcitx5-qt-split
qt6Packages.fcitx5-qt: init
2 parents d29fabd + dfbc49a commit b5f6e38

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix

+18-20
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{ lib
2-
, mkDerivation
2+
, stdenv
33
, fetchFromGitHub
44
, cmake
55
, extra-cmake-modules
66
, fcitx5
7-
, qtx11extras
8-
, libxcb
9-
, libXdmcp
107
, qtbase
11-
, qt6
8+
, qtwayland
9+
, wrapQtAppsHook
1210
, wayland
1311
}:
14-
15-
mkDerivation rec {
16-
pname = "fcitx5-qt";
12+
let
13+
majorVersion = lib.versions.major qtbase.version;
14+
in
15+
stdenv.mkDerivation rec {
16+
pname = "fcitx5-qt${majorVersion}";
1717
version = "5.1.4";
1818

1919
src = fetchFromGitHub {
@@ -23,30 +23,28 @@ mkDerivation rec {
2323
sha256 = "sha256-bVH2US/uEZGERslnAh/fyUbzR9fK1UfG4J+mOmrIE8Y=";
2424
};
2525

26-
preConfigure = ''
27-
substituteInPlace qt5/platforminputcontext/CMakeLists.txt \
28-
--replace \$"{CMAKE_INSTALL_QT5PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
29-
substituteInPlace qt6/platforminputcontext/CMakeLists.txt \
30-
--replace \$"{CMAKE_INSTALL_QT6PLUGINDIR}" $out/${qt6.qtbase.qtPluginPrefix}
26+
postPatch = ''
27+
substituteInPlace qt${majorVersion}/platforminputcontext/CMakeLists.txt \
28+
--replace \$"{CMAKE_INSTALL_QT${majorVersion}PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
3129
'';
3230

3331
cmakeFlags = [
34-
# adding qt6 to buildInputs would result in error: detected mismatched Qt dependencies
35-
"-DCMAKE_PREFIX_PATH=${qt6.qtbase};${qt6.qtwayland}"
36-
"-DENABLE_QT4=0"
37-
"-DENABLE_QT6=1"
32+
"-DENABLE_QT4=OFF"
33+
"-DENABLE_QT5=OFF"
34+
"-DENABLE_QT6=OFF"
35+
"-DENABLE_QT${majorVersion}=ON"
3836
];
3937

4038
nativeBuildInputs = [
4139
cmake
4240
extra-cmake-modules
41+
wrapQtAppsHook
4342
];
4443

4544
buildInputs = [
45+
qtbase
46+
qtwayland
4647
fcitx5
47-
qtx11extras
48-
libxcb
49-
libXdmcp
5048
wayland
5149
];
5250

pkgs/tools/inputmethods/fcitx5/with-addons.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
, fcitx5
55
, withConfigtool ? true
66
, fcitx5-configtool
7-
, fcitx5-qt
7+
, libsForQt5
8+
, qt6Packages
89
, fcitx5-gtk
910
, addons ? [ ]
1011
}:
@@ -14,7 +15,8 @@ symlinkJoin {
1415

1516
paths = [
1617
fcitx5
17-
fcitx5-qt
18+
libsForQt5.fcitx5-qt
19+
qt6Packages.fcitx5-qt
1820
fcitx5-gtk
1921
] ++ lib.optionals withConfigtool [
2022
fcitx5-configtool

pkgs/top-level/all-packages.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -8044,7 +8044,7 @@ with pkgs;
80448044

80458045
fcitx5 = libsForQt5.callPackage ../tools/inputmethods/fcitx5 { };
80468046

8047-
fcitx5-with-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/with-addons.nix { };
8047+
fcitx5-with-addons = callPackage ../tools/inputmethods/fcitx5/with-addons.nix { };
80488048

80498049
fcitx5-bamboo = callPackage ../tools/inputmethods/fcitx5/fcitx5-bamboo.nix { };
80508050

pkgs/top-level/qt6-packages.nix

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ makeScopeWithSplicing' {
3232
accounts-qt = callPackage ../development/libraries/accounts-qt { };
3333
appstream-qt = callPackage ../development/libraries/appstream/qt.nix { };
3434

35+
fcitx5-qt = callPackage ../tools/inputmethods/fcitx5/fcitx5-qt.nix { };
36+
3537
kdsoap = callPackage ../development/libraries/kdsoap { };
3638

3739
kcolorpicker = callPackage ../development/libraries/kcolorpicker { };

0 commit comments

Comments
 (0)