From c614860e56fa5a6223ba9f37d95eeea1dc20b2aa Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 7 Jan 2023 21:45:46 -0800 Subject: [PATCH] Use fcitx5-anthy --- fcitx5-anthy.nix | 26 ++++++++++++++++++++++++++ fcitx5.nix | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 fcitx5-anthy.nix diff --git a/fcitx5-anthy.nix b/fcitx5-anthy.nix new file mode 100644 index 0000000..7274805 --- /dev/null +++ b/fcitx5-anthy.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, cmake, extra-cmake-modules, pkg-config, fcitx5, anthy, gettext }: + +stdenv.mkDerivation rec { + pname = "fcitx5-anthy"; + version = "5.0.13"; + + src = fetchurl { + url = "https://download.fcitx-im.org/fcitx5/fcitx5-anthy/${pname}-${version}.tar.xz"; + sha256 = "EGpyYiNalm4En3Oa++hyOSPLhjbkVcDyZt3LqamfSOI="; + }; + + nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ]; + buildInputs = [ fcitx5 anthy gettext ]; + + preinstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx5} $out + ''; + + meta = with lib; { + description = "Anthy Wrapper for Fcitx5"; + homepage = "https://github.com/fcitx/fcitx5-anthy"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/fcitx5.nix b/fcitx5.nix index 2b1bfcc..20e055a 100644 --- a/fcitx5.nix +++ b/fcitx5.nix @@ -18,7 +18,7 @@ in { i18n.inputMethod = { enabled = "fcitx5"; - fcitx5.addons = with pkgs.fcitx-engines; [ anthy ]; + fcitx5.addons = [ (pkgs.callPackage ./fcitx5-anthy.nix {}) ]; }; home.file = {