about summary refs log tree commit diff
path: root/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix
blob: f0553a5d52f75dd0da9d9f0b61a1c5fa2140d233 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{ lib
, stdenv
, fetchFromGitHub
, cmake
, extra-cmake-modules
, pkg-config
, fcitx5
, fcitx5-qt
, qtbase
, qtsvg
, qtwayland
, qtdeclarative
, qtx11extras ? null
, kitemviews
, kwidgetsaddons
, qtquickcontrols2 ? null
, kcoreaddons
, kdeclarative
, kirigami ? null
, kirigami2 ? null
, isocodes
, xkeyboardconfig
, libxkbfile
, libplasma ? null
, plasma-framework ? null
, wrapQtAppsHook
, kcmSupport ? true
}:

stdenv.mkDerivation rec {
  pname = "fcitx5-configtool";
  version = "5.1.4";

  src = fetchFromGitHub {
    owner = "fcitx";
    repo = pname;
    rev = version;
    sha256 = "sha256-jYO1jdiuDjt6e98qhwMpTQTnGxoIYWMKkORGJbmk3mk=";
  };

  cmakeFlags = [
    (lib.cmakeBool "KDE_INSTALL_USE_QT_SYS_PATHS" true)
    (lib.cmakeBool "ENABLE_KCM" kcmSupport)
    (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6"))
  ];

  nativeBuildInputs = [
    cmake
    extra-cmake-modules
    pkg-config
    wrapQtAppsHook
  ];

  buildInputs = [
    fcitx5
    fcitx5-qt
    qtbase
    qtsvg
    qtwayland
    kitemviews
    kwidgetsaddons
    isocodes
    xkeyboardconfig
    libxkbfile
  ] ++ lib.optionals (lib.versions.major qtbase.version == "5") [
    qtx11extras
  ] ++ lib.optionals kcmSupport ([
    qtdeclarative
    kcoreaddons
    kdeclarative
  ] ++ lib.optionals (lib.versions.major qtbase.version == "5") [
    qtquickcontrols2
    plasma-framework
    kirigami2
  ] ++ lib.optionals (lib.versions.major qtbase.version == "6") [
    libplasma
    kirigami
  ]);

  meta = with lib; {
    description = "Configuration Tool for Fcitx5";
    homepage = "https://github.com/fcitx/fcitx5-configtool";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ poscat ];
    platforms = platforms.linux;
    mainProgram = "fcitx5-config-qt";
  };
}