diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/tools/inputmethods')
69 files changed, 2781 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix new file mode 100644 index 000000000000..9214edfefb05 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "anthy-9100h"; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix new file mode 100644 index 000000000000..0dc6f6739257 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchFromGitHub, python3Packages }: + +let + pythonPackages = python3Packages; + +in pythonPackages.buildPythonPackage rec { + name = "${pname}-0.1.0"; + pname = "evdevremapkeys"; + + src = fetchFromGitHub { + owner = "philipl"; + repo = pname; + rev = "68fb618b8142e1b45d7a1e19ea9a5a9bbb206144"; + sha256 = "0c9slflakm5jqd8s1zpxm7gmrrk0335m040d7m70hnsak42jvs2f"; + }; + + propagatedBuildInputs = with pythonPackages; [ + pyyaml + pyxdg + python-daemon + evdev + ]; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix new file mode 100644 index 000000000000..d1e7f85f75f3 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, cmake, fcitx, anthy, gettext, pkgconfig }: + +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 = [ pkgconfig ]; + buildInputs = [ cmake fcitx anthy gettext ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.lib; { + isFcitxEngine = true; + description = "Fcitx Wrapper for anthy"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ ericsagnes ]; + }; + +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix new file mode 100644 index 000000000000..d9b202f7ef15 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchurl, cmake, fcitx, gettext, libchewing, pkgconfig }: + +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 = [ pkgconfig ]; + buildInputs = [ cmake fcitx gettext libchewing ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix new file mode 100644 index 000000000000..043b4438b3cc --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, cmake, pkgconfig, 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 = [ pkgconfig ]; + buildInputs = [ cmake fcitx gettext curl ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace po/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix new file mode 100644 index 000000000000..c9a40b84a6d9 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchurl, cmake, fcitx, libhangul, gettext, pkgconfig }: + +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 = [ pkgconfig ]; + buildInputs = [ cmake fcitx libhangul gettext ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + substituteInPlace data/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch new file mode 100644 index 000000000000..84dd5fc8f462 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix new file mode 100644 index 000000000000..02724a94be39 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix @@ -0,0 +1,53 @@ +{ stdenv, fetchurl, cmake, pkgconfig, 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 = [ pkgconfig ]; + buildInputs = [ fcitx-qt5 qtbase qtwebengine.dev cmake 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix new file mode 100644 index 000000000000..8b25b2846ff5 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, cmake, fcitx, gettext, m17n_lib, m17n_db, pkgconfig }: + +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 = [ pkgconfig ]; + buildInputs = [ cmake fcitx gettext m17n_lib m17n_db ]; + + preInstall = '' + substituteInPlace im/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix new file mode 100644 index 000000000000..69ff9c1fe53d --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix @@ -0,0 +1,113 @@ +{ clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, gyp, which, ninja, + python, pkgconfig, 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 pkgconfig 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 clangStdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix new file mode 100644 index 000000000000..1410dcc1f1cd --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchurl, cmake, pkgconfig, 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"; + }; + + buildInputs = [ cmake pkgconfig 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 + ''; + + enableParallelBuilding = true; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix new file mode 100644 index 000000000000..187587fbfb49 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchFromGitHub, cmake, pkgconfig, 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 pkgconfig ]; + 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix new file mode 100644 index 000000000000..833e417ae913 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix @@ -0,0 +1,29 @@ +{ 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"; + }; + + buildInputs = [ cmake fcitx gettext ]; + + preInstall = '' + substituteInPlace tables/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix new file mode 100644 index 000000000000..ffee83875a17 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix @@ -0,0 +1,29 @@ +{ 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"; + }; + + buildInputs = [ cmake fcitx gettext ]; + + preInstall = '' + substituteInPlace tables/cmake_install.cmake \ + --replace ${fcitx} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix new file mode 100644 index 000000000000..1deff93e2016 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, cmake, fcitx, gettext, pkgconfig }: + +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 = [ pkgconfig ]; + buildInputs = [ cmake 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix new file mode 100644 index 000000000000..69e4425d8c3b --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix new file mode 100644 index 000000000000..ae9d8d0f53f6 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchurl, makeWrapper, pkgconfig, cmake, fcitx, gtk3, isocodes, gnome3 }: + +stdenv.mkDerivation rec { + name = "fcitx-configtool-0.4.10"; + + meta = with stdenv.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 = [ pkgconfig ]; + buildInputs = [ makeWrapper fcitx cmake 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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix new file mode 100644 index 000000000000..3fd1efcc3434 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix @@ -0,0 +1,38 @@ +{ lib, mkDerivation, fetchFromGitLab +, cmake +, extra-cmake-modules +, fcitx +, pkgconfig +, 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 pkgconfig ]; + + 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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch new file mode 100644 index 000000000000..90c9c79aa73d --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix new file mode 100644 index 000000000000..99a92a95060a --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix @@ -0,0 +1,100 @@ +{ stdenv, fetchurl, pkgconfig, 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}) + '' + + stdenv.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 pkgconfig 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix new file mode 100644 index 000000000000..28a08e39b225 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile new file mode 100644 index 000000000000..9aa2c3ac71a8 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem "fusuma" diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock new file mode 100644 index 000000000000..1ca313c6cd54 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix new file mode 100644 index 000000000000..dc6d3a09bfa4 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix new file mode 100644 index 000000000000..2dd9af421ba9 --- /dev/null +++ b/infra/libkookie/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"; + }; +}
\ No newline at end of file diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix new file mode 100644 index 000000000000..6d4947e517e5 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchFromGitHub, pkgconfig, 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 = [ pkgconfig 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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/hime/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/hime/default.nix new file mode 100644 index 000000000000..4d2b44456ae7 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/hime/default.nix @@ -0,0 +1,34 @@ +{ +stdenv, fetchFromGitHub, pkgconfig, 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 pkgconfig ]; + buildInputs = [ libXtst gtk2 gtk3 qt4 qt5.qtbase ]; + + preConfigure = "patchShebangs configure"; + configureFlags = [ "--disable-lib64" "--disable-qt5-immodule" ]; + + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix new file mode 100644 index 000000000000..34d918cb7da7 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix @@ -0,0 +1,57 @@ +{ stdenv +, fetchurl +, gettext +, pkgconfig +, 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 + pkgconfig + wrapGAppsHook + ]; + + configureFlags = [ + "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t" + ]; + + postFixup = '' + substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix new file mode 100644 index 000000000000..18e878b47b5c --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix @@ -0,0 +1,55 @@ +{ stdenv +, fetchFromGitHub +, gettext +, xorg +, pkgconfig +, 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 + pkgconfig + 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix new file mode 100644 index 000000000000..f6ceece34e19 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix @@ -0,0 +1,55 @@ +{ stdenv +, fetchurl +, substituteAll +, appstream-glib +, gettext +, pkgconfig +, 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 + pkgconfig + wrapGAppsHook + ]; + + buildInputs = [ + gtk3 + ibus + libhangul + (python3.withPackages (pypkgs: with pypkgs; [ + pygobject3 + (toPythonModule ibus) + ])) + ]; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch new file mode 100644 index 000000000000..7487d074d559 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix new file mode 100644 index 000000000000..0b16b54ad48b --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl +, vala, intltool, pkgconfig +, 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 pkgconfig + ]; + + buildInputs = [ libkkc ibus skk-dicts gtk3 ]; + + postInstall = '' + ln -s ${skk-dicts}/share $out/share/skk + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix new file mode 100644 index 000000000000..2c1d558f04d3 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix @@ -0,0 +1,54 @@ +{ stdenv +, fetchFromGitHub +, autoreconfHook +, gettext +, pkgconfig +, wrapGAppsHook +, sqlite +, libpinyin +, db +, ibus +, glib +, gtk3 +, python3 +}: + +stdenv.mkDerivation rec { + pname = "ibus-libpinyin"; + version = "1.11.1"; + + src = fetchFromGitHub { + owner = "libpinyin"; + repo = "ibus-libpinyin"; + rev = version; + sha256 = "0b8rilk9zil9gvfhlk3rphcby6ph11dw66j175wp0na6h6hjlaf2"; + }; + + nativeBuildInputs = [ + autoreconfHook + gettext + pkgconfig + wrapGAppsHook + ]; + + buildInputs = [ + ibus + glib + sqlite + libpinyin + (python3.withPackages (pypkgs: with pypkgs; [ + pygobject3 + (toPythonModule ibus) + ])) + gtk3 + db + ]; + + meta = with stdenv.lib; { + isIbusEngine = true; + description = "IBus interface to the libpinyin input method"; + license = licenses.gpl2; + maintainers = with maintainers; [ ericsagnes ]; + platforms = platforms.linux; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix new file mode 100644 index 000000000000..9c5f2cefb517 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix @@ -0,0 +1,24 @@ +{ 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix new file mode 100644 index 000000000000..35e02d52b486 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix @@ -0,0 +1,55 @@ +{ stdenv +, fetchFromGitHub +, autoreconfHook +, pkgconfig +, ibus +, gtk3 +, m17n_lib +, m17n_db +, gettext +, python3 +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "ibus-m17n"; + version = "1.4.3"; + + src = fetchFromGitHub { + owner = "ibus"; + repo = "ibus-m17n"; + rev = version; + sha256 = "0lb2vcnkzy64474j7306ydyw1ali0qbx07sxfms2fqv1nmh161i2"; + }; + + nativeBuildInputs = [ + autoreconfHook + gettext + pkgconfig + wrapGAppsHook + ]; + + buildInputs = [ + ibus + gtk3 + m17n_lib + m17n_db + (python3.withPackages (ps: [ + ps.pygobject3 + (ps.toPythonModule ibus) + ])) + ]; + + configureFlags = [ + "--with-gtk=3.0" + ]; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix new file mode 100644 index 000000000000..695a45d81ffc --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix @@ -0,0 +1,83 @@ +{ stdenv, fetchFromGitHub, which, ninja, python, pkgconfig, 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 stdenv.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 pkgconfig 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 + '' + stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix new file mode 100644 index 000000000000..03a801abbeb0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix @@ -0,0 +1,44 @@ +{ 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix new file mode 100644 index 000000000000..316593990d96 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix @@ -0,0 +1,64 @@ +{ stdenv, fetchgit, fetchFromGitHub, pkgconfig, 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 + ''; + + buildInputs = [ pkgconfig ibus ibus-table python3 cmake ]; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix new file mode 100644 index 000000000000..b74378f07934 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchurl, ibus, ibus-table, pkgconfig, 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 = [ pkgconfig ]; + buildInputs = [ ibus ibus-table python3 ]; + + preBuild = '' + export HOME=$(mktemp -d)/ibus-table-others + ''; + + postFixup = '' + rm -rf $HOME + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix new file mode 100644 index 000000000000..831161df2b7b --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix @@ -0,0 +1,63 @@ +{ stdenv, fetchFromGitHub +, autoreconfHook, docbook2x, pkgconfig +, gtk3, dconf, gobject-introspection +, ibus, python3, wrapGAppsHook }: + +stdenv.mkDerivation rec { + pname = "ibus-table"; + version = "1.9.25"; + + src = fetchFromGitHub { + owner = "kaio"; + repo = "ibus-table"; + rev = version; + sha256 = "0v570qpnb2q79aqr9f0xnska34y7hw34ibiwsf7ybcw69fhi1zkg"; + }; + + 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 + ''; + + buildInputs = [ + dconf + gtk3 + ibus + (python3.withPackages (pypkgs: with pypkgs; [ + pygobject3 + (toPythonModule ibus) + ])) + ]; + + nativeBuildInputs = [ + autoreconfHook + docbook2x + pkgconfig + gobject-introspection + wrapGAppsHook + ]; + + postUnpack = '' + substituteInPlace $sourceRoot/engine/Makefile.am \ + --replace "docbook2man" "docbook2man --sgml" + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix new file mode 100644 index 000000000000..cc0d12745b12 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, python3, ibus, pkgconfig, 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 pkgconfig wrapGAppsHook gobject-introspection ]; + buildInputs = [ python ibus gtk3 m17n_lib ]; + + preFixup = '' + gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${m17n_lib}/lib") + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch new file mode 100644 index 000000000000..7b624b379a26 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix new file mode 100644 index 000000000000..56ddf93af45f --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch new file mode 100644 index 000000000000..434c85d3dbea --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix new file mode 100644 index 000000000000..435d1154d4ad --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix @@ -0,0 +1,62 @@ +{ 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix new file mode 100644 index 000000000000..32db48503919 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix @@ -0,0 +1,174 @@ +{ stdenv +, substituteAll +, fetchurl +, fetchFromGitHub +, autoreconfHook +, gettext +, makeWrapper +, pkgconfig +, 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 stdenv.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 + pkgconfig + 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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch new file mode 100644 index 000000000000..60269c6c2418 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix new file mode 100644 index 000000000000..4e6b92f77c55 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, ibus, cmake, pkgconfig, 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 = [ pkgconfig ]; + buildInputs = [ + ibus cmake qt4 icu doxygen + ]; + + cmakeFlags = [ "-DQT_PLUGINS_DIR=lib/qt4/plugins" ]; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix new file mode 100644 index 000000000000..1b14629d2830 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix @@ -0,0 +1,64 @@ +{ stdenv, runCommand, makeWrapper, lndir +, dconf, hicolor-icon-theme, ibus, librsvg, plugins ? [] +}: + +let + name = "ibus-with-plugins-" + stdenv.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 : "${stdenv.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 : "${stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix new file mode 100644 index 000000000000..7e6206eb1f37 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix @@ -0,0 +1,23 @@ +{ 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix new file mode 100644 index 000000000000..39a28214fe20 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, pkgconfig, 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 pkgconfig ]; + 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 = stdenv.lib.licenses.gpl3; + maintainers = [ stdenv.lib.maintainers.vyp ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/fix-udevmon-configuration-job-path.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/interception-tools/fix-udevmon-configuration-job-path.patch new file mode 100644 index 000000000000..469c96647d69 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix new file mode 100644 index 000000000000..0b2883f70a45 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation { + pname = "keyfuzz"; + version = "0.2"; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch new file mode 100644 index 000000000000..4655879149d2 --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch new file mode 100644 index 000000000000..407450c8bccd --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix new file mode 100644 index 000000000000..b816a6898ab3 --- /dev/null +++ b/infra/libkookie/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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix new file mode 100644 index 000000000000..1e24d5d969f9 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl +, vala, gobject-introspection, intltool, python2Packages, glib +, pkgconfig +, 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 pkgconfig + ]; + + buildInputs = [ marisa libkkc-data ]; + enableParallelBuilding = true; + + propagatedBuildInputs = [ libgee json-glib ]; + + postInstall = '' + ln -s ${libkkc-data}/lib/libkkc/models $out/share/libkkc/models + ''; + + meta = with stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix new file mode 100644 index 000000000000..1abd84608454 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix @@ -0,0 +1,24 @@ +{ 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 = stdenv.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 = stdenv.lib.licenses.lgpl21Plus; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ astsmtl ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix new file mode 100644 index 000000000000..f7bff5092051 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix @@ -0,0 +1,19 @@ +{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 = stdenv.lib.licenses.lgpl21Plus; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ astsmtl ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix new file mode 100644 index 000000000000..7703de957167 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix @@ -0,0 +1,28 @@ +{ 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 = stdenv.lib.licenses.lgpl21Plus; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ bendlas ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix new file mode 100644 index 000000000000..ef316ec55a0a --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl, pkgconfig, 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 = [ pkgconfig ]; + buildInputs = [ gtk2 libhangul ]; + + meta = with stdenv.lib; { + description = "The Easy Hangul XIM"; + homepage = "https://github.com/choehwanjin/nabi"; + license = licenses.gpl2; + maintainers = [ maintainers.ianwookim ]; + platforms = platforms.linux; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix new file mode 100644 index 000000000000..4d2f37b865db --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix @@ -0,0 +1,73 @@ +{ stdenv, fetchurl, libiconv, skktools }: + +let + # kana to kanji + small = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.S"; + sha256 = "15kp4iwz58fp1zg0i13x7w9wwm15v8n2hhm0nf2zsl7az5mn5yi4"; + }; + medium = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.M"; + sha256 = "1vhagixhrp9lq5x7dldxcanhznawazp00xivpp1z52kx10lnkmv0"; + }; + large = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.L"; + sha256 = "07cv0j95iajkr48j4ln411vnhl3z93yx96zjc03bgs10dbpagaaz"; + }; + + # english to japanese + edict = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.edict"; + sha256 = "18k8z1wkgwgfwbs6sylf39h1nc1p5l2b00h7mfjlb8p91plkb45w"; + }; + # misc + assoc = fetchurl { + url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.assoc"; + sha256 = "12d6xpp1bfin9nwl35ydl5yc6vx0qpwhxss0khi19n1nsbyqnixm"; + }; +in + +stdenv.mkDerivation { + pname = "skk-dicts-unstable"; + version = "2017-10-26"; + srcs = [ small medium large edict assoc ]; + nativeBuildInputs = [ skktools ] ++ stdenv.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 = stdenv.lib.licenses.gpl2Plus; + maintainers = with stdenv.lib.maintainers; [ yuriaisaka ]; + platforms = with stdenv.lib.platforms; linux ++ darwin; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix new file mode 100644 index 000000000000..b150521396c3 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchFromGitHub, pkgconfig, 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-${stdenv.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 = [ pkgconfig ]; + 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 = stdenv.lib.licenses.gpl2Plus; + maintainers = with stdenv.lib.maintainers; [ yuriaisaka ]; + platforms = with stdenv.lib.platforms; linux ++ darwin; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix new file mode 100644 index 000000000000..4295e2b3fdd8 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix @@ -0,0 +1,23 @@ +{ 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix new file mode 100644 index 000000000000..6bda390dc4aa --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix @@ -0,0 +1,26 @@ +{ 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 = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix new file mode 100644 index 000000000000..22987fe639f6 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, pkgconfig, perl, systemd }: + +stdenv.mkDerivation rec { + pname = "triggerhappy"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "wertarbyte"; + repo = "triggerhappy"; + rev = "release/${version}"; + sha256 = "0gb1qhrxwq7i5abd408d01a2dpf28nr1fph1fg7w7n0i5i1nnk90"; + }; + + nativeBuildInputs = [ pkgconfig 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch new file mode 100644 index 000000000000..be80962527ba --- /dev/null +++ b/infra/libkookie/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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/uim/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/uim/default.nix new file mode 100644 index 000000000000..7fe00bd4dfce --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/uim/default.nix @@ -0,0 +1,146 @@ +{ stdenv, fetchFromGitHub, shared-mime-info +, autoconf, automake, intltool, libtool, pkgconfig, 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 stdenv.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 pkgconfig 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 stdenv.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/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix new file mode 100644 index 000000000000..b1516aa56ab0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix @@ -0,0 +1,25 @@ +{ 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 stdenv.lib; { + description = "Online hand recognition system with machine learning"; + homepage = "http://taku910.github.io/zinnia/"; + license = licenses.bsd2; + platforms = platforms.unix; + maintainers = [ maintainers.gebner ]; + }; +} |