2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-01-15 22:18:51 +00:00
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, extra-cmake-modules
|
|
|
|
, fcitx5
|
|
|
|
, qtx11extras
|
|
|
|
, libxcb
|
|
|
|
, libXdmcp
|
2021-02-05 17:12:51 +00:00
|
|
|
, qtbase
|
2022-06-16 17:23:12 +00:00
|
|
|
, qt6
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "fcitx5-qt";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "5.0.17";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fcitx";
|
2022-02-10 20:34:41 +00:00
|
|
|
repo = pname;
|
2021-01-15 22:18:51 +00:00
|
|
|
rev = version;
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-Pi5Xb7H/h89OcTzYX7X3Xw8FQIczkWd6rMrbwnHr/L4=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace qt5/platforminputcontext/CMakeLists.txt \
|
|
|
|
--replace \$"{CMAKE_INSTALL_QT5PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
|
2022-06-16 17:23:12 +00:00
|
|
|
substituteInPlace qt6/platforminputcontext/CMakeLists.txt \
|
|
|
|
--replace \$"{CMAKE_INSTALL_QT6PLUGINDIR}" $out/${qt6.qtbase.qtPluginPrefix}
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
cmakeFlags = [
|
2022-06-16 17:23:12 +00:00
|
|
|
# adding qt6 to buildInputs would result in error: detected mismatched Qt dependencies
|
2023-04-29 16:46:19 +00:00
|
|
|
"-DCMAKE_PREFIX_PATH=${qt6.qtbase}"
|
2021-01-15 22:18:51 +00:00
|
|
|
"-DENABLE_QT4=0"
|
2022-06-16 17:23:12 +00:00
|
|
|
"-DENABLE_QT6=1"
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
extra-cmake-modules
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
fcitx5
|
|
|
|
qtx11extras
|
|
|
|
libxcb
|
|
|
|
libXdmcp
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
qtWrapperArgs = [ "--prefix" "FCITX_ADDON_DIRS" ":" "${placeholder "out"}/lib/fcitx5" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Fcitx5 Qt Library";
|
|
|
|
homepage = "https://github.com/fcitx/fcitx5-qt";
|
|
|
|
license = with licenses; [ lgpl21Plus bsd3 ];
|
|
|
|
maintainers = with maintainers; [ poscat ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|