3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix
2022-11-23 20:15:38 +08:00

59 lines
1.2 KiB
Nix

{ lib
, mkDerivation
, fetchFromGitHub
, cmake
, extra-cmake-modules
, fcitx5
, qtx11extras
, libxcb
, libXdmcp
, qtbase
, qt6
}:
mkDerivation rec {
pname = "fcitx5-qt";
version = "5.0.16";
src = fetchFromGitHub {
owner = "fcitx";
repo = pname;
rev = version;
sha256 = "sha256-KmvlMct/XZgJJiQ9FDol1vO6jUekYaoEhLqJimwci6w=";
};
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}
'';
cmakeFlags = [
# adding qt6 to buildInputs would result in error: detected mismatched Qt dependencies
"-DCMAKE_PREFIX_PATH=${qt6.qtbase.dev}"
"-DENABLE_QT4=0"
"-DENABLE_QT6=1"
];
nativeBuildInputs = [
cmake
extra-cmake-modules
];
buildInputs = [
fcitx5
qtx11extras
libxcb
libXdmcp
];
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;
};
}