diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/inputmethods')
84 files changed, 3583 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix b/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix new file mode 100644 index 000000000000..f337d4648d57 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix @@ -0,0 +1,18 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "anthy-9100h"; + + meta = with lib; { + description = "Hiragana text to Kana Kanji mixed text Japanese input method"; + homepage = "https://anthy.osdn.jp/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ericsagnes ]; + platforms = platforms.linux; + }; + + src = fetchurl { + url = "mirror://osdn/anthy/37536/${name}.tar.gz"; + sha256 = "0ism4zibcsa5nl77wwi12vdsfjys3waxcphn1p5s7d0qy1sz0mnj"; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix b/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix new file mode 100644 index 000000000000..73344ca26900 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchFromGitHub, python3Packages }: + +python3Packages.buildPythonPackage rec { + pname = "evdevremapkeys"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "philipl"; + repo = pname; + rev = "68fb618b8142e1b45d7a1e19ea9a5a9bbb206144"; + sha256 = "0c9slflakm5jqd8s1zpxm7gmrrk0335m040d7m70hnsak42jvs2f"; + }; + + propagatedBuildInputs = with python3Packages; [ + pyyaml + pyxdg + python-daemon + evdev + ]; + + # hase no tests + doCheck = false; + + pythonImportsCheck = [ "evdevremapkeys" ]; + + meta = with lib; { + homepage = "https://github.com/philipl/evdevremapkeys"; + description = "Daemon to remap events on linux input devices"; + license = licenses.mit; + maintainers = [ maintainers.q3k ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix b/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix new file mode 100644 index 000000000000..66f264bc7a36 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix @@ -0,0 +1,24 @@ +{ lib, rustPlatform, fetchFromGitHub }: + +rustPlatform.buildRustPackage rec { + pname = "evscript"; + version = "git-${builtins.substring 0 7 src.rev}"; + + src = fetchFromGitHub { + owner = "myfreeweb"; + repo = pname; + rev = "47f86f0d15add2af785ea1ff47f24d130026d1b4"; + sha256 = "1xm8297k0d8d0aq7fxgmibr4qva4d02cb6gnnlzq77jcmnknxv14"; + }; + + cargoSha256 = "1dcyhxfyq0nrjl05g1s9pjkg7vqw63wbdhlskrdcvxncmci3s7rp"; + verifyCargoDeps = true; + + meta = with lib; { + homepage = "https://github.com/myfreeweb/${pname}"; + description = "A tiny sandboxed Dyon scripting environment for evdev input devices"; + license = licenses.unlicense; + maintainers = with maintainers; [ milesbreslin ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix new file mode 100644 index 000000000000..3fe5a59175f2 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, anthy, gettext, pkg-config }: + +stdenv.mkDerivation rec { + pname = "fcitx-anthy"; + version = "0.2.3"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-anthy/${pname}-${version}.tar.xz"; + sha256 = "01jx7wwq0mifqrzkswfglqhwkszbfcl4jinxgdgqx9kc6mb4k6zd"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx anthy gettext ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + description = "Fcitx Wrapper for anthy"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix new file mode 100644 index 000000000000..defbe616ab22 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, gettext, libchewing, pkg-config }: + +stdenv.mkDerivation rec { + pname = "fcitx-chewing"; + version = "0.2.3"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-chewing/${pname}-${version}.tar.xz"; + sha256 = "1w5smp5zvjx681cp1znjypyr9sw5x6v0wnsk8a7ncwxi9q9wf4xk"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx gettext libchewing ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-chewing"; + downloadPage = "http://download.fcitx-im.org/fcitx-chewing/"; + description = "Fcitx engine for chewing"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix new file mode 100644 index 000000000000..d84407e982b0 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, gettext, curl }: + +stdenv.mkDerivation rec { + pname = "fcitx-cloudpinyin"; + version = "0.3.7"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-cloudpinyin/${pname}-${version}.tar.xz"; + sha256 = "0ai347wv3qdjzcbh0j9hdjpzwvh2kk57324xbxq37nzagrdgg5x0"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx gettext curl ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace po/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + description = "A standalone module for fcitx that uses web API to provide better pinyin result"; + homepage = "https://github.com/fcitx/fcitx-cloudpinyin"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix new file mode 100644 index 000000000000..d99a0228e226 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, libhangul, gettext, pkg-config }: + +stdenv.mkDerivation rec { + pname = "fcitx-hangul"; + version = "0.3.1"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-hangul/${pname}-${version}.tar.xz"; + sha256 = "0ds4071ljq620w7vnprm2jl8zqqkw7qsxvzbjapqak4jarczvmbd"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx libhangul gettext ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-hangul"; + downloadPage = "http://download.fcitx-im.org/fcitx-hangul/"; + description = "Fcitx Wrapper for hangul"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch new file mode 100644 index 000000000000..84dd5fc8f462 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch @@ -0,0 +1,16 @@ +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -9,12 +9,7 @@ char* FcitxLibPinyinGetSysPath(LIBPINYIN_LANGUAGE_TYPE type) + #ifdef LIBPINYIN_TOOLS_FOUND + if (type == LPLT_Simplified) { + #endif +- /* portable detect here */ +- if (getenv("FCITXDIR")) { +- syspath = fcitx_utils_get_fcitx_path_with_filename("datadir", "libpinyin/data"); +- } else { +- syspath = strdup(LIBPINYIN_PKGDATADIR "/data"); +- } ++ syspath = strdup(LIBPINYIN_PKGDATADIR "/data"); + #ifdef LIBPINYIN_TOOLS_FOUND + } + else { diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix new file mode 100644 index 000000000000..2af4061ae046 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix @@ -0,0 +1,53 @@ +{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, gettext, libpinyin, glib, pcre, dbus, qtwebengine, qtbase, fcitx-qt5 }: + +stdenv.mkDerivation rec { + pname = "fcitx-libpinyin"; + version = "0.5.3"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-libpinyin/${pname}-${version}.tar.xz"; + sha256 = "196c229ckib3xvafkk4n3n3jk9rpksfcjsbbwka6a9k2f34qrjj6"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx-qt5 qtbase qtwebengine.dev fcitx gettext libpinyin glib pcre dbus ]; + + # With a typical installation via NixOS option i18n.inputMethod.fcitx.engines, + # the FCITXDIR environment variable is set to $out of fcitx-with-plugins, + # which leads to an incorrect path for pinyin data. + # + # It is impossible or difficult to fix this issue without patching. We want + # FCITXDIR to point into libpinyin, which is currently not symlinked within + # fcitx-with-plugins (only fcitx-libpinyin is symlinked). Also, FCITXDIR + # doesn't accept multiple directories. + patches = [ ./datapath.patch ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace dictmanager/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + preBuild = let + ZHUYIN_DATA_FILE_NAME = "model.text.20161206.tar.gz"; + store_path = fetchurl { + url = "https://download.fcitx-im.org/data/${ZHUYIN_DATA_FILE_NAME}"; + sha256 = "017p11si1b7bkwx36xaybq5a9icq1pd7x1jbymqw92akfgjj8w2w"; + }; + in + '' + cp -rv ${store_path} $NIX_BUILD_TOP/$name/data/${ZHUYIN_DATA_FILE_NAME} + ''; + + meta = with lib; { + isFcitxEngine = true; + description = "Fcitx Wrapper for libpinyin, Library to deal with pinyin"; + homepage = "https://github.com/fcitx/fcitx-libpinyin"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ericsagnes ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix new file mode 100644 index 000000000000..31a735559884 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, gettext, m17n_lib, m17n_db, pkg-config }: + +stdenv.mkDerivation rec { + pname = "fcitx-m17n"; + version = "0.2.4"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-m17n/${pname}-${version}.tar.xz"; + sha256 = "15s52h979xz967f8lm0r0qkplig2w3wjck1ymndbg9kvj25ib0ng"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx gettext m17n_lib m17n_db ]; + + preInstall = '' + substituteInPlace im/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-m17n"; + downloadPage = "http://download.fcitx-im.org/fcitx-table-other/"; + description = "Fcitx wrapper for m17n"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix new file mode 100644 index 000000000000..94a7d2444bf9 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix @@ -0,0 +1,113 @@ +{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, gyp, which, ninja, + python, pkg-config, protobuf, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese, + fcitx, gettext }: +let + japanese_usage_dictionary = fetchFromGitHub { + owner = "hiroyuki-komatsu"; + repo = "japanese-usage-dictionary"; + rev = "e5b3425575734c323e1d947009dd74709437b684"; + sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm"; + }; + icons = fetchurl { + url = "http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz"; + sha256 = "10bdjn481jsh32vll7r756l392anz44h6207vjqwby3rplk31np1"; + }; +in clangStdenv.mkDerivation rec { + name = "fcitx-mozc-${version}"; + version = "2.23.2815.102"; + + src = fetchFromGitHub { + owner = "google"; + repo = "mozc"; + rev = "afb03ddfe72dde4cf2409863a3bfea160f7a66d8"; + sha256 = "0w2dy2j9x5nc7x3g95j17r3m60vbfyn5j617h7js9xryv33yzpgx"; + }; + + nativeBuildInputs = [ gyp which ninja python pkg-config qt5.wrapQtAppsHook ]; + buildInputs = [ protobuf gtk2 zinnia qt5.qtbase libxcb fcitx gettext ]; + + postUnpack = '' + rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/ + ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary + tar -xzf ${icons} -C $sourceRoot/src + ''; + + patch_version = "${version}.1"; + patches = [ + (fetchpatch rec { + name = "fcitx-mozc-${patch_version}.patch"; + url = "https://download.fcitx-im.org/fcitx-mozc/${name}"; + sha256 = "0a8q3vzcbai1ccdrl6qdb81gvbw8aby4lqkl6qs9hg68p6zg42hg"; + }) + # https://github.com/google/mozc/pull/444 - fix for gcc8 STL + (fetchpatch { + url = "https://github.com/google/mozc/commit/82d38f929882a9c62289b179c6fe41efed249987.patch"; + sha256 = "07cja1b7qfsd3i76nscf1zwiav74h7d6h2g9g2w4bs3h1mc9jwla"; + }) + # Support dates after 2019 + (fetchpatch { + url = "https://salsa.debian.org/debian/mozc/-/raw/master/debian/patches/add_support_new_japanese_era.patch"; + sha256 = "1dsiiglrmm8i8shn2hv0j2b8pv6miysjrimj4569h606j4lwmcw2"; + }) + ]; + + postPatch = '' + substituteInPlace src/unix/fcitx/mozc.conf \ + --replace "/usr/share/fcitx/mozc/icon/mozc.png" "mozc" + ''; + + configurePhase = '' + export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_fcitx5=0 zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model" + cd src && python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc + ''; + + buildPhase = '' + PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \ + server/server.gyp:mozc_server \ + gui/gui.gyp:mozc_tool \ + unix/fcitx/fcitx.gyp:fcitx-mozc + ''; + + installPhase = '' + install -d $out/share/licenses/fcitx-mozc + head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx-mozc/LICENSE + install -m 644 data/installer/*.html $out/share/licenses/fcitx-mozc/ + + install -d $out/share/doc/mozc + install -m 644 data/installer/*.html $out/share/doc/mozc/ + + install -D -m 755 out_linux/Release/mozc_server $out/lib/mozc/mozc_server + install -m 755 out_linux/Release/mozc_tool $out/lib/mozc/mozc_tool + + wrapQtApp $out/lib/mozc/mozc_tool + + install -D -m 755 out_linux/Release/fcitx-mozc.so $out/lib/fcitx/fcitx-mozc.so + install -D -m 644 unix/fcitx/fcitx-mozc.conf $out/share/fcitx/addon/fcitx-mozc.conf + install -D -m 644 unix/fcitx/mozc.conf $out/share/fcitx/inputmethod/mozc.conf + + install -d $out/share/doc/mozc + + for mofile in out_linux/Release/gen/unix/fcitx/po/*.mo + do + filename=`basename $mofile` + lang=$filename.mo + install -D -m 644 "$mofile" "$out/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo" + done + + install -d $out/share/fcitx/imicon + install -m 644 fcitx-mozc-icons/mozc.png $out/share/fcitx/imicon/mozc.png + install -d $out/share/fcitx/mozc/icon + install -m 644 fcitx-mozc-icons/*.png $out/share/fcitx/mozc/icon/ + ''; + + meta = with lib; { + isFcitxEngine = true; + description = "Fcitx engine for Google japanese input method"; + homepage = "https://github.com/google/mozc"; + downloadPage = "http://download.fcitx-im.org/fcitx-mozc/"; + license = licenses.free; + platforms = platforms.linux; + maintainers = with maintainers; [ gebner ericsagnes ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix new file mode 100644 index 000000000000..42c02fe003d7 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, librime, brise, hicolor-icon-theme }: + +stdenv.mkDerivation rec { + pname = "fcitx-rime"; + version = "0.3.2"; + + src = fetchurl { + url = "https://download.fcitx-im.org/fcitx-rime/${pname}-${version}.tar.xz"; + sha256 = "0bd8snfa6jr8dhnm0s0z021iryh5pbaf7p15rhkgbigw2pssczpr"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx librime brise hicolor-icon-theme ]; + + # cmake cannont automatically find our nonstandard brise install location + cmakeFlags = [ "-DRIME_DATA_DIR=${brise}/share/rime-data" ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-rime"; + downloadPage = "https://download.fcitx-im.org/fcitx-rime/"; + description = "Rime support for Fcitx"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ sifmelcara ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix new file mode 100644 index 000000000000..c1a1994a9078 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, fcitx, libskk, skk-dicts }: + +stdenv.mkDerivation { + pname = "fcitx-skk"; + version = "0.1.4"; + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx-skk"; + rev = "f66d0f56a40ff833edbfa68a4be4eaa2e93d0e3d"; + sha256 = "1yl2syqrk212h26vzzkwl19fyp71inqmsli9411h4n2hbcp6m916"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx libskk skk-dicts ]; + + cmakeFlags = [ "-DSKK_DEFAULT_PATH=${skk-dicts}/share/SKK-JISYO.combined" + "-DENABLE_QT=FALSE" + ]; + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace po/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + description = "A SKK style input method engine for fcitx"; + longDescription = '' + Fcitx-skk is an input method engine for fcitx. It is based on libskk and thus + provides basic features of SKK Japanese input method such as kana-to-kanji conversion, + new word registration, completion, numeric conversion, abbrev mode, kuten input, + hankaku-katakana input, and re-conversion. + ''; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ yuriaisaka ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix new file mode 100644 index 000000000000..399d426dc3e8 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, gettext }: + +stdenv.mkDerivation rec { + pname = "fcitx-table-extra"; + version = "0.3.8"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-table-extra/${pname}-${version}.tar.xz"; + sha256 = "c91bb19c1a7b53c5339bf2f75ae83839020d337990f237a8b9bc0f4416c120ef"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ fcitx gettext ]; + + preInstall = '' + substituteInPlace tables/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-table-extra"; + downloadPage = "http://download.fcitx-im.org/fcitx-table-extra/"; + description = "Provides extra table for Fcitx, including Boshiamy, Zhengma, Cangjie, and Quick"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ linc01n ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix new file mode 100644 index 000000000000..410569b7afbd --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, gettext }: + +stdenv.mkDerivation rec { + pname = "fcitx-table-other"; + version = "0.2.4"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-table-other/${pname}-${version}.tar.xz"; + sha256 = "1di60lr6l5k2sdwi3yrc0hl89j2k0yipayrsn803vd040w1fgfhq"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ fcitx gettext ]; + + preInstall = '' + substituteInPlace tables/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-table-other"; + downloadPage = "http://download.fcitx-im.org/fcitx-table-other/"; + description = "Provides some other tables for Fcitx"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix new file mode 100644 index 000000000000..5422efb9d38d --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, cmake, fcitx, gettext, pkg-config }: + +stdenv.mkDerivation rec { + pname = "fcitx-unikey"; + version = "0.2.5"; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-unikey/${pname}-${version}.tar.xz"; + sha256 = "063vc29v7ycaai98v3z4q319sv9sm91my17pmhblw1vifxnw02wf"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ fcitx gettext ]; + + NIX_CFLAGS_COMPILE = "-Wno-narrowing"; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with lib; { + isFcitxEngine = true; + homepage = "https://github.com/fcitx/fcitx-unikey"; + downloadPage = "http://download.fcitx-im.org/fcitx-table-other/"; + description = "Fcitx wrapper for unikey"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix new file mode 100644 index 000000000000..fc28a08b4b79 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix @@ -0,0 +1,11 @@ +{ callPackage, plugins ? [] }: + +let + unwrapped = callPackage ./unwrapped.nix { }; + wrapped = callPackage ./wrapper.nix { + plugins = plugins; + fcitx = unwrapped; + }; +in if plugins == [] + then unwrapped + else wrapped diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix new file mode 100644 index 000000000000..6e0c48d0610c --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, makeWrapper, pkg-config, cmake, fcitx, gtk3, isocodes, gnome3 }: + +stdenv.mkDerivation rec { + name = "fcitx-configtool-0.4.10"; + + meta = with lib; { + description = "GTK-based config tool for Fcitx"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ cdepillabout ]; + }; + + src = fetchurl { + url = "https://download.fcitx-im.org/fcitx-configtool/${name}.tar.xz"; + sha256 = "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"; + }; + + nativeBuildInputs = [ cmake pkg-config makeWrapper ]; + buildInputs = [ fcitx isocodes gtk3 gnome3.adwaita-icon-theme ]; + + # Patch paths to `fcitx-remote` + prePatch = '' + for f in gtk{3,}/config_widget.c; do + substituteInPlace $f \ + --replace 'EXEC_PREFIX "/bin/fcitx-remote"' '"${fcitx}/bin/fcitx-remote"' + done + ''; + + preFixup = '' + wrapProgram $out/bin/fcitx-config-gtk3 \ + --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS"; + ''; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix new file mode 100644 index 000000000000..391c2c7add2b --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix @@ -0,0 +1,38 @@ +{ lib, mkDerivation, fetchFromGitLab +, cmake +, extra-cmake-modules +, fcitx +, pkg-config +, qtbase +}: + +mkDerivation rec { + pname = "fcitx-qt5"; + version = "1.2.3"; + + src = fetchFromGitLab { + owner = "fcitx"; + repo = pname; + rev = version; + sha256 = "0860v3rxsh054wkkbawvyin5mk0flp4cwfcpmcpq147lvdm5lq2i"; + }; + + nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ]; + + buildInputs = [ fcitx qtbase ]; + + preConfigure = '' + substituteInPlace platforminputcontext/CMakeLists.txt \ + --replace \$"{CMAKE_INSTALL_QTPLUGINDIR}" $out/${qtbase.qtPluginPrefix} + substituteInPlace quickphrase-editor/CMakeLists.txt \ + --replace \$"{FCITX4_ADDON_INSTALL_DIR}" $out/lib/fcitx + ''; + + meta = with lib; { + homepage = "https://gitlab.com/fcitx/fcitx-qt5"; + description = "Qt5 IM Module for Fcitx"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch b/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch new file mode 100644 index 000000000000..90c9c79aa73d --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch @@ -0,0 +1,42 @@ +diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake +index 7c182e6a..5537595e 100644 +--- a/cmake/FindEnchant.cmake ++++ b/cmake/FindEnchant.cmake +@@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) + endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) + + find_package(PkgConfig) +-pkg_check_modules(PC_ENCHANT enchant) ++pkg_check_modules(PC_ENCHANT enchant-2) + + find_path(ENCHANT_INCLUDE_DIR + NAMES enchant.h +@@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR + PATH_SUFFIXES "enchant") + + find_library(ENCHANT_LIBRARIES +- NAMES enchant ++ NAMES enchant-2 + HINTS ${PC_ENCHANT_LIBRARY_DIRS}) + + if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) +@@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) + #include <stdlib.h> + #include <stddef.h> + #include <string.h> +- #include <enchant/enchant.h> ++ #include <enchant-2/enchant.h> + + EnchantBroker *enchant_broker_init(); + char **enchant_dict_suggest(EnchantDict *dict, const char *str, +@@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + endif() + ++if(ENCHANT_API_COMPATIBLE) ++ set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES}) ++endif(ENCHANT_API_COMPATIBLE) ++ + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES + ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE) diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix new file mode 100644 index 000000000000..35683101918d --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix @@ -0,0 +1,100 @@ +{ lib, stdenv, fetchurl, pkg-config, cmake, intltool, gettext +, libxml2, enchant2, isocodes, icu, libpthreadstubs +, pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon +, dbus, gtk2, gtk3, qt4, extra-cmake-modules +, xkeyboard_config, pcre, libuuid +, withPinyin ? true +, fetchFromGitLab +}: + +let + # releases at http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz + # contains all data but if we want to compile from source, we need to + # fetch them ourselves + # to update the urls and where to unpack these, look into the + # src/module/*/data/CMakeLists.txt files + # fcitx_download tgt_name url output) + dicts = let SPELL_EN_DICT_VER="20121020"; in fetchurl { + url = "http://download.fcitx-im.org/data/en_dict-${SPELL_EN_DICT_VER}.tar.gz"; + sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4"; + }; + table = fetchurl { + url = "http://download.fcitx-im.org/data/table.tar.gz"; + sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1"; + }; + pystroke-data = let PY_STROKE_VER="20121124"; in fetchurl { + url = "http://download.fcitx-im.org/data/py_stroke-${PY_STROKE_VER}.tar.gz"; + sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf"; + }; + pytable-data = let PY_TABLE_VER="20121124"; in fetchurl { + url = "http://download.fcitx-im.org/data/py_table-${PY_TABLE_VER}.tar.gz"; + sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522"; + }; + pinyin-data = fetchurl { + url = "http://download.fcitx-im.org/data/pinyin.tar.gz"; + sha256 = "1qfq5dy4czvd1lvdnxzyaiir9x8b1m46jjny11y0i33m9ar2jf2q"; + }; +in +stdenv.mkDerivation rec { + pname = "fcitx"; + version = "4.2.9.6"; + + src = fetchFromGitLab { + owner = "fcitx"; + repo = "fcitx"; + rev = version; + sha256 = "0j5vaf930lb21gx4h7z6mksh1fazqw32gajjjkyir94wbmml9n3s"; + }; + + # put data at the correct locations else cmake tries to fetch them, + # which fails in sandboxed mode + prePatch = '' + cp ${dicts} src/module/spell/dict/$(stripHash ${dicts}) + cp ${table} src/im/table/data/$(stripHash ${table}) + '' + + lib.optionalString withPinyin '' + cp ${pystroke-data} src/module/pinyin-enhance/data/$(stripHash ${pystroke-data}) + cp ${pytable-data} src/module/pinyin-enhance/data/$(stripHash ${pytable-data}) + cp ${pinyin-data} src/im/pinyin/data/$(stripHash ${pinyin-data}) + '' + ; + + patches = [ ./find-enchant-lib.patch ]; + + postPatch = '' + substituteInPlace src/frontend/qt/CMakeLists.txt \ + --replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins + + patchShebangs cmake/ + ''; + + nativeBuildInputs = [ cmake extra-cmake-modules intltool pkg-config pcre ]; + + buildInputs = [ + xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile + libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid + ]; + + 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" + "-DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"}" + "-DENABLE_TABLE=ON" + "-DENABLE_SPELL=ON" + "-DENABLE_QT_GUI=ON" + "-DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml'" + ]; + + meta = with lib; { + homepage = "https://github.com/fcitx/fcitx"; + description = "A Flexible Input Method Framework"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix new file mode 100644 index 000000000000..28a08e39b225 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix @@ -0,0 +1,14 @@ +{ symlinkJoin, fcitx, fcitx-configtool, makeWrapper, plugins, libsForQt5 }: + +symlinkJoin { + name = "fcitx-with-plugins-${fcitx.version}"; + + paths = [ fcitx fcitx-configtool libsForQt5.fcitx-qt5 ] ++ plugins; + + buildInputs = [ makeWrapper ]; + + postBuild = '' + wrapProgram $out/bin/fcitx \ + --set FCITXDIR "$out/" + ''; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix new file mode 100644 index 000000000000..e578fbf14432 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix @@ -0,0 +1,102 @@ +{ lib, 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.4"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5"; + rev = version; + sha256 = "sha256-2KGdR1m70Qatidzf/DZuFK3lc1t8z7sxjyhaxuc0Tqg="; + }; + + 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 + ]; + + passthru.updateScript = ./update.py; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix new file mode 100644 index 000000000000..6d3952c9c225 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix @@ -0,0 +1,76 @@ +{ lib +, 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.3"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-chinese-addons"; + rev = version; + sha256 = "sha256-kCihpRUtUXrqqf7FPQp8ZRexiygOuDVOdQwVx7tSn+c="; + }; + + 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 + ] ++ lib.optional luaSupport fcitx5-lua; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix new file mode 100644 index 000000000000..b133d576c6cc --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix @@ -0,0 +1,62 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, extra-cmake-modules +, fcitx5 +, fcitx5-qt +, qtx11extras +, qtquickcontrols2 +, kwidgetsaddons +, kdeclarative +, kirigami2 +, isocodes +, xkeyboardconfig +, libxkbfile +, libXdmcp +, kcmSupport ? true +}: + +mkDerivation rec { + pname = "fcitx5-configtool"; + version = "5.0.2"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-configtool"; + rev = version; + sha256 = "sha256-kw0KIbS5SVMf6kR/9xsYiChHXQBM0enSVXyh0QfiiPY="; + }; + + cmakeFlags = [ + "-DKDE_INSTALL_USE_QT_SYS_PATHS=ON" + ]; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + ]; + + buildInputs = [ + fcitx5 + fcitx5-qt + qtx11extras + qtquickcontrols2 + kirigami2 + isocodes + xkeyboardconfig + libxkbfile + libXdmcp + ] ++ lib.optionals kcmSupport [ + kdeclarative + kwidgetsaddons + ]; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix new file mode 100644 index 000000000000..0daeaa794cee --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix @@ -0,0 +1,73 @@ +{ lib, stdenv +, fetchurl +, fetchFromGitHub +, cmake +, extra-cmake-modules +, fcitx5 +, gobject-introspection +, gtk2 +, gtk3 +, gtk4 +, 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.3"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-gtk"; + rev = version; + sha256 = "sha256-+BzXbZyzC3fvLqysufblk0zK9fAg5jslVdm/v3jz4B4="; + }; + + cmakeFlags = [ + "-DGOBJECT_INTROSPECTION_GIRDIR=share/gir-1.0" + "-DGOBJECT_INTROSPECTION_TYPELIBDIR=lib/girepository-1.0" + ] ++ lib.optional (! withGTK2) "-DENABLE_GTK2_IM_MODULE=off"; + + buildInputs = [ + gtk3 + gtk4 + gobject-introspection + fcitx5 + pcre + libuuid + libselinux + libsepol + libthai + libdatrie + libXdmcp + libxkbcommon + epoxy + dbus + at-spi2-core + libXtst + ] ++ lib.optional withGTK2 gtk2; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + ]; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix new file mode 100644 index 000000000000..6184ea36549b --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix @@ -0,0 +1,40 @@ +{ lib, stdenv +, fetchFromGitHub +, cmake +, extra-cmake-modules +, fcitx5 +, lua5_3 +, luaPackage ? lua5_3 +, gettext +}: + +stdenv.mkDerivation rec { + pname = "fcitx5-lua"; + version = "5.0.2"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-lua"; + rev = version; + sha256 = "sha256-lFlHn2q/kpq1EIKKhYVdJofXqtOHnpLz7PoWuNAhmhE="; + }; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + ]; + + buildInputs = [ + fcitx5 + luaPackage + gettext + ]; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix new file mode 100644 index 000000000000..08f43b87cfe2 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix @@ -0,0 +1,117 @@ +{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchgit +, python3Packages, mesa, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5 +, jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad }: +let + inherit (python3Packages) python gyp six; + japanese_usage_dictionary = fetchFromGitHub { + owner = "hiroyuki-komatsu"; + repo = "japanese-usage-dictionary"; + rev = "e5b3425575734c323e1d947009dd74709437b684"; + sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm"; + }; + # abseil-cpp in nixpkgs is too old + abseil-cpp_2020923 = abseil-cpp.overrideAttrs (old: rec { + version = "20200923.2"; + src = fetchFromGitHub { + owner = "abseil"; + repo = "abseil-cpp"; + rev = version; + sha256 = "G+wkaC4IPtyc/xCUyVFJOcHppPFU7KkhIHjv6uhVKGU="; + }; + cmakeFlags = [ "-DCMAKE_CXX_STANDARD=17" "-DBUILD_SHARED_LIBS=ON" ]; + }); + zipcode_rel = "202011"; + jigyosyo = fetchurl { + url = "https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${zipcode_rel}.zip"; + sha256 = "j7MkNtd4+QTi91EreVig4/OV0o5y1+KIjEJBEmLK/mY="; + }; + x-ken-all = fetchurl { + url = + "https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${zipcode_rel}.zip"; + sha256 = "ExS0Cg3rs0I9IOVbZHLt8UEfk8/LmY9oAHPVVlYuTPw="; + }; + +in clangStdenv.mkDerivation rec { + pname = "fcitx5-mozc"; + version = "2.26.4220.102"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "mozc"; + rev = "1882e33b61673b66d63277f82b4c80ae4e506c10"; + sha256 = "R+w0slVFpqtt7PIr1pyupJjRoQsABVZiMdZ9fKGKAqw="; + }; + + nativeBuildInputs = [ gyp ninja mesa python pkg-config qt5.wrapQtAppsHook six which unzip ]; + + buildInputs = [ protobuf zinnia qt5.qtbase fcitx5 abseil-cpp_2020923 jsoncpp gtest gtk2 ]; + + patches = [ + # Support linking system abseil-cpp + (fetchpatch { + url = "https://salsa.debian.org/debian/mozc/-/raw/debian/sid/debian/patches/0007-Update-src-base-absl.gyp.patch"; + sha256 = "UiS0UScDKyAusXOhc7Bg8dF8ARQQiVTylEhAOxqaZt8="; + }) + + ]; + + postUnpack = '' + unzip ${x-ken-all} -d $sourceRoot/src/ + unzip ${jigyosyo} -d $sourceRoot/src/ + + rmdir $sourceRoot/src/third_party/breakpad/ + ln -s ${breakpad} $sourceRoot/src/third_party/breakpad + rmdir $sourceRoot/src/third_party/gtest/ + ln -s ${gtest} $sourceRoot/src/third_party/gtest + rmdir $sourceRoot/src/third_party/gyp/ + ln -s ${gyp} $sourceRoot/src/third_party/gyp + rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/ + ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary + ''; + + # Copied from https://github.com/archlinux/svntogit-community/blob/packages/fcitx5-mozc/trunk/PKGBUILD + configurePhase = '' + cd src + export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_libabseil=1" + + # disable fcitx4 + rm unix/fcitx/fcitx.gyp + + # gen zip code seed + PYTHONPATH="$PWD:$PYTHONPATH" python dictionary/gen_zip_code_seed.py --zip_code="x-ken-all.csv" --jigyosyo="JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt + + # use libstdc++ instead of libc++ + sed "/stdlib=libc++/d;/-lc++/d" -i gyp/common.gypi + + # run gyp + python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc + ''; + + buildPhase = '' + python build_mozc.py build -c Release \ + server/server.gyp:mozc_server \ + gui/gui.gyp:mozc_tool \ + unix/fcitx5/fcitx5.gyp:fcitx5-mozc + ''; + + installPhase = '' + export PREFIX=$out + export _bldtype=Release + ../scripts/install_server + install -d $out/share/licenses/fcitx5-mozc + head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx5-mozc/LICENSE + install -m644 data/installer/*.html $out/share/licenses/fcitx5-mozc/ + install -d $out/share/fcitx5/addon + install -d $out/share/fcitx5/inputmethod + install -d $out/lib/fcitx5 + ../scripts/install_fcitx5 + ''; + + meta = with lib; { + description = "Fcitx5 Module of A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"; + homepage = "https://github.com/fcitx/mozc"; + license = licenses.bsd3; + maintainers = with maintainers; [ berberman ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix new file mode 100644 index 000000000000..bfb06a98e8fd --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix @@ -0,0 +1,53 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, extra-cmake-modules +, fcitx5 +, qtx11extras +, libxcb +, libXdmcp +, qtbase +}: + +mkDerivation rec { + pname = "fcitx5-qt"; + version = "5.0.2"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-qt"; + rev = version; + sha256 = "sha256-QylvjhjiIujYGKFtL4bKVXpobkN5t6Q2MGf16dsL24A="; + }; + + preConfigure = '' + substituteInPlace qt5/platforminputcontext/CMakeLists.txt \ + --replace \$"{CMAKE_INSTALL_QT5PLUGINDIR}" $out/${qtbase.qtPluginPrefix} + ''; + + cmakeFlags = [ + "-DENABLE_QT4=0" + "-DENABLE_QT6=0" + ]; + + 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; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix new file mode 100644 index 000000000000..8e5254b75c43 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix @@ -0,0 +1,47 @@ +{ lib, stdenv +, fetchurl +, fetchFromGitHub +, pkg-config +, cmake +, extra-cmake-modules +, gettext +, fcitx5 +, librime +, brise +}: + +stdenv.mkDerivation rec { + pname = "fcitx5-rime"; + version = "5.0.3"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-rime"; + rev = version; + sha256 = "sha256-mPNZ/B5bpxua+E1T+oz9v2QKAzGraA2cfT8oJacC35U="; + }; + + cmakeFlags = [ + "-DRIME_DATA_DIR=${brise}/share/rime-data" + ]; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + pkg-config + gettext + ]; + + buildInputs = [ + fcitx5 + librime + ]; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix new file mode 100644 index 000000000000..355ac97d8a15 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix @@ -0,0 +1,38 @@ +{ lib, stdenv +, fetchFromGitHub +, cmake +, extra-cmake-modules +, gettext +, libime +, boost +, fcitx5 +}: + +stdenv.mkDerivation rec { + pname = "fcitx5-table-extra"; + version = "5.0.2"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-table-extra"; + rev = version; + sha256 = "sha256-Bqxdi/rjiTKqHLvVFVcQMjz/I0xxTiBgUIRkZjLuK+M="; + }; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + gettext + libime + boost + fcitx5 + ]; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix new file mode 100644 index 000000000000..4feae0d4acc1 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix @@ -0,0 +1,38 @@ +{ lib, stdenv +, fetchFromGitHub +, cmake +, extra-cmake-modules +, gettext +, libime +, boost +, fcitx5 +}: + +stdenv.mkDerivation rec { + pname = "fcitx5-table-other"; + version = "5.0.2"; + + src = fetchFromGitHub { + owner = "fcitx"; + repo = "fcitx5-table-other"; + rev = version; + sha256 = "sha256-P+KaUmjAHe1CZ5rNMQAxwKSW5ZMVgQcwkgdlungXTLM="; + }; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + gettext + libime + boost + fcitx5 + ]; + + meta = with 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/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py b/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py new file mode 100755 index 000000000000..e3513c747fcd --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py @@ -0,0 +1,29 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python3 -p nix-prefetch-github python3Packages.requests + +from nix_prefetch_github import * +import json +import requests +import subprocess + +REPOS = [ "libime", "xcb-imdkit", "fcitx5", "fcitx5-gtk", "fcitx5-qt", "fcitx5-configtool", "fcitx5-lua", + "fcitx5-rime", "fcitx5-chinese-addons", "fcitx5-table-extra", "fcitx5-table-other" ] + +OWNER = "fcitx" + +def get_latest_tag(repo, owner=OWNER): + r = requests.get( 'https://api.github.com/repos/{}/{}/tags'.format(owner,repo) + , auth=('poscat', 'db5e6fd16d0eb8c36385d3d944e058a1178b4265')) + return r.json()[0].get("name") + +def main(): + sources = dict() + for repo in REPOS: + rev = get_latest_tag(repo) + if repo == "fcitx5-qt": + subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)]) + else: + subprocess.run(["nix-update", "--commit", "--version", rev, repo]) + +if __name__ == "__main__": + main () diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix new file mode 100644 index 000000000000..17501d5f3622 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix @@ -0,0 +1,26 @@ +{ 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" + + desktop=share/applications/org.fcitx.Fcitx5.desktop + autostart=etc/xdg/autostart/org.fcitx.Fcitx5.desktop + rm $out/$desktop + rm $out/$autostart + cp ${fcitx5}/$desktop $out/$desktop + sed -i $out/$desktop -e "s|^Exec=.*|Exec=$out/bin/fcitx5|g" + ln -s $out/$desktop $out/$autostart + ''; + + meta = fcitx5.meta; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile new file mode 100644 index 000000000000..9aa2c3ac71a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem "fusuma" diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock new file mode 100644 index 000000000000..1ca313c6cd54 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock @@ -0,0 +1,13 @@ +GEM + remote: https://rubygems.org/ + specs: + fusuma (1.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + fusuma + +BUNDLED WITH + 2.1.4 diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix b/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix new file mode 100644 index 000000000000..dc6d3a09bfa4 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix @@ -0,0 +1,24 @@ +{ lib, bundlerApp, bundlerUpdateScript, makeWrapper, libinput }: + +bundlerApp { + pname = "fusuma"; + gemdir = ./.; + exes = [ "fusuma" ]; + + buildInputs = [ makeWrapper ]; + + postBuild = '' + wrapProgram "$out/bin/fusuma" \ + --prefix PATH : ${lib.makeBinPath [ libinput ]} + ''; + + passthru.updateScript = bundlerUpdateScript "fusuma"; + + meta = with lib; { + description = "Multitouch gestures with libinput driver on X11, Linux"; + homepage = "https://github.com/iberianpig/fusuma"; + license = licenses.mit; + maintainers = with maintainers; [ jfrankenau nicknovitski Br1ght0ne ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix b/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix new file mode 100644 index 000000000000..87e0ae14da8c --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix @@ -0,0 +1,12 @@ +{ + fusuma = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "150jc8jyqj3w4k13lf1ihqmm2sld1yawp4jwnf43jixnc9rmzx6f"; + type = "gem"; + }; + version = "1.3.0"; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix b/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix new file mode 100644 index 000000000000..7506493ee7ce --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchFromGitHub, pkg-config, cmake, libinput, zlib }: + +stdenv.mkDerivation rec { + pname = "gebaar-libinput"; + version = "0.0.5"; + + src = fetchFromGitHub { + owner = "Coffee2CodeNL"; + repo = pname; + rev = "v${version}"; + sha256 = "1kqcgwkia1p195xr082838dvj1gqif9d63i8a52jb0lc32zzizh6"; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ pkg-config cmake ]; + buildInputs = [ libinput zlib ]; + + meta = with lib; { + description = "Gebaar, A Super Simple WM Independent Touchpad Gesture Daemon for libinput"; + homepage = "https://github.com/Coffee2CodeNL/gebaar-libinput"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ colemickens lovesegfault ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/hime/default.nix b/nixpkgs/pkgs/tools/inputmethods/hime/default.nix new file mode 100644 index 000000000000..8ec6146a0209 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/hime/default.nix @@ -0,0 +1,34 @@ +{ +stdenv, fetchFromGitHub, pkg-config, which, gtk2, gtk3, qt4, qt5, libXtst, lib, +}: + +# chewing and anthy do not work well +# so we do not enable these input method at this moment + +stdenv.mkDerivation { + name = "hime"; + version = "unstable-2020-06-27"; + + src = fetchFromGitHub { + owner = "hime-ime"; + repo = "hime"; + rev = "c89751a58836906e6916355fd037fc74fd7a7a15"; + sha256 = "024w67q0clzxigsrvqbxpiy8firjvrqi7wbkkcapzzhzapv3nm8x"; + }; + + nativeBuildInputs = [ which pkg-config ]; + buildInputs = [ libXtst gtk2 gtk3 qt4 qt5.qtbase ]; + + preConfigure = "patchShebangs configure"; + configureFlags = [ "--disable-lib64" "--disable-qt5-immodule" ]; + + + meta = with lib; { + homepage = "http://hime-ime.github.io/"; + downloadPage = "https://github.com/hime-ime/hime/downloads"; + description = "A useful input method engine for Asia region"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ yanganto ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix new file mode 100644 index 000000000000..60b5d6778b44 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix @@ -0,0 +1,57 @@ +{ lib, stdenv +, fetchurl +, gettext +, pkg-config +, wrapGAppsHook +, anthy +, ibus +, glib +, gobject-introspection +, gtk3 +, python3 +}: + +stdenv.mkDerivation rec { + pname = "ibus-anthy"; + version = "1.5.11"; + + src = fetchurl { + url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz"; + sha256 = "1zwgswpibh67sgbza8kvg03v06maxc08ihkgm5hmh333sjq9d5c0"; + }; + + buildInputs = [ + anthy + glib + gtk3 + ibus + (python3.withPackages (ps: [ + ps.pygobject3 + (ps.toPythonModule ibus) + ])) + ]; + + nativeBuildInputs = [ + gettext + gobject-introspection + pkg-config + wrapGAppsHook + ]; + + configureFlags = [ + "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t" + ]; + + postFixup = '' + substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out + ''; + + meta = with lib; { + isIbusEngine = true; + description = "IBus interface to the anthy input method"; + homepage = "https://github.com/fujiwarat/ibus-anthy"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ gebner ericsagnes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix new file mode 100644 index 000000000000..9f5f9956b0e3 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv +, fetchFromGitHub +, gettext +, xorg +, pkg-config +, wrapGAppsHook +, ibus +, gtk3 +, go +}: + +stdenv.mkDerivation rec { + pname = "ibus-bamboo"; + version = "0.6.8"; + + src = fetchFromGitHub { + owner = "BambooEngine"; + repo = pname; + rev = "v${version}"; + sha256 = "17zgxqlsjkqyjywynqzmymw310aypcsjdrwnc7hx7v7xwal8iwjk"; + }; + + nativeBuildInputs = [ + gettext + pkg-config + wrapGAppsHook + go + ]; + + buildInputs = [ + xorg.libX11 + xorg.xorgproto + xorg.libXtst + xorg.libXi + ]; + + preConfigure = '' + export GOCACHE="$TMPDIR/go-cache" + sed -i "s,/usr,$out," bamboo.xml + ''; + + makeFlags = [ + "PREFIX=${placeholder "out"}" + ]; + + + meta = with lib; { + isIbusEngine = true; + description = "A Vietnamese IME for IBus"; + homepage = "https://github.com/BambooEngine/ibus-bamboo"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ superbo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix new file mode 100644 index 000000000000..af3e1edd6399 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv +, fetchurl +, substituteAll +, appstream-glib +, gettext +, pkg-config +, wrapGAppsHook +, gtk3 +, ibus +, libhangul +, python3 +}: + +stdenv.mkDerivation rec { + pname = "ibus-hangul"; + version = "1.5.4"; + + src = fetchurl { + url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${pname}-${version}.tar.gz"; + sha256 = "1q6g2pnrn5gqn9jqnm3975v9hh60hc5gn9x3zbrdjgy0n3wpxwm9"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + libhangul = "${libhangul}/lib/libhangul.so.1"; + }) + ]; + + nativeBuildInputs = [ + appstream-glib + gettext + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + gtk3 + ibus + libhangul + (python3.withPackages (pypkgs: with pypkgs; [ + pygobject3 + (toPythonModule ibus) + ])) + ]; + + meta = with lib; { + isIbusEngine = true; + description = "Ibus Hangul engine"; + homepage = "https://github.com/choehwanjin/ibus-hangul"; + license = licenses.gpl2; + maintainers = with maintainers; [ ericsagnes ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch new file mode 100644 index 000000000000..7487d074d559 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch @@ -0,0 +1,13 @@ +diff --git a/setup/main.py b/setup/main.py +index 8d581cd..2ac47b9 100644 +--- a/setup/main.py ++++ b/setup/main.py +@@ -37,7 +37,7 @@ + + def get_hangul_keyboard_list(): + from ctypes import CDLL, c_int, c_char_p +- libhangul = CDLL('libhangul.so.1') ++ libhangul = CDLL('@libhangul@') + libhangul.hangul_ic_get_n_keyboards.argtypes = [] + libhangul.hangul_ic_get_n_keyboards.restype = c_int + libhangul.hangul_ic_get_keyboard_id.argtypes = [c_int] diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix new file mode 100644 index 000000000000..00ce8df19367 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl +, vala, intltool, pkg-config +, libkkc, ibus, skk-dicts +, gtk3 +}: + +stdenv.mkDerivation rec { + pname = "ibus-kkc"; + version = "1.5.22"; + + src = fetchurl { + url = "${meta.homepage}/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "1kj74c9zy9yxkjx7pz96mzqc13cf10yfmlgprr8sfd4ay192bzi2"; + }; + + nativeBuildInputs = [ + vala intltool pkg-config + ]; + + buildInputs = [ libkkc ibus skk-dicts gtk3 ]; + + postInstall = '' + ln -s ${skk-dicts}/share $out/share/skk + ''; + + meta = with lib; { + isIbusEngine = true; + description = "libkkc (Japanese Kana Kanji input method) engine for ibus"; + homepage = "https://github.com/ueno/ibus-kkc"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ vanzef ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix new file mode 100644 index 000000000000..b51efc2cb810 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix @@ -0,0 +1,54 @@ +{ lib, stdenv +, fetchFromGitHub +, autoreconfHook +, gettext +, pkg-config +, wrapGAppsHook +, sqlite +, libpinyin +, db +, ibus +, glib +, gtk3 +, python3 +}: + +stdenv.mkDerivation rec { + pname = "ibus-libpinyin"; + version = "1.12.0"; + + src = fetchFromGitHub { + owner = "libpinyin"; + repo = "ibus-libpinyin"; + rev = version; + sha256 = "sha256-fEEiwRoGGFAki1DMQvGuzjz2NAjhExyH11l8KTwjjsI="; + }; + + nativeBuildInputs = [ + autoreconfHook + gettext + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + ibus + glib + sqlite + libpinyin + (python3.withPackages (pypkgs: with pypkgs; [ + pygobject3 + (toPythonModule ibus) + ])) + gtk3 + db + ]; + + meta = with lib; { + isIbusEngine = true; + description = "IBus interface to the libpinyin input method"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ericsagnes ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix new file mode 100644 index 000000000000..1bb2479b4997 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, makeWrapper, pkg-config, ibus, gtk3, libthai }: + +stdenv.mkDerivation rec { + pname = "ibus-libthai"; + version = "0.1.4"; + + src = fetchurl { + url = "https://linux.thai.net/pub/ThaiLinux/software/libthai/ibus-libthai-${version}.tar.xz"; + sha256 = "0iam7308rxkx2xwaabc5wyj7vrxgd4cr95pvwrkm8fr9gh2xnwgv"; + }; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ gtk3 ibus libthai ]; + + meta = with lib; { + isIbusEngine = true; + homepage = "https://linux.thai.net/projects/ibus-libthai"; + description = "Thai input method engine for IBus"; + license = licenses.lgpl21Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix new file mode 100644 index 000000000000..8fbd9254486a --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv +, fetchFromGitHub +, autoreconfHook +, pkg-config +, ibus +, gtk3 +, m17n_lib +, m17n_db +, gettext +, python3 +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "ibus-m17n"; + version = "1.4.4"; + + src = fetchFromGitHub { + owner = "ibus"; + repo = "ibus-m17n"; + rev = version; + sha256 = "sha256-kPTysHTC+j8BMnzsddRa4Tg54idejApTqmLrP20pu5M="; + }; + + nativeBuildInputs = [ + autoreconfHook + gettext + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + ibus + gtk3 + m17n_lib + m17n_db + (python3.withPackages (ps: [ + ps.pygobject3 + (ps.toPythonModule ibus) + ])) + ]; + + configureFlags = [ + "--with-gtk=3.0" + ]; + + meta = with lib; { + isIbusEngine = true; + description = "m17n engine for ibus"; + homepage = "https://github.com/ibus/ibus-m17n"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix new file mode 100644 index 000000000000..1949f3f0da0f --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix @@ -0,0 +1,83 @@ +{ lib, stdenv, fetchFromGitHub, which, ninja, python, pkg-config, protobuf +, ibus, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese, python3Packages }: + +let + japanese_usage_dictionary = fetchFromGitHub { + owner = "hiroyuki-komatsu"; + repo = "japanese-usage-dictionary"; + rev = "e5b3425575734c323e1d947009dd74709437b684"; + sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm"; + }; +in stdenv.mkDerivation rec { + name = "ibus-mozc-${version}"; + version = "2.23.4206.102"; + + meta = with lib; { + isIbusEngine = true; + description = "Japanese input method from Google"; + homepage = "https://github.com/google/mozc"; + license = licenses.free; + platforms = platforms.linux; + maintainers = with maintainers; [ gebner ericsagnes ]; + }; + + nativeBuildInputs = [ which ninja python3Packages.python python3Packages.six + python3Packages.gyp pkg-config qt5.wrapQtAppsHook ]; + buildInputs = [ protobuf ibus gtk2 zinnia qt5.qtbase libxcb ]; + + src = fetchFromGitHub { + owner = "google"; + repo = "mozc"; + rev = "91cc1e19ef34aeb12888b697fefa52907f1a834d"; + sha256 = "1fyy9g1pnaq6s5nkf56aqmp5mgyibbmp1ylc64fqc6g1plg90zk2"; + fetchSubmodules = true; + }; + + postUnpack = '' + rm -rf $sourceRoot/src/third_party/japanese_usage_dictionary/ + ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary + '' + lib.optionalString stdenv.isLinux '' + sed -i 's/-lc++/-lstdc++/g' $sourceRoot/src/gyp/common.gypi + ''; + + configurePhase = '' + export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 ibus_mozc_path=$out/lib/ibus-mozc/ibus-engine-mozc zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model" + cd src && python build_mozc.py gyp --gypdir=${python3Packages.gyp}/bin --server_dir=$out/lib/mozc + ''; + + buildPhase = '' + PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \ + unix/ibus/ibus.gyp:ibus_mozc \ + unix/emacs/emacs.gyp:mozc_emacs_helper \ + server/server.gyp:mozc_server \ + gui/gui.gyp:mozc_tool \ + renderer/renderer.gyp:mozc_renderer + ''; + + installPhase = '' + install -d $out/share/licenses/mozc + head -n 29 server/mozc_server.cc > $out/share/licenses/mozc/LICENSE + install -m 644 data/installer/*.html $out/share/licenses/mozc/ + + install -D -m 755 out_linux/Release/mozc_server $out/lib/mozc/mozc_server + install -m 755 out_linux/Release/mozc_tool $out/lib/mozc/mozc_tool + wrapQtApp $out/lib/mozc/mozc_tool + + install -d $out/share/doc/mozc + install -m 644 data/installer/*.html $out/share/doc/mozc/ + + install -D -m 755 out_linux/Release/ibus_mozc $out/lib/ibus-mozc/ibus-engine-mozc + install -D -m 644 out_linux/Release/gen/unix/ibus/mozc.xml $out/share/ibus/component/mozc.xml + install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png $out/share/ibus-mozc/product_icon.png + install -m 644 data/images/unix/ui-tool.png $out/share/ibus-mozc/tool.png + install -m 644 data/images/unix/ui-properties.png $out/share/ibus-mozc/properties.png + install -m 644 data/images/unix/ui-dictionary.png $out/share/ibus-mozc/dictionary.png + install -m 644 data/images/unix/ui-direct.png $out/share/ibus-mozc/direct.png + install -m 644 data/images/unix/ui-hiragana.png $out/share/ibus-mozc/hiragana.png + install -m 644 data/images/unix/ui-katakana_half.png $out/share/ibus-mozc/katakana_half.png + install -m 644 data/images/unix/ui-katakana_full.png $out/share/ibus-mozc/katakana_full.png + install -m 644 data/images/unix/ui-alpha_half.png $out/share/ibus-mozc/alpha_half.png + install -m 644 data/images/unix/ui-alpha_full.png $out/share/ibus-mozc/alpha_full.png + install -D -m 755 out_linux/Release/mozc_renderer $out/lib/mozc/mozc_renderer + ''; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix new file mode 100644 index 000000000000..d444d44f2337 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix @@ -0,0 +1,44 @@ +{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gdk-pixbuf, glib, ibus, libnotify +, librime, brise }: + +stdenv.mkDerivation rec { + pname = "ibus-rime"; + version = "1.4.0"; + + src = fetchFromGitHub { + owner = "rime"; + repo = "ibus-rime"; + rev = version; + sha256 = "0zbajz7i18vrqwdyclzywvsjg6qzaih64jhi3pkxp7mbw8jc5vhy"; + }; + + buildInputs = [ gdk-pixbuf glib ibus libnotify librime brise ]; + nativeBuildInputs = [ cmake pkg-config ]; + + makeFlags = [ "PREFIX=$(out)" ]; + dontUseCmakeConfigure = true; + + prePatch = '' + substituteInPlace Makefile \ + --replace 'cmake' 'cmake -DRIME_DATA_DIR=${brise}/share/rime-data' + + substituteInPlace rime_config.h \ + --replace '/usr' $out + + substituteInPlace rime_config.h \ + --replace 'IBUS_RIME_SHARED_DATA_DIR IBUS_RIME_INSTALL_PREFIX' \ + 'IBUS_RIME_SHARED_DATA_DIR "${brise}"' + + substituteInPlace rime.xml \ + --replace '/usr' $out + ''; + + meta = with lib; { + isIbusEngine = true; + description = "Rime input method engine for IBus"; + homepage = "https://rime.im/"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ pengmeiyu ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix new file mode 100644 index 000000000000..40c33aff4011 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix @@ -0,0 +1,65 @@ +{ lib, stdenv, fetchgit, fetchFromGitHub, pkg-config, ibus, ibus-table, python3, cmake }: + +let + src = fetchFromGitHub { + owner = "definite"; + repo = "ibus-table-chinese"; + rev = "f1f6a3384f021caa3b84c517e2495086f9c34507"; + sha256 = "14wpw3pvyrrqvg7al37jk2dxqfj9r4zf88j8k2n2lmdc50f3xs7k"; + }; + + cmakeFedoraSrc = fetchgit { + url = "https://pagure.io/cmake-fedora.git"; + rev = "7d5297759aef4cd086bdfa30cf6d4b2ad9446992"; + sha256 = "0mx9jvxpiva9v2ffaqlyny48iqr073h84yw8ln43z2avv11ipr7n"; + }; +in stdenv.mkDerivation { + pname = "ibus-table-chinese"; + version = "1.8.2"; + + srcs = [ src cmakeFedoraSrc ]; + sourceRoot = src.name; + + postUnpack = '' + chmod u+w -R ${cmakeFedoraSrc.name} + mv ${cmakeFedoraSrc.name}/* source/cmake-fedora + ''; + + preConfigure = '' + # cmake script needs ./Modules folder to link to cmake-fedora + ln -s cmake-fedora/Modules ./ + ''; + + # Fails when writing to /prj_info.cmake in https://pagure.io/cmake-fedora/blob/master/f/Modules/ManageVersion.cmake + cmakeFlags = [ "-DPRJ_INFO_CMAKE_FILE=/dev/null" "-DPRJ_DOC_DIR=REPLACE" "-DDATA_DIR=share" ]; + # Must replace PRJ_DOC_DIR with actual share/ folder for ibus-table-chinese + # Otherwise it tries to write to /ibus-table-chinese if not defined (!) + postConfigure = '' + substituteInPlace cmake_install.cmake --replace '/build/source/REPLACE' $out/share/ibus-table-chinese + ''; + # Fails otherwise with "no such file or directory: <table>.txt" + dontUseCmakeBuildDir = true; + # Fails otherwise sometimes with + # FileExistsError: [Errno 17] File exists: '/build/tmp.BfVAUM4llr/ibus-table-chinese/.local/share/ibus-table' + enableParallelBuilding = false; + + preBuild = '' + export HOME=$(mktemp -d)/ibus-table-chinese + ''; + + postFixup = '' + rm -rf $HOME + ''; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ ibus ibus-table python3 ]; + + meta = with lib; { + isIbusEngine = true; + description = "Chinese tables for IBus-Table"; + homepage = "https://github.com/definite/ibus-table-chinese"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ pneumaticat ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix new file mode 100644 index 000000000000..258ab93689bc --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, ibus, ibus-table, pkg-config, python3 }: + +stdenv.mkDerivation rec { + pname = "ibus-table-others"; + version = "1.3.11"; + + src = fetchurl { + url = "https://github.com/moebiuscurve/ibus-table-others/releases/download/${version}/${pname}-${version}.tar.gz"; + sha256 = "0763wnlklcs3d8fk21nkp7dgn4qzqgxh1s24q3kl8gzgng2a88jj"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ ibus ibus-table python3 ]; + + preBuild = '' + export HOME=$(mktemp -d)/ibus-table-others + ''; + + postFixup = '' + rm -rf $HOME + ''; + + meta = with lib; { + isIbusEngine = true; + description = "Various table-based input methods for IBus"; + homepage = "https://github.com/moebiuscurve/ibus-table-others"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ mudri ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix new file mode 100644 index 000000000000..00a499fb104b --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix @@ -0,0 +1,67 @@ +{ lib, stdenv, fetchFromGitHub +, autoreconfHook, docbook2x, pkg-config +, gtk3, dconf, gobject-introspection +, ibus, python3, wrapGAppsHook }: + +stdenv.mkDerivation rec { + pname = "ibus-table"; + version = "1.12.3"; + + src = fetchFromGitHub { + owner = "kaio"; + repo = "ibus-table"; + rev = version; + sha256 = "sha256-iVbct7p+i8ifSQzOFUUnJU0RHX36cFiTlv7p79iawj8="; + }; + + postPatch = '' + # Data paths will be set at run-time. + sed -e "/export IBUS_TABLE_LIB_LOCATION=/ s/^.*$//" \ + -e "/export IBUS_TABLE_LOCATION=/ s/^.*$//" \ + -i "engine/ibus-engine-table.in" + sed -e "/export IBUS_TABLE_BIN_PATH=/ s/^.*$//" \ + -e "/export IBUS_TABLE_DATA_DIR=/ s/^.*$//" \ + -i "engine/ibus-table-createdb.in" + sed -e "/export IBUS_PREFIX=/ s/^.*$//" \ + -e "/export IBUS_DATAROOTDIR=/ s/^.$//" \ + -e "/export IBUS_LOCALEDIR=/ s/^.$//" \ + -i "setup/ibus-setup-table.in" + substituteInPlace engine/tabcreatedb.py --replace '/usr/share/ibus-table' $out/share/ibus-table + substituteInPlace engine/ibus_table_location.py \ + --replace '/usr/libexec' $out/libexec \ + --replace '/usr/share/ibus-table/' $out/share/ibus-table/ + ''; + + buildInputs = [ + dconf + gtk3 + ibus + (python3.withPackages (pypkgs: with pypkgs; [ + dbus-python + pygobject3 + (toPythonModule ibus) + ])) + ]; + + nativeBuildInputs = [ + autoreconfHook + docbook2x + pkg-config + gobject-introspection + wrapGAppsHook + ]; + + postUnpack = '' + substituteInPlace $sourceRoot/engine/Makefile.am \ + --replace "docbook2man" "docbook2man --sgml" + ''; + + meta = with lib; { + isIbusEngine = true; + description = "An IBus framework for table-based input methods"; + homepage = "https://github.com/kaio/ibus-table/wiki"; + license = licenses.lgpl21; + platforms = platforms.linux; + maintainers = with maintainers; [ mudri ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix new file mode 100644 index 000000000000..1ce947361df9 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, python3, ibus, pkg-config, gtk3, m17n_lib +, wrapGAppsHook, gobject-introspection +}: + +let + + python = python3.withPackages (ps: with ps; [ + pygobject3 + dbus-python + ]); + +in + +stdenv.mkDerivation rec { + pname = "ibus-typing-booster"; + version = "2.7.5"; + + src = fetchFromGitHub { + owner = "mike-fabian"; + repo = "ibus-typing-booster"; + rev = version; + sha256 = "072mi8r10v78sfs81zxdwfabf87fp872c99c5iral1ywwa4iynpl"; + }; + + patches = [ ./hunspell-dirs.patch ]; + + nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook gobject-introspection ]; + buildInputs = [ python ibus gtk3 m17n_lib ]; + + preFixup = '' + gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${m17n_lib}/lib") + ''; + + meta = with lib; { + homepage = "https://mike-fabian.github.io/ibus-typing-booster/"; + license = licenses.gpl3Plus; + description = "A typing booster engine for the IBus platform"; + maintainers = with maintainers; [ ]; + isIbusEngine = true; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch new file mode 100644 index 000000000000..7b624b379a26 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch @@ -0,0 +1,31 @@ +diff --git a/engine/itb_util.py b/engine/itb_util.py +index ded236a..633525a 100755 +--- a/engine/itb_util.py ++++ b/engine/itb_util.py +@@ -1876,14 +1876,18 @@ def find_hunspell_dictionary(language): + If no dictionary can be found for the requested language, + the return value is ('', ''). + ''' +- dirnames = [ +- '/usr/share/hunspell', +- '/usr/share/myspell', +- '/usr/share/myspell/dicts', +- '/usr/local/share/hunspell', # On FreeBSD the dictionaries are here +- '/usr/local/share/myspell', +- '/usr/local/share/myspell/dicts', +- ] ++ ++ if "NIX_HUNSPELL_DIRS" in os.environ: ++ dirnames = os.environ["NIX_HUNSPELL_DIRS"].split(":") ++ else: # fallback to the original behavior ++ dirnames = [ ++ '/usr/share/hunspell', ++ '/usr/share/myspell', ++ '/usr/share/myspell/dicts', ++ '/usr/local/share/hunspell', # On FreeBSD the dictionaries are here ++ '/usr/local/share/myspell', ++ '/usr/local/share/myspell/dicts', ++ ] + dic_path = '' + aff_path = '' + for language in expand_languages([language]): diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix new file mode 100644 index 000000000000..56ddf93af45f --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix @@ -0,0 +1,30 @@ +{ typing-booster, symlinkJoin, hunspellDicts, lib, makeWrapper +, langs ? [ "de-de" "en-us" "es-es" "fr-moderne" "it-it" "sv-se" "sv-fi" ] +}: + +let + + hunspellDirs = with lib; makeSearchPath ":" (flatten (forEach langs (lang: [ + "${hunspellDicts.${lang}}/share/hunspell" + "${hunspellDicts.${lang}}/share/myspell" + "${hunspellDicts.${lang}}/share/myspell/dicts" + ]))); + +in + +symlinkJoin { + name = "${typing-booster.name}-with-hunspell"; + paths = [ typing-booster ]; + nativeBuildInputs = [ makeWrapper ]; + + postBuild = '' + for i in bin/emoji-picker libexec/ibus-{setup,engine}-typing-booster; do + wrapProgram "$out/$i" \ + --prefix NIX_HUNSPELL_DIRS : ${hunspellDirs} + done + + sed -i -e "s,${typing-booster},$out," $out/share/ibus/component/typing-booster.xml + ''; + + inherit (typing-booster) meta; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch new file mode 100644 index 000000000000..434c85d3dbea --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch @@ -0,0 +1,13 @@ +diff --git a/uniemoji.xml.in b/uniemoji.xml.in +index 5fbfd0f..6fb8ad3 100644 +--- a/uniemoji.xml.in ++++ b/uniemoji.xml.in +@@ -7,7 +7,7 @@ + <license>GPL</license> + <author>Lalo Martins <lalo.martins@gmail.com></author> + <homepage>https://github.com/salty-horse/ibus-uniemoji</homepage> +- <exec>@PYTHON@ @DATADIR@/ibus-uniemoji/uniemoji.py --ibus</exec> ++ <exec>@DATADIR@/ibus-uniemoji/uniemoji.py --ibus</exec> + <textdomain>uniemoji</textdomain> + <engines> + <engine> diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix new file mode 100644 index 000000000000..f78d52f5b679 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix @@ -0,0 +1,62 @@ +{ lib, stdenv +, fetchFromGitHub +, gobject-introspection +, wrapGAppsHook +, python3 +, ibus +}: + +let + python = python3.withPackages (ps: with ps; [ + pygobject3 + (toPythonModule ibus) + pyxdg + python-Levenshtein + ]); +in stdenv.mkDerivation rec { + pname = "ibus-uniemoji"; + version = "0.6.0"; + + src = fetchFromGitHub { + owner = "salty-horse"; + repo = "ibus-uniemoji"; + rev = "v${version}"; + sha256 = "121zh3q0li1k537fcvbd4ns4jgl9bbb9gm9ihy8cfxgirv38lcfa"; + }; + + patches = [ + # Do not run wrapper script with Python, + # the wrapped script will have Python in shebang anyway. + ./allow-wrapping.patch + ]; + + + nativeBuildInputs = [ + wrapGAppsHook + gobject-introspection + ]; + + buildInputs = [ + python + ibus + ]; + + makeFlags = [ + "PREFIX=${placeholder "out"}" + "SYSCONFDIR=${placeholder "out"}/etc" + "PYTHON=${python.interpreter}" + ]; + + postFixup = '' + wrapGApp $out/share/ibus-uniemoji/uniemoji.py + ''; + + meta = with lib; { + isIbusEngine = true; + description = "Input method (ibus) for entering unicode symbols and emoji by name"; + homepage = "https://github.com/salty-horse/ibus-uniemoji"; + license = with licenses; [ gpl3 mit ]; + platforms = platforms.linux; + maintainers = with maintainers; [ aske ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix new file mode 100644 index 000000000000..c555c507d7bc --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix @@ -0,0 +1,174 @@ +{ lib, stdenv +, substituteAll +, fetchurl +, fetchFromGitHub +, autoreconfHook +, gettext +, makeWrapper +, pkg-config +, vala +, wrapGAppsHook +, dbus +, dconf ? null +, glib +, gdk-pixbuf +, gobject-introspection +, gtk2 +, gtk3 +, gtk-doc +, runCommand +, isocodes +, cldr-emoji-annotation +, unicode-character-database +, unicode-emoji +, python3 +, json-glib +, libnotify ? null +, enablePython2Library ? false +, enableUI ? true +, withWayland ? false +, libxkbcommon ? null +, wayland ? null +, buildPackages +, runtimeShell +, nixosTests +}: + +assert withWayland -> wayland != null && libxkbcommon != null; + +with lib; + +let + python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]); + python3BuildEnv = python3.buildEnv.override { + # ImportError: No module named site + postBuild = '' + makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH + makeWrapper ${glib.dev}/bin/glib-genmarshal $out/bin/glib-genmarshal --unset PYTHONPATH + makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH + ''; + }; + # make-dconf-override-db.sh needs to execute dbus-launch in the sandbox, + # it will fail to read /etc/dbus-1/session.conf unless we add this flag + dbus-launch = runCommand "sandbox-dbus-launch" { + nativeBuildInputs = [ makeWrapper ]; + } '' + makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \ + --add-flags --config-file=${dbus.daemon}/share/dbus-1/session.conf + ''; +in + +stdenv.mkDerivation rec { + pname = "ibus"; + version = "1.5.23"; + + src = fetchFromGitHub { + owner = "ibus"; + repo = "ibus"; + rev = version; + sha256 = "0qnblqhz8wyhchnm36zrxhbvi9g4fcwcgmw7p60yjybdlhq4asc7"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + pythonInterpreter = python3Runtime.interpreter; + pythonSitePackages = python3.sitePackages; + }) + ]; + + outputs = [ "out" "dev" "installedTests" ]; + + postPatch = '' + patchShebangs --build data/dconf/make-dconf-override-db.sh + cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make . + ''; + + preAutoreconf = "touch ChangeLog"; + + configureFlags = [ + "--disable-memconf" + (enableFeature (dconf != null) "dconf") + (enableFeature (libnotify != null) "libnotify") + (enableFeature withWayland "wayland") + (enableFeature enablePython2Library "python-library") + (enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway + (enableFeature enableUI "ui") + "--enable-install-tests" + "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" + "--with-emoji-annotation-dir=${cldr-emoji-annotation}/share/unicode/cldr/common/annotations" + "--with-ucd-dir=${unicode-character-database}/share/unicode" + ]; + + makeFlags = [ + "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus" + "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus" + ]; + + nativeBuildInputs = [ + autoreconfHook + gtk-doc + gettext + makeWrapper + pkg-config + python3BuildEnv + vala + wrapGAppsHook + dbus-launch + ]; + + propagatedBuildInputs = [ + glib + ]; + + buildInputs = [ + dbus + dconf + gdk-pixbuf + gobject-introspection + python3.pkgs.pygobject3 # for pygobject overrides + gtk2 + gtk3 + isocodes + json-glib + libnotify + ] ++ optionals withWayland [ + libxkbcommon + wayland + ]; + + enableParallelBuilding = true; + + doCheck = false; # requires X11 daemon + doInstallCheck = true; + installCheckPhase = '' + $out/bin/ibus version + ''; + + postInstall = '' + # It has some hardcoded FHS paths and also we do not use it + # since we set up the environment in NixOS tests anyway. + moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests" + ''; + + postFixup = '' + # set necessary environment also for tests + for f in $installedTests/libexec/installed-tests/ibus/*; do + wrapGApp $f + done + ''; + + passthru = { + tests = { + installed-tests = nixosTests.installed-tests.ibus; + }; + }; + + meta = { + homepage = "https://github.com/ibus/ibus"; + description = "Intelligent Input Bus, input method framework"; + license = licenses.lgpl21Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ttuegel yegortimoshenko ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch b/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch new file mode 100644 index 000000000000..60269c6c2418 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch @@ -0,0 +1,45 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -429,11 +429,11 @@ + if test "x$enable_pygobject" = "xyes"; then + PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED]) + +- pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"` ++ pyoverridesdir="$prefix/@pythonSitePackages@/gi/overrides" + AC_SUBST(pyoverridesdir) + + if test x"$enable_python2" = x"yes"; then +- py2overridesdir=`$PYTHON2 -c "import gi; print(gi._overridesdir)"` ++ py2overridesdir="$prefix/@pythonSitePackages@/gi/overrides" + AC_SUBST(py2overridesdir) + fi + fi +@@ -462,7 +462,7 @@ + PYTHON2_VERSION=`$PYTHON2 -c "import sys; sys.stdout.write(sys.version[[:3]])"` + PYTHON2_LIBDIR="$PYTHON2_PREFIX/lib/python$PYTHON2_VERSION" + python2dir="$PYTHON2_LIBDIR/site-packages" +- pkgpython2dir="$python2dir/ibus" ++ pkgpython2dir="$prefix/@pythonSitePackages@/ibus" + AC_SUBST(pkgpython2dir) + else + enable_python_library="no (disabled, use --enable-python-library to enable)" +--- a/data/dconf/Makefile.am ++++ b/data/dconf/Makefile.am +@@ -50,7 +50,7 @@ + + install-data-hook: + if test -z "$(DESTDIR)"; then \ +- dconf update; \ ++ true; \ + fi + + EXTRA_DIST = \ +--- a/setup/ibus-setup.in ++++ b/setup/ibus-setup.in +@@ -27,5 +27,5 @@ + export IBUS_DATAROOTDIR=@datarootdir@ + export IBUS_LOCALEDIR=@localedir@ + export IBUS_LIBEXECDIR=${libexecdir} +-exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py $@ ++exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py $@ + diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix b/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix new file mode 100644 index 000000000000..4f6a4e1bef3e --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, ibus, cmake, pkg-config, qt4, icu, doxygen }: + +stdenv.mkDerivation rec { + pname = "ibus-qt"; + version = "1.3.3"; + + src = fetchurl { + url = "https://github.com/ibus/ibus-qt/releases/download/${version}/${pname}-${version}-Source.tar.gz"; + sha256 = "1q9g7qghpcf07valc2ni7yf994xqx2pmdffknj7scxfidav6p19g"; + }; + + nativeBuildInputs = [ cmake pkg-config doxygen ]; + buildInputs = [ ibus qt4 icu ]; + + cmakeFlags = [ "-DQT_PLUGINS_DIR=lib/qt4/plugins" ]; + + meta = with lib; { + homepage = "https://github.com/ibus/ibus-qt/"; + description = "Qt4 interface to the ibus input method"; + platforms = platforms.linux; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ gebner ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix b/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix new file mode 100644 index 000000000000..93078325a0d2 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix @@ -0,0 +1,64 @@ +{ lib, runCommand, makeWrapper, lndir +, dconf, hicolor-icon-theme, ibus, librsvg, plugins ? [] +}: + +let + name = "ibus-with-plugins-" + lib.getVersion ibus; + env = { + buildInputs = [ ibus ] ++ plugins; + nativeBuildInputs = [ lndir makeWrapper ]; + propagatedUserEnvPackages = [ hicolor-icon-theme ]; + paths = [ ibus ] ++ plugins; + inherit (ibus) meta; + }; + command = '' + for dir in bin etc lib libexec share; do + mkdir -p "$out/$dir" + for pkg in $paths; do + if [ -d "$pkg/$dir" ]; then + lndir -silent "$pkg/$dir" "$out/$dir" + fi + done + done + + for prog in ibus; do + wrapProgram "$out/bin/$prog" \ + --set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \ + --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \ + --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \ + --set IBUS_DATAROOTDIR "$out/share" \ + --set IBUS_LIBEXECDIR "$out/libexec" \ + --set IBUS_LOCALEDIR "$out/share/locale" \ + --set IBUS_PREFIX "$out" \ + --set IBUS_TABLE_BIN_PATH "$out/bin" \ + --set IBUS_TABLE_DATA_DIR "$out/share" \ + --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \ + --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \ + --prefix PYTHONPATH : "$PYTHONPATH" \ + --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \ + --suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" + done + + for prog in ibus-daemon; do + wrapProgram "$out/bin/$prog" \ + --set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \ + --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \ + --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \ + --set IBUS_DATAROOTDIR "$out/share" \ + --set IBUS_LIBEXECDIR "$out/libexec" \ + --set IBUS_LOCALEDIR "$out/share/locale" \ + --set IBUS_PREFIX "$out" \ + --set IBUS_TABLE_BIN_PATH "$out/bin" \ + --set IBUS_TABLE_DATA_DIR "$out/share" \ + --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \ + --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \ + --prefix PYTHONPATH : "$PYTHONPATH" \ + --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \ + --suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \ + --add-flags "--cache=refresh" + done + ''; +in + runCommand name env command diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix b/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix new file mode 100644 index 000000000000..ab4242295a0f --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchFromGitLab, cmake }: + +stdenv.mkDerivation rec { + pname = "caps2esc"; + version = "0.1.3"; + + src = fetchFromGitLab { + owner = "interception/linux/plugins"; + repo = pname; + rev = "v${version}"; + sha256 = "10xv56vh5h3lxyii3ni166ddv1sz2pylrjmdwxhb4gd2p5zgl1ji"; + }; + + nativeBuildInputs = [ cmake ]; + + meta = with lib; { + homepage = "https://gitlab.com/interception/linux/plugins/caps2esc"; + description = "Transforming the most useless key ever into the most useful one"; + license = licenses.mit; + maintainers = [ maintainers.vyp ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix b/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix new file mode 100644 index 000000000000..21636ea8d8eb --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, pkg-config, cmake, libyamlcpp, + libevdev, udev }: + +let + version = "0.2.1"; + baseName = "interception-tools"; +in stdenv.mkDerivation { + name = "${baseName}-${version}"; + + src = fetchurl { + url = "https://gitlab.com/interception/linux/tools/repository/v${version}/archive.tar.gz"; + sha256 = "0lqz89wsf9r5xdgflincysxg4l8fpgg5z8zczhhrg9s5787srfzi"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ libevdev udev libyamlcpp ]; + + prePatch = '' + substituteInPlace CMakeLists.txt --replace \ + '"/usr/include/libevdev-1.0"' \ + "\"$(pkg-config --cflags libevdev | cut -c 3-)\"" + ''; + + patches = [ ./fix-udevmon-configuration-job-path.patch ]; + + meta = { + description = "A minimal composable infrastructure on top of libudev and libevdev"; + homepage = "https://gitlab.com/interception/linux/tools"; + license = lib.licenses.gpl3; + maintainers = [ lib.maintainers.vyp ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix b/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix new file mode 100644 index 000000000000..730135e4a7d9 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchFromGitLab, pkg-config, libyamlcpp, libevdev }: + +stdenv.mkDerivation rec { + pname = "dual-function-keys"; + version = "1.1.0"; + + src = fetchFromGitLab { + owner = "interception/linux/plugins"; + repo = pname; + rev = version; + sha256 = "07hksca4g7v4zsvhmhc9j725j3n63fzrkx9sb4a0wrd7rwgr25rz"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libevdev libyamlcpp ]; + + prePatch = '' + substituteInPlace config.mk --replace \ + '/usr/include/libevdev-1.0' \ + "$(pkg-config --cflags libevdev | cut -c 3-)" + ''; + + installFlags = [ "DESTDIR=$(out)" "PREFIX=" ]; + + meta = with lib; { + homepage = "https://gitlab.com/interception/linux/plugins/dual-function-keys"; + description = "Tap for one key, hold for another."; + license = licenses.mit; + maintainers = with maintainers; [ svend ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/fix-udevmon-configuration-job-path.patch b/nixpkgs/pkgs/tools/inputmethods/interception-tools/fix-udevmon-configuration-job-path.patch new file mode 100644 index 000000000000..469c96647d69 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/fix-udevmon-configuration-job-path.patch @@ -0,0 +1,32 @@ +From d3a5d661b80f3597368f517ebaeddfdfaafc1bf2 Mon Sep 17 00:00:00 2001 +From: xd1le <elisp.vim@gmail.com> +Date: Mon, 28 Aug 2017 00:19:09 +1000 +Subject: [PATCH] fix udevmon configuration job path + +For some reason, the udevmon job $PATH seems to be empty (or otherwise +seems to point to `/no-such-path`). This commit fixes that by setting +its $PATH to the same $PATH that the parent udevmon process has. +--- + udevmon.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/udevmon.cpp b/udevmon.cpp +index ebdd909..b523efd 100644 +--- a/udevmon.cpp ++++ b/udevmon.cpp +@@ -237,8 +237,11 @@ private: + case 0: { + char *command[] = {(char *)"sh", (char *)"-c", + (char *)job.c_str(), nullptr}; ++ std::string path = getenv("PATH"); + std::string variables = "DEVNODE=" + devnode; +- char *environment[] = {(char *)variables.c_str(), nullptr}; ++ std::string pathenv = "PATH=" + path; ++ char *environment[] = {(char *)variables.c_str(), ++ (char *)pathenv.c_str(), nullptr}; + execvpe(command[0], command, environment); + std::fprintf(stderr, + R"(exec failed for devnode %s, job "%s" )" +-- +2.14.1 + diff --git a/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix b/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix new file mode 100644 index 000000000000..8980abba2f62 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix @@ -0,0 +1,21 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + pname = "keyfuzz"; + version = "0.2"; + + meta = with lib; { + description = "Manipulate the scancode/keycode translation tables of keyboard drivers"; + homepage = "http://0pointer.de/lennart/projects/keyfuzz/"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ mboes ]; + }; + + src = fetchurl { + url = "http://0pointer.de/lennart/projects/keyfuzz/keyfuzz-0.2.tar.gz"; + sha256 = "0xv9ymivp8fnyc5xcyh1vamxnx90bzw66wlld813fvm6q2gsiknk"; + }; + + configureFlags = [ "--without-initdir" "--disable-lynx" ]; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch new file mode 100644 index 000000000000..4655879149d2 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch @@ -0,0 +1,13 @@ +diff --git a/libinput-gestures b/libinput-gestures +index 66479b6..aca94ac 100755 +--- a/libinput-gestures ++++ b/libinput-gestures +@@ -6,7 +6,7 @@ from collections import OrderedDict + from pathlib import Path + from distutils.version import LooseVersion as Version + +-PROG = Path(sys.argv[0]).stem ++PROG = "libinput-gestures" + + # Conf file containing gesture commands. + # Search first for user file then system file. diff --git a/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch new file mode 100644 index 000000000000..407450c8bccd --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch @@ -0,0 +1,45 @@ +diff --git a/libinput-gestures b/libinput-gestures +index aca94ac..c2f03ca 100755 +--- a/libinput-gestures ++++ b/libinput-gestures +@@ -77,7 +77,7 @@ def get_libinput_vers(): + 'Return the libinput installed version number string' + # Try to use newer libinput interface then fall back to old + # (depreciated) interface. +- res = run(('libinput', '--version'), check=False) ++ res = run(('@libinput@', '--version'), check=False) + return res.strip() if res else \ + run(('libinput-list-devices', '--version'), check=False) + +@@ -87,8 +87,8 @@ if not libvers: + sys.exit('libinput helper tools do not seem to be installed?') + + if Version(libvers) >= Version('1.8'): +- cmd_debug_events = 'libinput debug-events' +- cmd_list_devices = 'libinput list-devices' ++ cmd_debug_events = '@libinput@ debug-events' ++ cmd_list_devices = '@libinput@ list-devices' + else: + cmd_debug_events = 'libinput-debug-events' + cmd_list_devices = 'libinput-list-devices' +@@ -199,7 +199,7 @@ class COMMAND_internal(COMMAND): + + def run(self): + 'Get list of current workspaces and select next one' +- stdout = run(('wmctrl', '-d'), check=False) ++ stdout = run(('@wmctrl@', '-d'), check=False) + if not stdout: + # This command can fail on GNOME when you have only a single + # dynamic workspace using Xorg (probably a GNOME bug) so let's +@@ -233,7 +233,7 @@ class COMMAND_internal(COMMAND): + + # Switch to desired workspace + if index >= minindex and index < maxindex: +- run(('wmctrl', '-s', str(index))) ++ run(('@wmctrl@', '-s', str(index))) + + # Table of gesture handlers + handlers = OrderedDict() +-- +2.19.1 + diff --git a/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix new file mode 100644 index 000000000000..1d0ea40e34f4 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix @@ -0,0 +1,54 @@ +{ lib, stdenv, fetchFromGitHub, makeWrapper, + libinput, wmctrl, python3, + coreutils, xdotool ? null, + extraUtilsPath ? lib.optional (xdotool != null) xdotool +}: +stdenv.mkDerivation rec { + pname = "libinput-gestures"; + version = "2.39"; + + src = fetchFromGitHub { + owner = "bulletmark"; + repo = "libinput-gestures"; + rev = version; + sha256 = "0bzyi55yhr9wyar9mnd09cr6pi88jkkp0f9lndm0a9jwi1xr4bdf"; + }; + patches = [ + ./0001-hardcode-name.patch + ./0002-paths.patch + ]; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ python3 ]; + + postPatch = + '' + substituteInPlace libinput-gestures-setup --replace /usr/ / + + substituteInPlace libinput-gestures \ + --replace /etc "$out/etc" \ + --subst-var-by libinput "${libinput}/bin/libinput" \ + --subst-var-by wmctrl "${wmctrl}/bin/wmctrl" + ''; + installPhase = + '' + runHook preInstall + ${stdenv.shell} libinput-gestures-setup -d "$out" install + runHook postInstall + ''; + postFixup = + '' + rm "$out/bin/libinput-gestures-setup" + substituteInPlace "$out/share/applications/libinput-gestures.desktop" --replace "/usr" "$out" + chmod +x "$out/share/applications/libinput-gestures.desktop" + wrapProgram "$out/bin/libinput-gestures" --prefix PATH : "${lib.makeBinPath ([coreutils] ++ extraUtilsPath)}" + ''; + + meta = with lib; { + homepage = "https://github.com/bulletmark/libinput-gestures"; + description = "Gesture mapper for libinput"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ teozkr ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix b/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix new file mode 100644 index 000000000000..0252efa3cdaa --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchurl +, vala, gobject-introspection, intltool, python2Packages, glib +, pkg-config +, libgee, json-glib, marisa, libkkc-data +}: + +stdenv.mkDerivation rec { + pname = "libkkc"; + version = "0.3.5"; + + src = fetchurl { + url = "${meta.homepage}/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef"; + }; + + nativeBuildInputs = [ + vala gobject-introspection + python2Packages.python python2Packages.marisa + intltool glib pkg-config + ]; + + buildInputs = [ marisa libkkc-data ]; + enableParallelBuilding = true; + + propagatedBuildInputs = [ libgee json-glib ]; + + postInstall = '' + ln -s ${libkkc-data}/lib/libkkc/models $out/share/libkkc/models + ''; + + meta = with lib; { + description = "Japanese Kana Kanji conversion input method library"; + homepage = "https://github.com/ueno/libkkc"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ vanzef ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix b/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix new file mode 100644 index 000000000000..7feb14080e9f --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, gettext }: + +stdenv.mkDerivation rec { + name = "m17n-db-1.8.0"; + + src = fetchurl { + url = "https://download.savannah.gnu.org/releases/m17n/${name}.tar.gz"; + sha256 = "0vfw7z9i2s9np6nmx1d4dlsywm044rkaqarn7akffmb6bf1j6zv5"; + }; + + buildInputs = [ gettext ]; + + configureFlags = lib.optional (stdenv ? glibc) + "--with-charmaps=${stdenv.glibc.out}/share/i18n/charmaps" + ; + + meta = { + homepage = "https://www.nongnu.org/m17n/"; + description = "Multilingual text processing library (database)"; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ astsmtl ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix new file mode 100644 index 000000000000..51e52ce4e953 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix @@ -0,0 +1,19 @@ +{lib, stdenv, fetchurl, m17n_db}: +stdenv.mkDerivation rec { + name = "m17n-lib-1.8.0"; + + src = fetchurl { + url = "https://download.savannah.gnu.org/releases/m17n/${name}.tar.gz"; + sha256 = "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq"; + }; + + buildInputs = [ m17n_db ]; + + meta = { + homepage = "https://www.nongnu.org/m17n/"; + description = "Multilingual text processing library (runtime)"; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ astsmtl ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix new file mode 100644 index 000000000000..f4d276e0a61d --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchurl, libXaw, freetype }: + +stdenv.mkDerivation rec { + name = "libotf-0.9.16"; + + src = fetchurl { + url = "https://download.savannah.gnu.org/releases/m17n/${name}.tar.gz"; + sha256 = "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"; + }; + + outputs = [ "out" "dev" ]; + + buildInputs = [ libXaw freetype ]; + + postInstall = + '' + mkdir -p $dev/bin + mv $out/bin/libotf-config $dev/bin/ + ''; + + meta = { + homepage = "https://www.nongnu.org/m17n/"; + description = "Multilingual text processing library (libotf)"; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ bendlas ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix b/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix new file mode 100644 index 000000000000..5b6b0223a01f --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix @@ -0,0 +1,21 @@ +{ lib, stdenv, fetchurl, pkg-config, gtk2, libhangul }: + +stdenv.mkDerivation { + name = "nabi-1.0.0"; + + src = fetchurl { + url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/nabi/nabi-1.0.0.tar.gz"; + sha256 = "0craa24pw7b70sh253arv9bg9sy4q3mhsjwfss3bnv5nf0xwnncw"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ gtk2 libhangul ]; + + meta = with lib; { + description = "The Easy Hangul XIM"; + homepage = "https://github.com/choehwanjin/nabi"; + license = licenses.gpl2; + maintainers = [ maintainers.ianwookim ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/netevent/default.nix b/nixpkgs/pkgs/tools/inputmethods/netevent/default.nix new file mode 100644 index 000000000000..b7c0e4d47020 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/netevent/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, docutils, installShellFiles }: + +stdenv.mkDerivation { + pname = "netevent"; + version = "20201018"; + + src = fetchFromGitHub { + owner = "Blub"; + repo = "netevent"; + rev = "ddd330f0dc956a95a111c58ad10546071058e4c1"; + sha256 = "0myk91pmim0m51h4b8hplkbxvns0icvfmv0401r0hw8md828nh5c"; + }; + + buildInputs = [ docutils ]; + nativeBuildInputs = [ installShellFiles ]; + + outputs = [ "out" "doc" "man" ]; + + configurePhase = '' + export RST2MAN=rst2man + ./configure + ''; + + installPhase = '' + mkdir -p $out/bin + install -m 0755 netevent $out/bin/ + + installManPage doc/netevent.1 + + mkdir -p $doc/share/doc/netevent + cp doc/netevent.rst $doc/share/doc/netevent/netevent.rst + ''; + + meta = with lib; { + description = "Share linux event devices with other machines"; + homepage = "https://github.com/Blub/netevent"; + license = licenses.gpl2Only; + platforms = platforms.linux; + maintainers = with maintainers; [ rgrunbla ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix new file mode 100644 index 000000000000..bc9aa73c2fc6 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix @@ -0,0 +1,73 @@ +{ lib, stdenv, fetchurl, libiconv, skktools }: + +let + # kana to kanji + small = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.S"; + sha256 = "11cjrc8m99hj4xpl2nvzxanlswpapi92vmgk9d6yimdz0jidb6cq"; + }; + medium = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.M"; + sha256 = "0pwjp9qjmn9sq6zc0k6632l7dc2dbjn45585ibckvvl9iwfqqxdp"; + }; + large = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.L"; + sha256 = "0ps0a7sbkryd6hxvphq14i7g5wci4gvr0vraac8ia2ww67a2xbyc"; + }; + + # english to japanese + edict = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.edict"; + sha256 = "1vrwnq0vvjn61nijbln6wfinqg93802d2a8d4ad82n692v83b1li"; + }; + # misc + assoc = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.assoc"; + sha256 = "1smcbyv6srrhnpl7ic9nqds9nz3g2dgqngmhzkrdlwmvcpvakp1v"; + }; +in + +stdenv.mkDerivation { + pname = "skk-dicts-unstable"; + version = "2020-03-24"; + srcs = [ small medium large edict assoc ]; + nativeBuildInputs = [ skktools ] ++ lib.optional stdenv.isDarwin libiconv; + + phases = [ "installPhase" ]; + installPhase = '' + function dictname() { + src=$1 + name=$(basename $src) # remove dir name + dict=$(echo $name | cut -b34-) # remove sha256 prefix + echo $dict + } + mkdir -p $out/share + + for src in $srcs; do + dst=$out/share/$(dictname $src) + echo ";;; -*- coding: utf-8 -*-" > $dst # libskk requires this on the first line + iconv -f EUC-JP -t UTF-8 $src |\ + ${skktools}/bin/skkdic-expr2 >> $dst + done + + # combine .L .edict and .assoc for convenience + dst=$out/share/SKK-JISYO.combined + echo ";;; -*- coding: utf-8 -*-" > $dst + ${skktools}/bin/skkdic-expr2 \ + $out/share/$(dictname ${large}) + \ + $out/share/$(dictname ${edict}) + \ + $out/share/$(dictname ${assoc}) >> $dst + ''; + + meta = { + description = "A collection of standard SKK dictionaries"; + longDescription = '' + This package provides a collection of standard kana-to-kanji + dictionaries for the SKK Japanese input method. + ''; + homepage = "https://github.com/skk-dev/dict"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ yuriaisaka ]; + platforms = with lib.platforms; linux ++ darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix b/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix new file mode 100644 index 000000000000..130c27090a48 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, gdbm, glib }: + +# Note (2017-10-24, yuriaisaka): +# - Version 1.3.3 dates from Jul. 19, 2013. +# - The latest commit to the github repo dates from Mar. 05, 2017 +# - The repo since appears to have become a kitchen sink place to keep +# misc tools to handle SKK dictionaries, and these tools have runtime +# dependencies on a Ruby interpreter etc. +# - We for the moment do not package them to keep the dependencies slim. +# Probably, shall package the newer tools as skktools-extra in the future. +stdenv.mkDerivation rec { + pname = "skktools"; + version = "1.3.4"; + src = fetchFromGitHub { + owner = "skk-dev"; + repo = "skktools"; + rev = "skktools-${lib.replaceStrings ["."] ["_"] version}"; + sha256 = "1zway8jsm18279xq8zlpr84iqiw373x3v0ysay74n9bjqxbl234a"; + }; + # # See "12.2. Package naming" + # name = "skktools-unstable-${version}"; + # version = "2017-03-05"; + # src = fetchFromGitHub { + # owner = "skk-dev"; + # repo = "skktools"; + # rev = "e14d98e734d2fdff611385c7df65826e94d929db"; + # sha256 = "1k9zxqybl1l5h0a8px2awc920qrdyp1qls50h3kfrj3g65d08aq2"; + # }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ gdbm glib ]; + + meta = { + description = "A collection of tools to edit SKK dictionaries"; + longDescription = '' + This package provides a collection of tools to manipulate + (merge, sort etc.) the dictionaries formatted for SKK Japanese + input method. + ''; + homepage = "https://github.com/skk-dev/skktools"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ yuriaisaka ]; + platforms = with lib.platforms; linux ++ darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix b/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix new file mode 100644 index 000000000000..6829de9241b4 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchurl, unzip }: + +stdenv.mkDerivation { + pname = "tegaki-zinnia-japanese"; + version = "0.3"; + + src = fetchurl { + url = "http://www.tegaki.org/releases/0.3/models/tegaki-zinnia-japanese-0.3.zip"; + sha256 = "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7"; + }; + + meta = with lib; { + description = "Japanese handwriting model for the Zinnia engine"; + homepage = "http://tegaki.org/"; + license = licenses.lgpl21; + platforms = platforms.unix; + maintainers = [ maintainers.gebner ]; + }; + + buildInputs = [ unzip ]; + + makeFlags = [ "installpath=$(out)/share/tegaki/models/zinnia/" ]; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix b/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix new file mode 100644 index 000000000000..d2bd7a14663b --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, xorg, xorgserver, qt4, libGLU, libGL, geis, qmake4Hook }: + +stdenv.mkDerivation rec { + pname = "touchegg"; + version = "1.1.1"; + src = fetchurl { + url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/touchegg/${pname}-${version}.tar.gz"; + sha256 = "95734815c7219d9a71282f3144b3526f2542b4fa270a8e69d644722d024b4038"; + }; + + buildInputs = [ xorgserver libGLU libGL xorg.libX11 xorg.libXtst xorg.libXext qt4 geis ]; + + nativeBuildInputs = [ qmake4Hook ]; + + preConfigure = '' + sed -e "s@/usr/@$out/@g" -i $(find . -name touchegg.pro) + sed -e "s@/usr/@$out/@g" -i $(find ./src/touchegg/config/ -name Config.cpp) + ''; + + meta = { + homepage = "https://github.com/JoseExposito/touchegg"; + description = "Macro binding for touch surfaces"; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix b/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix new file mode 100644 index 000000000000..e7ef0f8accf1 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, perl, systemd }: + +stdenv.mkDerivation rec { + pname = "triggerhappy"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "wertarbyte"; + repo = "triggerhappy"; + rev = "release/${version}"; + sha256 = "0gb1qhrxwq7i5abd408d01a2dpf28nr1fph1fg7w7n0i5i1nnk90"; + }; + + nativeBuildInputs = [ pkg-config perl ]; + buildInputs = [ systemd ]; + + makeFlags = [ "PREFIX=$(out)" "BINDIR=$(out)/bin" ]; + + postInstall = '' + install -D -m 644 -t "$out/etc/triggerhappy/triggers.d" "triggerhappy.conf.examples" + ''; + + meta = with lib; { + description = "A lightweight hotkey daemon"; + longDescription = '' + Triggerhappy is a hotkey daemon developed with small and embedded systems in + mind, e.g. linux based routers. It attaches to the input device files and + interprets the event data received and executes scripts configured in its + configuration. + ''; + homepage = "https://github.com/wertarbyte/triggerhappy/"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ jfrankenau taha ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch b/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch new file mode 100644 index 000000000000..be80962527ba --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch @@ -0,0 +1,38 @@ +--- a/gtk2/immodule/Makefile.in 2015-11-24 16:21:08.967087208 +0900 ++++ b/gtk2/immodule/Makefile.in 2015-11-24 16:22:53.316095150 +0900 +@@ -928,7 +928,6 @@ + + install-data-am: install-moduleLTLIBRARIES + @$(NORMAL_INSTALL) +- $(MAKE) $(AM_MAKEFLAGS) install-data-hook + install-dvi: install-dvi-am + + install-dvi-am: +@@ -993,7 +992,7 @@ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ +- install-data-hook install-dvi install-dvi-am install-exec \ ++ install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-moduleLTLIBRARIES \ + install-pdf install-pdf-am install-ps install-ps-am \ +--- a/gtk3/immodule/Makefile.in 2015-11-24 16:21:08.971087209 +0900 ++++ b/gtk3/immodule/Makefile.in 2015-11-24 16:23:28.251097832 +0900 +@@ -896,7 +896,6 @@ + + install-data-am: install-moduleLTLIBRARIES + @$(NORMAL_INSTALL) +- $(MAKE) $(AM_MAKEFLAGS) install-data-hook + install-dvi: install-dvi-am + + install-dvi-am: +@@ -959,7 +958,7 @@ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ +- install-data install-data-am install-data-hook install-dvi \ ++ install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-moduleLTLIBRARIES install-pdf install-pdf-am \ diff --git a/nixpkgs/pkgs/tools/inputmethods/uim/default.nix b/nixpkgs/pkgs/tools/inputmethods/uim/default.nix new file mode 100644 index 000000000000..9336d5429c12 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/uim/default.nix @@ -0,0 +1,146 @@ +{ lib, stdenv, fetchFromGitHub, shared-mime-info +, autoconf, automake, intltool, libtool, pkg-config, cmake +, ruby, librsvg +, ncurses, m17n_lib, m17n_db, expat +, withAnthy ? true, anthy ? null +, withGtk ? true +, withGtk2 ? withGtk, gtk2 ? null +, withGtk3 ? withGtk, gtk3 ? null +, withQt ? true +, withQt4 ? withQt, qt4 ? null +, withQt5 ? false, qt5 ? null +, withLibnotify ? true, libnotify ? null +, withSqlite ? true, sqlite ? null +, withNetworking ? true, curl ? null, openssl ? null +, withFFI ? true, libffi ? null + +# Things that are clearly an overkill to be enabled by default +, withMisc ? false, libeb ? null +}: + +with lib; + +assert withGtk2 -> gtk2 != null; +assert withGtk3 -> gtk3 != null; + +# TODO(@oxij): ./configure can't find both qmakes at the same time +# this can be fixed by adding an alias qmake -> qmaka${version} in qmake derivation +assert withQt4 -> !withQt5 && qt4 != null; +assert withQt5 -> !withQt4 && qt5 != null; + +assert !withQt5; # fails to build with "Makefile.qmake: No such file or directory" + +assert withAnthy -> anthy != null; +assert withLibnotify -> libnotify != null; +assert withSqlite -> sqlite != null; +assert withNetworking -> curl != null && openssl != null; +assert withFFI -> libffi != null; +assert withMisc -> libeb != null; + +stdenv.mkDerivation rec { + version = "1.8.8"; + pname = "uim"; + + src = fetchFromGitHub { + owner = "uim"; + repo = "uim"; + rev = "2c0958c9c505a87e70e344c2192e2e5123c71ea5"; + fetchSubmodules = true; + sha256 = "1hkjxi5r49gcna37m3jvykny5hz9ram4y8a3q7lw4qzr52mz9pdp"; + }; + + nativeBuildInputs = [ + autoconf automake intltool libtool pkg-config cmake + + ruby # used by sigscheme build to generate function tables + librsvg # used by uim build to generate png pixmaps from svg + ]; + + buildInputs = [ + ncurses m17n_lib m17n_db expat + ] + ++ optional withAnthy anthy + ++ optional withGtk2 gtk2 + ++ optional withGtk3 gtk3 + ++ optional withQt4 qt4 + ++ optionals withQt5 [ qt5.qtbase.bin qt5.qtbase.dev ] + ++ optional withLibnotify libnotify + ++ optional withSqlite sqlite + ++ optionals withNetworking [ + curl openssl + ] + ++ optional withFFI libffi + ++ optional withMisc libeb; + + prePatch = '' + patchShebangs *.sh */*.sh */*/*.sh + + # configure sigscheme in maintainer mode or else some function tables won't get autogenerated + substituteInPlace configure.ac \ + --replace "--with-master-pkg=uim --enable-conf=uim" \ + "--enable-maintainer-mode --with-master-pkg=uim --enable-conf=uim" + + # generate ./configure files + (cd sigscheme/libgcroots; ./autogen.sh) + (cd sigscheme; ./autogen.sh) + ./autogen.sh + ''; + + patches = [ ./data-hook.patch ]; + + configureFlags = [ + # configure in maintainer mode or else some pixmaps won't get autogenerated + # this should imply the above `--enable-maintainer-mode`, but it does not + "--enable-maintainer-mode" + + "--enable-pref" + "--with-skk" + "--with-x" + "--with-xft" + "--with-expat=${expat.dev}" + ] + ++ optional withAnthy "--with-anthy-utf8" + ++ optional withGtk2 "--with-gtk2" + ++ optional withGtk3 "--with-gtk3" + ++ optionals withQt4 [ + "--with-qt4" + "--with-qt4-immodule" + ] + ++ optionals withQt5 [ + "--with-qt5" + "--with-qt5-immodule" + ] + ++ optional withLibnotify "--enable-notify=libnotify" + ++ optional withSqlite "--with-sqlite3" + ++ optionals withNetworking [ + "--with-curl" + "--with-openssl-dir=${openssl.dev}" + ] + ++ optional withFFI "--with-ffi" + ++ optional withMisc "--with-eb"; + + # TODO: things in `./configure --help`, but not in nixpkgs + #--with-canna Use Canna [default=no] + #--with-wnn Build with libwnn [default=no] + #--with-mana Build a plugin for Mana [default=yes] + #--with-prime Build a plugin for PRIME [default=yes] + #--with-sj3 Use SJ3 [default=no] + #--with-osx-dcs Build with OS X Dictionary Services [default=no] + + # TODO: fix this in librsvg/glib later + # https://github.com/NixOS/nixpkgs/pull/57027#issuecomment-475461733 + preBuild = '' + export XDG_DATA_DIRS="${shared-mime-info}/share" + ''; + + dontUseCmakeConfigure = true; + + meta = with lib; { + homepage = src.meta.homepage; + description = "A multilingual input method framework"; + license = licenses.bsd3; + platforms = platforms.unix; + broken = stdenv.hostPlatform.isAarch64; # fails to build libgcroots (not supported on aarch64) + maintainers = with maintainers; [ ericsagnes oxij ]; + }; +} diff --git a/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix b/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix new file mode 100644 index 000000000000..8070dbc66ba8 --- /dev/null +++ b/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation { + pname = "zinnia"; + version = "2016-08-28"; + + src = fetchFromGitHub { + owner = "taku910"; + repo = "zinnia"; + rev = "fd74d8c8680bb3df8692279151ea6339ab68e32b"; + sha256 = "1izjy5qw6swg0rs2ym2i72zndb90mwrfbd1iv8xbpwckbm4899lg"; + }; + + setSourceRoot = '' + sourceRoot=$(echo */zinnia) + ''; + + meta = with lib; { + description = "Online hand recognition system with machine learning"; + homepage = "http://taku910.github.io/zinnia/"; + license = licenses.bsd2; + platforms = platforms.unix; + maintainers = [ maintainers.gebner ]; + }; +} |