fcitx: refactor (#16858)
This commit is contained in:
parent
60887fa193
commit
1349cd4e8d
@ -4,7 +4,7 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.i18n.inputMethod.fcitx;
|
cfg = config.i18n.inputMethod.fcitx;
|
||||||
fcitxPackage = pkgs.fcitx-with-plugins.override { plugins = cfg.engines; };
|
fcitxPackage = pkgs.fcitx.override { plugins = cfg.engines; };
|
||||||
fcitxEngine = types.package // {
|
fcitxEngine = types.package // {
|
||||||
name = "fcitx-engine";
|
name = "fcitx-engine";
|
||||||
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isFcitxEngine"] false x);
|
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isFcitxEngine"] false x);
|
||||||
|
@ -1,51 +1,11 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, cmake, intltool, gettext
|
{ callPackage, plugins ? [] }:
|
||||||
, libxml2, enchant, isocodes, icu, libpthreadstubs
|
|
||||||
, pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
|
|
||||||
, dbus, gtk2, gtk3, qt4, kde5
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
name = "fcitx-${version}";
|
unwrapped = callPackage ./unwrapped.nix { };
|
||||||
version = "4.2.9.1";
|
wrapped = callPackage ./wrapper.nix {
|
||||||
|
plugins = plugins;
|
||||||
src = fetchurl {
|
fcitx = unwrapped;
|
||||||
url = "http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz";
|
|
||||||
sha256 = "0xvcmm4yi7kagf55d0yl3ql5ssbkm9410fwbz3kd988pchichdsk";
|
|
||||||
};
|
};
|
||||||
|
in if plugins == []
|
||||||
postUnpack = ''
|
then unwrapped
|
||||||
ln -s ${kde5.extra-cmake-modules}/share/ECM/modules/ECMFindModuleHelpers.cmake \
|
else wrapped
|
||||||
$sourceRoot/cmake/
|
|
||||||
'';
|
|
||||||
|
|
||||||
patches = [ ./fcitx-ecm.patch ];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace src/frontend/qt/CMakeLists.txt \
|
|
||||||
--replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
cmake enchant gettext isocodes pkgconfig intltool icu
|
|
||||||
libpthreadstubs libXau libXdmcp libxkbfile libxkbcommon libxml2
|
|
||||||
dbus cairo gtk2 gtk3 pango qt4
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = ''
|
|
||||||
-DENABLE_QT_IM_MODULE=ON
|
|
||||||
-DENABLE_GTK2_IM_MODULE=ON
|
|
||||||
-DENABLE_GTK3_IM_MODULE=ON
|
|
||||||
-DENABLE_GIR=OFF
|
|
||||||
-DENABLE_OPENCC=OFF
|
|
||||||
-DENABLE_PRESAGE=OFF
|
|
||||||
-DENABLE_XDGAUTOSTART=OFF
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
|
||||||
homepage = "https://github.com/fcitx/fcitx";
|
|
||||||
description = "A Flexible Input Method Framework";
|
|
||||||
license = licenses.gpl2;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
maintainers = with maintainers; [ ericsagnes ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
51
pkgs/tools/inputmethods/fcitx/unwrapped.nix
Normal file
51
pkgs/tools/inputmethods/fcitx/unwrapped.nix
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{ stdenv, fetchurl, pkgconfig, cmake, intltool, gettext
|
||||||
|
, libxml2, enchant, isocodes, icu, libpthreadstubs
|
||||||
|
, pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
|
||||||
|
, dbus, gtk2, gtk3, qt4, kde5
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "fcitx-${version}";
|
||||||
|
version = "4.2.9.1";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz";
|
||||||
|
sha256 = "0xvcmm4yi7kagf55d0yl3ql5ssbkm9410fwbz3kd988pchichdsk";
|
||||||
|
};
|
||||||
|
|
||||||
|
postUnpack = ''
|
||||||
|
ln -s ${kde5.extra-cmake-modules}/share/ECM/modules/ECMFindModuleHelpers.cmake \
|
||||||
|
$sourceRoot/cmake/
|
||||||
|
'';
|
||||||
|
|
||||||
|
patches = [ ./fcitx-ecm.patch ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace src/frontend/qt/CMakeLists.txt \
|
||||||
|
--replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
cmake enchant gettext isocodes pkgconfig intltool icu
|
||||||
|
libpthreadstubs libXau libXdmcp libxkbfile libxkbcommon libxml2
|
||||||
|
dbus cairo gtk2 gtk3 pango qt4
|
||||||
|
];
|
||||||
|
|
||||||
|
cmakeFlags = ''
|
||||||
|
-DENABLE_QT_IM_MODULE=ON
|
||||||
|
-DENABLE_GTK2_IM_MODULE=ON
|
||||||
|
-DENABLE_GTK3_IM_MODULE=ON
|
||||||
|
-DENABLE_GIR=OFF
|
||||||
|
-DENABLE_OPENCC=OFF
|
||||||
|
-DENABLE_PRESAGE=OFF
|
||||||
|
-DENABLE_XDGAUTOSTART=OFF
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = "https://github.com/fcitx/fcitx";
|
||||||
|
description = "A Flexible Input Method Framework";
|
||||||
|
license = licenses.gpl2;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
maintainers = with maintainers; [ ericsagnes ];
|
||||||
|
};
|
||||||
|
}
|
@ -1496,7 +1496,9 @@ in
|
|||||||
|
|
||||||
fatsort = callPackage ../tools/filesystems/fatsort { };
|
fatsort = callPackage ../tools/filesystems/fatsort { };
|
||||||
|
|
||||||
fcitx = callPackage ../tools/inputmethods/fcitx { };
|
fcitx = callPackage ../tools/inputmethods/fcitx {
|
||||||
|
plugins = [];
|
||||||
|
};
|
||||||
|
|
||||||
fcitx-engines = recurseIntoAttrs {
|
fcitx-engines = recurseIntoAttrs {
|
||||||
|
|
||||||
@ -1520,10 +1522,6 @@ in
|
|||||||
|
|
||||||
fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };
|
fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };
|
||||||
|
|
||||||
fcitx-with-plugins = callPackage ../tools/inputmethods/fcitx/wrapper.nix {
|
|
||||||
plugins = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fcppt = callPackage ../development/libraries/fcppt/default.nix { };
|
fcppt = callPackage ../development/libraries/fcppt/default.nix { };
|
||||||
|
|
||||||
fcron = callPackage ../tools/system/fcron { };
|
fcron = callPackage ../tools/system/fcron { };
|
||||||
|
Loading…
Reference in New Issue
Block a user