about summary refs log tree commit diff
path: root/pkgs/tools/inputmethods
diff options
context:
space:
mode:
authorMatthieu Coudron <teto@users.noreply.github.com>2021-01-10 15:26:27 +0100
committerGitHub <noreply@github.com>2021-01-10 15:26:27 +0100
commit9f8b7cb4a8948afe0701e5d717a4ee9cbf38163c (patch)
tree77ff7c34fd8264a03852d962f5b108139b14bc42 /pkgs/tools/inputmethods
parentf3c1e795bb05bbbd05eefbf4e9c21a741785d8d7 (diff)
parent4ef64822612839af18c863192e5f4ddc638fd96b (diff)
Merge pull request #104658 from poscat0x04/add-fcitx5
Add fcitx5
Diffstat (limited to 'pkgs/tools/inputmethods')
-rw-r--r--pkgs/tools/inputmethods/fcitx5/default.nix100
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix76
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix60
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix71
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix40
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix46
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix47
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix38
-rw-r--r--pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix38
-rw-r--r--pkgs/tools/inputmethods/fcitx5/with-addons.nix18
10 files changed, 534 insertions, 0 deletions
diff --git a/pkgs/tools/inputmethods/fcitx5/default.nix b/pkgs/tools/inputmethods/fcitx5/default.nix
new file mode 100644
index 0000000000000..5fa85064fa3f8
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/default.nix
@@ -0,0 +1,100 @@
+{ stdenv
+, fetchurl
+, fetchFromGitHub
+, pkg-config
+, cmake
+, extra-cmake-modules
+, cairo
+, cldr-emoji-annotation
+, pango
+, fribidi
+, fmt
+, wayland
+, systemd
+, wayland-protocols
+, json_c
+, isocodes
+, xkeyboard_config
+, enchant
+, gdk-pixbuf
+, libGL
+, libevent
+, libuuid
+, libselinux
+, libXdmcp
+, libsepol
+, libxkbcommon
+, libthai
+, libdatrie
+, xcbutilkeysyms
+, pcre
+, xcbutilwm
+, xcb-imdkit
+, libxkbfile
+}:
+let
+  enDictVer = "20121020";
+  enDict = fetchurl {
+    url = "https://download.fcitx-im.org/data/en_dict-${enDictVer}.tar.gz";
+    sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "fcitx5";
+  version = "5.0.3";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5";
+    rev = version;
+    sha256 = "QYMH0WbhHqDKUvpj1VOB8U5sbBD89H6moLFkQBJijZA=";
+  };
+
+  prePatch = ''
+    ln -s ${enDict} src/modules/spell/dict/$(stripHash ${enDict})
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    pkg-config
+  ];
+
+  buildInputs = [
+    fmt
+    isocodes
+    cairo
+    enchant
+    pango
+    libthai
+    libdatrie
+    fribidi
+    systemd
+    gdk-pixbuf
+    wayland
+    wayland-protocols
+    cldr-emoji-annotation
+    json_c
+    libGL
+    libevent
+    libuuid
+    libselinux
+    libsepol
+    libXdmcp
+    libxkbcommon
+    pcre
+    xcbutilwm
+    xcbutilkeysyms
+    xcb-imdkit
+    xkeyboard_config
+    libxkbfile
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Next generation of fcitx";
+    homepage = "https://github.com/fcitx/fcitx5";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix
new file mode 100644
index 0000000000000..2b8a07537b0bd
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix
@@ -0,0 +1,76 @@
+{ stdenv
+, mkDerivation
+, fetchurl
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, boost
+, libime
+, fcitx5
+, fcitx5-qt
+, fcitx5-lua
+, qtwebengine
+, opencc
+, curl
+, fmt
+, luaSupport ? true
+}:
+
+let
+  pyStrokeVer = "20121124";
+  pyStroke = fetchurl {
+    url = "http://download.fcitx-im.org/data/py_stroke-${pyStrokeVer}.tar.gz";
+    sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf";
+  };
+  pyTableVer = "20121124";
+  pyTable = fetchurl {
+    url = "http://download.fcitx-im.org/data/py_table-${pyTableVer}.tar.gz";
+    sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522";
+  };
+in
+
+mkDerivation rec {
+  pname = "fcitx5-chinese-addons";
+  version = "5.0.2";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-chinese-addons";
+    rev = version;
+    sha256 = "11UIMrwzZqO8nrQx5oubeoQN8hspL1mvHw5Dc9sVOqQ=";
+  };
+
+  cmakeFlags = [
+    "-DUSE_WEBKIT=off"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    boost
+    fcitx5-lua
+  ];
+
+  prePatch = ''
+    ln -s ${pyStroke} modules/pinyinhelper/$(stripHash ${pyStroke})
+    ln -s ${pyTable} modules/pinyinhelper/$(stripHash ${pyTable})
+  '';
+
+  buildInputs = [
+    fcitx5
+    fcitx5-qt
+    libime
+    curl
+    opencc
+    qtwebengine
+    fmt
+  ] ++ stdenv.lib.optional luaSupport fcitx5-lua;
+
+  meta = with stdenv.lib; {
+    description = "Addons related to Chinese, including IME previous bundled inside fcitx4";
+    homepage = "https://github.com/fcitx/fcitx5-chinese-addons";
+    license = with licenses; [ gpl2Plus lgpl21Plus ];
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix
new file mode 100644
index 0000000000000..e5b55c26cd4b1
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix
@@ -0,0 +1,60 @@
+{ stdenv
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, fcitx5-qt
+, qtx11extras
+, kwidgetsaddons
+, kdeclarative
+, kirigami2
+, isocodes
+, xkeyboardconfig
+, libxkbfile
+, libXdmcp
+, kcmSupport ? true
+}:
+
+mkDerivation rec {
+  pname = "fcitx5-configtool";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-configtool";
+    rev = version;
+    sha256 = "npSqd0R6bqKc+JxYCGcfVzgNLpuLtnHq6zM58smZ8/I=";
+  };
+
+  cmakeFlags = [
+    "-DKDE_INSTALL_USE_QT_SYS_PATHS=ON"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    fcitx5
+    fcitx5-qt
+    qtx11extras
+    kirigami2
+    isocodes
+    xkeyboardconfig
+    libxkbfile
+    libXdmcp
+  ] ++ stdenv.lib.optionals kcmSupport [
+    kdeclarative
+    kwidgetsaddons
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Configuration Tool for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-configtool";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix
new file mode 100644
index 0000000000000..ce157f7925355
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix
@@ -0,0 +1,71 @@
+{ stdenv
+, fetchurl
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, gobject-introspection
+, gtk2
+, gtk3
+, pcre
+, libuuid
+, libselinux
+, libsepol
+, libthai
+, libdatrie
+, libXdmcp
+, libxkbcommon
+, epoxy
+, dbus
+, at-spi2-core
+, libXtst
+, withGTK2 ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-gtk";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-gtk";
+    rev = version;
+    sha256 = "rkusIqMRQMTjcpJR335as1xUQrzD9dLVB/wrLstPXPY=";
+  };
+
+  cmakeFlags = [
+    "-DGOBJECT_INTROSPECTION_GIRDIR=share/gir-1.0"
+    "-DGOBJECT_INTROSPECTION_TYPELIBDIR=lib/girepository-1.0"
+  ] ++ stdenv.lib.optional (! withGTK2) "-DENABLE_GTK2_IM_MODULE=off";
+
+  buildInputs = [
+    gtk3
+    gobject-introspection
+    fcitx5
+    pcre
+    libuuid
+    libselinux
+    libsepol
+    libthai
+    libdatrie
+    libXdmcp
+    libxkbcommon
+    epoxy
+    dbus
+    at-spi2-core
+    libXtst
+  ] ++ stdenv.lib.optional withGTK2 gtk2;
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Fcitx5 gtk im module and glib based dbus client library";
+    homepage = "https://github.com/fcitx/fcitx5-gtk";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix
new file mode 100644
index 0000000000000..310cae035ba7b
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix
@@ -0,0 +1,40 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, lua5_3
+, luaPackage ? lua5_3
+, gettext
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-lua";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-lua";
+    rev = "${version}";
+    sha256 = "OiTk9ldqBqF7WT1KY71hacLD6OQQNO05F7+cSXlli40=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    fcitx5
+    luaPackage
+    gettext
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Lua support for Fcitx 5";
+    homepage = "https://github.com/fcitx/fcitx5-lua";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix
new file mode 100644
index 0000000000000..580082096ece8
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, qtx11extras
+, libxcb
+, libXdmcp
+}:
+
+mkDerivation rec {
+  pname = "fcitx5-qt";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-qt";
+    rev = version;
+    sha256 = "BVOumk2xj3vmwmm4KwiktQhWyTuUA2OFwYXNR6HgwyM=";
+  };
+
+  cmakeFlags = [
+    "-DENABLE_QT4=0"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    fcitx5
+    qtx11extras
+    libxcb
+    libXdmcp
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Fcitx5 Qt Library";
+    homepage = "https://github.com/fcitx/fcitx5-qt";
+    license = with licenses; [ lgpl21Plus bsd3 ];
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
new file mode 100644
index 0000000000000..9992e19875893
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchurl
+, fetchFromGitHub
+, pkgconfig
+, cmake
+, extra-cmake-modules
+, gettext
+, fcitx5
+, librime
+, brise
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-rime";
+  version = "5.0.2";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-rime";
+    rev = version;
+    sha256 = "cVCTsD1Iw6OtyYFpxff3ix2CubRTnDaBevAYA4I9Ai8=";
+  };
+
+  cmakeFlags = [
+    "-DRIME_DATA_DIR=${brise}/share/rime-data"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    pkgconfig
+    gettext
+  ];
+
+  buildInputs = [
+    fcitx5
+    librime
+  ];
+
+  meta = with stdenv.lib; {
+    description = "RIME support for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-rime";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix
new file mode 100644
index 0000000000000..7dcca7e130d0c
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, gettext
+, libime
+, boost
+, fcitx5
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-table-extra";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-table-extra";
+    rev = version;
+    sha256 = "UHhiWm2Khh6JBB9jz0ZKFofkAJPlqn6SqHeK9etoaxs=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    gettext
+    libime
+    boost
+    fcitx5
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Extra table for Fcitx, including Boshiamy, Zhengma, Cangjie, and Quick";
+    homepage = "https://github.com/fcitx/fcitx5-table-extra";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix
new file mode 100644
index 0000000000000..eb9d93d6e7ce7
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, gettext
+, libime
+, boost
+, fcitx5
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-table-other";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-table-other";
+    rev = version;
+    sha256 = "hQlrjDPImDof2+3/uOtTdJ27cInevbxH9B+lNwquKbs=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    gettext
+    libime
+    boost
+    fcitx5
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Some other tables for Fcitx";
+    homepage = "https://github.com/fcitx/fcitx5-table-other";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/fcitx5/with-addons.nix b/pkgs/tools/inputmethods/fcitx5/with-addons.nix
new file mode 100644
index 0000000000000..854020effeaa8
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/with-addons.nix
@@ -0,0 +1,18 @@
+{ symlinkJoin, makeWrapper, fcitx5, fcitx5-lua, fcitx5-configtool, fcitx5-qt, fcitx5-gtk, addons ? [] }:
+
+symlinkJoin {
+  name = "fcitx5-with-addons-${fcitx5.version}";
+
+  paths = [ fcitx5 fcitx5-configtool fcitx5-lua fcitx5-qt fcitx5-gtk ] ++ addons;
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/fcitx5 \
+      --prefix FCITX_ADDON_DIRS : "$out/lib/fcitx5" \
+      --suffix XDG_DATA_DIRS : "$out/share" \
+      --suffix PATH : "$out/bin"
+  '';
+
+  meta = fcitx5.meta;
+}