summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-12-07 12:10:44 +0100
committerGitHub <noreply@github.com>2019-12-07 12:10:44 +0100
commit36de08ebe13a751aa24babe2f3d711c45c208496 (patch)
tree253f87aa0225f238cc260dc0f29037daffd8c849 /pkgs
parent928fdab4a100be81739592d115ff7fc734fae3ca (diff)
parentf6afb29ee1c3a60e4dd98916a81ca79b3dc9feee (diff)
downloadnixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.tar
nixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.tar.gz
nixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.tar.bz2
nixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.tar.lz
nixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.tar.xz
nixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.tar.zst
nixpkgs-36de08ebe13a751aa24babe2f3d711c45c208496.zip
Merge pull request #71442 from jtojnar/ibus-fixes
Fix/clean up various ibus-engines
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/data/misc/cldr-emoji-annotation/default.nix27
-rw-r--r--pkgs/data/misc/unicode-character-database/default.nix38
-rw-r--r--pkgs/data/misc/unicode-emoji/default.nix59
-rw-r--r--pkgs/data/misc/unihan-database/default.nix38
-rw-r--r--pkgs/desktops/gnome-3/core/gucharmap/default.nix86
-rw-r--r--pkgs/desktops/gnome-3/core/gucharmap/unicode-data.nix45
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix56
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix11
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix59
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix53
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix3
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch13
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix57
-rw-r--r--pkgs/tools/inputmethods/ibus/default.nix146
-rw-r--r--pkgs/tools/inputmethods/ibus/fix-paths.patch2
-rw-r--r--pkgs/top-level/all-packages.nix8
16 files changed, 494 insertions, 207 deletions
diff --git a/pkgs/data/misc/cldr-emoji-annotation/default.nix b/pkgs/data/misc/cldr-emoji-annotation/default.nix
new file mode 100644
index 00000000000..4279cf8aec4
--- /dev/null
+++ b/pkgs/data/misc/cldr-emoji-annotation/default.nix
@@ -0,0 +1,27 @@
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cldr-emoji-annotation";
+  version = "36.12.120191002_0";
+
+  src = fetchFromGitHub {
+    owner = "fujiwarat";
+    repo = "cldr-emoji-annotation";
+    rev = version;
+    sha256 = "0nxigzs3mxjgi7c8mmdaxsy5sfl7ihsc2nysaj0db198b33w9clw";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Emoji annotation files in CLDR";
+    homepage = "https://www.unicode.org/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/data/misc/unicode-character-database/default.nix b/pkgs/data/misc/unicode-character-database/default.nix
new file mode 100644
index 00000000000..5f50049856f
--- /dev/null
+++ b/pkgs/data/misc/unicode-character-database/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchurl
+, unzip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "unicode-character-database";
+  version = "12.1.0";
+
+  src = fetchurl {
+    url = "https://www.unicode.org/Public/zipped/${version}/UCD.zip";
+    sha256 = "19m06iw0jl7lhlggcmghi12p6jld0qrmfpksgc243yn6sjh53fi5";
+  };
+
+  nativeBuildInputs = [
+    unzip
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$PWD
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/unicode
+    cp -r * $out/share/unicode
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Unicode Character Database";
+    homepage = "https://www.unicode.org/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/data/misc/unicode-emoji/default.nix b/pkgs/data/misc/unicode-emoji/default.nix
new file mode 100644
index 00000000000..05472b26d88
--- /dev/null
+++ b/pkgs/data/misc/unicode-emoji/default.nix
@@ -0,0 +1,59 @@
+{ stdenv
+, fetchurl
+, symlinkJoin
+, lib
+}:
+
+let
+  version = "12.1";
+
+  fetchData = { file, sha256 }: fetchurl {
+    url = "https://www.unicode.org/Public/emoji/${version}/${file}";
+    inherit sha256;
+    downloadToTemp = true;
+    recursiveHash = true;
+    postFetch = ''
+      installDir="$out/share/unicode/emoji"
+      mkdir -p "$installDir"
+      mv "$downloadedFile" "$installDir/${file}"
+    '';
+  };
+
+  srcs = {
+    emoji-data = fetchData {
+      file = "emoji-data.txt";
+      sha256 = "17gfm5a28lsymx36prbjy2g0b27gf3rcgggy0yxdshbxwf6zpf9k";
+    };
+    emoji-sequences = fetchData {
+      file = "emoji-sequences.txt";
+      sha256 = "1fckw5hfyvz5jfp2jczzx8qcs79vf0zyq0z2942230j99arq70vc";
+    };
+    emoji-test = fetchData {
+      file = "emoji-test.txt";
+      sha256 = "0w29lva7gp9g9lf7bz1i24qdalvf440bcq8npsbwr3cpp7na95kh";
+    };
+    emoji-variation-sequences = fetchData {
+      file = "emoji-variation-sequences.txt";
+      sha256 = "0akpib3cinr8xcs045hda5wnpfj6qfdjlkzmq5vgdc50gyhrd2z3";
+    };
+    emoji-zwj-sequences = fetchData {
+      file = "emoji-zwj-sequences.txt";
+      sha256 = "0s2mvy1nr2v1x0rr1fxlsv8ly1vyf9978rb4hwry5vnr678ls522";
+    };
+  };
+in
+
+symlinkJoin rec {
+  name = "unicode-emoji-${version}";
+
+  paths = lib.attrValues srcs;
+
+  passthru = srcs;
+
+  meta = with stdenv.lib; {
+    description = "Unicode Emoji Data Files";
+    homepage = "https://home.unicode.org/emoji/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/data/misc/unihan-database/default.nix b/pkgs/data/misc/unihan-database/default.nix
new file mode 100644
index 00000000000..77da77242a9
--- /dev/null
+++ b/pkgs/data/misc/unihan-database/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchurl
+, unzip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "unihan-database";
+  version = "12.1.0";
+
+  src = fetchurl {
+    url = "https://www.unicode.org/Public/zipped/${version}/Unihan.zip";
+    sha256 = "1kfdhgg2gm52x3s07bijb5cxjy0jxwhd097k5lqhvzpznprm6ibf";
+  };
+
+  nativeBuildInputs = [
+    unzip
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$PWD
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/unicode
+    cp -r * $out/share/unicode
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Unicode Han Database";
+    homepage = "https://www.unicode.org/";
+    license = licenses.free; # https://www.unicode.org/license.html
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/desktops/gnome-3/core/gucharmap/default.nix b/pkgs/desktops/gnome-3/core/gucharmap/default.nix
index 6c291c1874f..ce5e073ac06 100644
--- a/pkgs/desktops/gnome-3/core/gucharmap/default.nix
+++ b/pkgs/desktops/gnome-3/core/gucharmap/default.nix
@@ -1,11 +1,48 @@
-{ stdenv, intltool, fetchFromGitLab, pkgconfig, gtk3, adwaita-icon-theme
-, glib, desktop-file-utils, gtk-doc, autoconf, automake, libtool
-, wrapGAppsHook, gnome3, itstool, libxml2, yelp-tools
-, docbook_xsl, docbook_xml_dtd_412, gsettings-desktop-schemas
-, callPackage, unzip, gobject-introspection }:
+{ stdenv
+, intltool
+, fetchFromGitLab
+, fetchpatch
+, pkgconfig
+, gtk3
+, adwaita-icon-theme
+, glib
+, desktop-file-utils
+, gtk-doc
+, autoconf
+, automake
+, libtool
+, wrapGAppsHook
+, gnome3
+, itstool
+, libxml2
+, yelp-tools
+, docbook_xsl
+, docbook_xml_dtd_412
+, gsettings-desktop-schemas
+, callPackage
+, unzip
+, unicode-character-database
+, unihan-database
+, runCommand
+, symlinkJoin
+, gobject-introspection
+}:
 
 let
-  unicode-data = callPackage ./unicode-data.nix {};
+  # TODO: make upstream patch allowing to use the uncompressed file,
+  # preferably from XDG_DATA_DIRS.
+  # https://gitlab.gnome.org/GNOME/gucharmap/issues/13
+  unihanZip = runCommand "unihan" {} ''
+    mkdir -p $out/share/unicode
+    ln -s ${unihan-database.src} $out/share/unicode/Unihan.zip
+  '';
+  ucd = symlinkJoin {
+    name = "ucd+unihan";
+    paths = [
+      unihanZip
+      unicode-character-database
+    ];
+  };
 in stdenv.mkDerivation rec {
   pname = "gucharmap";
   version = "12.0.1";
@@ -20,16 +57,41 @@ in stdenv.mkDerivation rec {
     sha256 = "0si3ymyfzc5v7ly0dmcs3qgw2wp8cyasycq5hmcr8frl09lr6gkw";
   };
 
+  patches = [
+    # fix build with Unicode 12.1
+    (fetchpatch {
+      url = "https://salsa.debian.org/gnome-team/gucharmap/raw/de079ad494a15f662416257fca2f2b8db757f4ea/debian/patches/update-to-unicode-12.1.patch";
+      sha256 = "093gqsxfpp3s0b88p1dgkskr4ng3hv8irmxc60l3fdrkl8am00xh";
+    })
+  ];
+
   nativeBuildInputs = [
-    pkgconfig wrapGAppsHook unzip intltool itstool
-    autoconf automake libtool gtk-doc docbook_xsl docbook_xml_dtd_412
-    yelp-tools libxml2 desktop-file-utils gobject-introspection
+    pkgconfig
+    wrapGAppsHook
+    unzip
+    intltool
+    itstool
+    autoconf
+    automake
+    libtool
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+    yelp-tools
+    libxml2
+    desktop-file-utils
+    gobject-introspection
   ];
 
-  buildInputs = [ gtk3 glib gsettings-desktop-schemas adwaita-icon-theme ];
+  buildInputs = [
+    gtk3
+    glib
+    gsettings-desktop-schemas
+    adwaita-icon-theme
+  ];
 
   configureFlags = [
-    "--with-unicode-data=${unicode-data}"
+    "--with-unicode-data=${ucd}/share/unicode"
     "--enable-gtk-doc"
   ];
 
@@ -51,7 +113,7 @@ in stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "GNOME Character Map, based on the Unicode Character Database";
-    homepage = https://wiki.gnome.org/Apps/Gucharmap;
+    homepage = "https://wiki.gnome.org/Apps/Gucharmap";
     license = licenses.gpl3;
     maintainers = gnome3.maintainers;
     platforms = platforms.linux;
diff --git a/pkgs/desktops/gnome-3/core/gucharmap/unicode-data.nix b/pkgs/desktops/gnome-3/core/gucharmap/unicode-data.nix
deleted file mode 100644
index 56104aff484..00000000000
--- a/pkgs/desktops/gnome-3/core/gucharmap/unicode-data.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ fetchurl, stdenv, gnome3 }:
-stdenv.mkDerivation rec {
-  pname = "unicode-data";
-  version = "12.0.0";
-  srcs = [
-    (fetchurl {
-      url = "http://www.unicode.org/Public/${version}/ucd/Blocks.txt";
-      sha256 = "041sk54v6rjzb23b9x7yjdwzdp2wc7gvfz7ybavgg4gbh51wm8x1";
-    })
-    (fetchurl {
-      url = "http://www.unicode.org/Public/${version}/ucd/DerivedAge.txt";
-      sha256 = "04j92xp07v273z3pxkbfmi1svmw9kmnjl9nvz9fv0g5ybk9zk7r6";
-    })
-    (fetchurl {
-      url = "http://www.unicode.org/Public/${version}/ucd/NamesList.txt";
-      sha256 = "0vsq8gx7hws8mvxy3nlglpwxw7ky57q0fs09d7w9xgb2ylk7fz61";
-    })
-    (fetchurl {
-      url = "http://www.unicode.org/Public/${version}/ucd/Scripts.txt";
-      sha256 = "18c63hx4y5yg408a8d0wx72d2hfnlz4l560y1fsf9lpzifxpqcmx";
-    })
-    (fetchurl {
-      url = "http://www.unicode.org/Public/${version}/ucd/UnicodeData.txt";
-      sha256 = "07d1kq190kgl92ispfx6zmdkvwvhjga0ishxsngzlw8j3kdkz4ap";
-    })
-    (fetchurl {
-      url = "http://www.unicode.org/Public/${version}/ucd/Unihan.zip";
-      sha256 = "1kfdhgg2gm52x3s07bijb5cxjy0jxwhd097k5lqhvzpznprm6ibf";
-    })
-  ];
-  phases = "installPhase";
-  installPhase = with stdenv.lib; ''
-    mkdir $out
-    for f in $srcs;do
-      cp $f $out/$(stripHash $f)
-    done
-  '';
-  meta = with stdenv.lib; {
-    homepage = http://www.unicode.org/ucd/;
-    description = "Unicode Character Database";
-    maintainers = gnome3.maintainers;
-    license = licenses.mit;
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
index d2f68fd5269..cfdfa85ad9f 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
@@ -1,35 +1,57 @@
-{ stdenv, fetchurl, intltool, pkgconfig
-, anthy, ibus, glib, gobject-introspection, gtk3, python3
+{ stdenv
+, fetchurl
+, gettext
+, pkgconfig
+, wrapGAppsHook
+, anthy
+, ibus
+, glib
+, gobject-introspection
+, gtk3
+, python3
 }:
 
 stdenv.mkDerivation rec {
   pname = "ibus-anthy";
   version = "1.5.11";
 
-  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 ];
+  src = fetchurl {
+    url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1zwgswpibh67sgbza8kvg03v06maxc08ihkgm5hmh333sjq9d5c0";
   };
 
-  configureFlags = [ "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t" ];
-
   buildInputs = [
-    anthy glib gobject-introspection gtk3 ibus (python3.withPackages (ps: [ps.pygobject3]))
+    anthy
+    glib
+    gtk3
+    ibus
+    (python3.withPackages (ps: [
+      ps.pygobject3
+      (ps.toPythonModule ibus)
+    ]))
+  ];
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    pkgconfig
+    wrapGAppsHook
   ];
 
-  nativeBuildInputs = [ intltool pkgconfig python3.pkgs.wrapPython ];
+  configureFlags = [
+    "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t"
+  ];
 
   postFixup = ''
-    wrapPythonPrograms
     substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
   '';
 
-  src = fetchurl {
-    url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1zwgswpibh67sgbza8kvg03v06maxc08ihkgm5hmh333sjq9d5c0";
+  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/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
index 0a38ccfa3bd..d5e2f50299e 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
@@ -1,7 +1,8 @@
 { stdenv
 , fetchurl
 , substituteAll
-, intltool
+, appstream-glib
+, gettext
 , pkgconfig
 , wrapGAppsHook
 , gtk3
@@ -12,11 +13,11 @@
 
 stdenv.mkDerivation rec {
   pname = "ibus-hangul";
-  version = "1.5.1";
+  version = "1.5.3";
 
   src = fetchurl {
     url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "0gha8dfdf54rx8fv3yfikbgdg6lqq6l883lhg7q68ybvkjx9bwbs";
+    sha256 = "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy";
   };
 
   patches = [
@@ -27,9 +28,9 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    intltool
+    appstream-glib
+    gettext
     pkgconfig
-    python3.pkgs.wrapPython
     wrapGAppsHook
   ];
 
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix
index fc4677e06b0..2c1d558f04d 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix
@@ -1,33 +1,54 @@
-{ stdenv, fetchFromGitHub, autoreconfHook
-, intltool, pkgconfig, sqlite, libpinyin, db
-, ibus, glib, gtk3, python3
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+, gettext
+, pkgconfig
+, wrapGAppsHook
+, sqlite
+, libpinyin
+, db
+, ibus
+, glib
+, gtk3
+, python3
 }:
 
 stdenv.mkDerivation rec {
   pname = "ibus-libpinyin";
-  version = "1.10.0";
+  version = "1.11.1";
 
   src = fetchFromGitHub {
-    owner  = "libpinyin";
-    repo   = "ibus-libpinyin";
-    rev    = version;
-    sha256 = "0zkzz6ig74nws8phqxbsggnpf5g5f2hxi0mdyn2m3s4nm14q3ma6";
+    owner = "libpinyin";
+    repo = "ibus-libpinyin";
+    rev = version;
+    sha256 = "0b8rilk9zil9gvfhlk3rphcby6ph11dw66j175wp0na6h6hjlaf2";
   };
 
-  buildInputs = [ ibus glib sqlite libpinyin python3 gtk3 db ];
-  nativeBuildInputs = [ autoreconfHook intltool pkgconfig python3.pkgs.wrapPython ];
+  nativeBuildInputs = [
+    autoreconfHook
+    gettext
+    pkgconfig
+    wrapGAppsHook
+  ];
 
-  postAutoreconf = ''
-    intltoolize
-  '';
-
-  postFixup = "wrapPythonPrograms";
+  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;
+    description = "IBus interface to the libpinyin input method";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
index 01b227f6f1b..c026a9d1a81 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
@@ -1,6 +1,14 @@
-{ stdenv, fetchFromGitHub
-, autoreconfHook, pkgconfig
-, ibus, m17n_lib, m17n_db, gettext, python3
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkgconfig
+, ibus
+, gtk3
+, m17n_lib
+, m17n_db
+, gettext
+, python3
+, wrapGAppsHook
 }:
 
 stdenv.mkDerivation rec {
@@ -8,27 +16,40 @@ stdenv.mkDerivation rec {
   version = "1.4.1";
 
   src = fetchFromGitHub {
-    owner  = "ibus";
-    repo   = "ibus-m17n";
-    rev    = version;
+    owner = "ibus";
+    repo = "ibus-m17n";
+    rev = version;
     sha256 = "1xl7swqn46nhi43rka0zx666mpk667ykag3sz07x0zqrwi41frps";
   };
 
-  buildInputs = [
-    ibus m17n_lib m17n_db gettext
-    python3
+  nativeBuildInputs = [
+    autoreconfHook
+    gettext
+    pkgconfig
+    wrapGAppsHook
   ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig python3.pkgs.wrapPython ];
+  buildInputs = [
+    ibus
+    gtk3
+    m17n_lib
+    m17n_db
+    (python3.withPackages (ps: [
+      ps.pygobject3
+      (ps.toPythonModule ibus)
+    ]))
+  ];
 
-  postFixup = "wrapPythonPrograms";
+  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 ];
+    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/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
index 8e34cb860a6..c95a9c1651c 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
@@ -32,7 +32,6 @@ stdenv.mkDerivation rec {
   buildInputs = [
     dconf
     gtk3
-    gobject-introspection
     ibus
     (python3.withPackages (pypkgs: with pypkgs; [
       pygobject3
@@ -44,7 +43,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
     docbook2x
     pkgconfig
-    python3.pkgs.wrapPython
+    gobject-introspection
     wrapGAppsHook
   ];
 
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch b/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch
new file mode 100644
index 00000000000..434c85d3dbe
--- /dev/null
+++ b/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 &lt;lalo.martins@gmail.com&gt;</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/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
index 107c8c60271..435d1154d4a 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
@@ -1,8 +1,19 @@
-{ stdenv, fetchFromGitHub
-, python3Packages
+{ stdenv
+, fetchFromGitHub
+, gobject-introspection
+, wrapGAppsHook
+, python3
+, ibus
 }:
 
-stdenv.mkDerivation rec {
+let
+  python = python3.withPackages (ps: with ps; [
+    pygobject3
+    (toPythonModule ibus)
+    pyxdg
+    python-Levenshtein
+  ]);
+in stdenv.mkDerivation rec {
   pname = "ibus-uniemoji";
   version = "0.6.0";
 
@@ -13,25 +24,39 @@ stdenv.mkDerivation rec {
     sha256 = "121zh3q0li1k537fcvbd4ns4jgl9bbb9gm9ihy8cfxgirv38lcfa";
   };
 
-  propagatedBuildInputs = with python3Packages; [ pyxdg python-Levenshtein pygobject3 ];
+  patches = [
+    # Do not run wrapper script with Python,
+    # the wrapped script will have Python in shebang anyway.
+    ./allow-wrapping.patch
+  ];
 
-  nativeBuildInputs = [ python3Packages.wrapPython ];
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    python
+    ibus
+  ];
+
+  makeFlags = [
+    "PREFIX=${placeholder ''out''}"
+    "SYSCONFDIR=${placeholder ''out''}/etc"
+    "PYTHON=${python.interpreter}"
+  ];
 
   postFixup = ''
-    buildPythonPath $out
-    patchPythonScript $out/share/ibus-uniemoji/uniemoji.py
+    wrapGApp $out/share/ibus-uniemoji/uniemoji.py
   '';
 
-  makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc"
-                "PYTHON=${python3Packages.python.interpreter}"
-              ];
-
   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 ];
+    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/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix
index 0dc339e51c6..4951074bc43 100644
--- a/pkgs/tools/inputmethods/ibus/default.nix
+++ b/pkgs/tools/inputmethods/ibus/default.nix
@@ -1,74 +1,43 @@
-{ stdenv, substituteAll, fetchurl, fetchFromGitHub, autoreconfHook, gettext, makeWrapper, pkgconfig
-, vala, wrapGAppsHook, dbus, dconf ? null, glib, gdk-pixbuf, gobject-introspection, gtk2
-, gtk3, gtk-doc, isocodes, python3, json-glib, libnotify ? null, enablePython2Library ? false
-, enableUI ? true, withWayland ? false, libxkbcommon ? null, wayland ? null
-, buildPackages, runtimeShell }:
+{ stdenv
+, substituteAll
+, fetchurl
+, fetchFromGitHub
+, autoreconfHook
+, gettext
+, makeWrapper
+, pkgconfig
+, vala
+, wrapGAppsHook
+, dbus
+, dconf ? null
+, glib
+, gdk-pixbuf
+, gobject-introspection
+, gtk2
+, gtk3
+, gtk-doc
+, 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
-  emojiSrcs = {
-    data = fetchurl {
-      url = "http://unicode.org/Public/emoji/5.0/emoji-data.txt";
-      sha256 = "11jfz5rrvyc2ixliqfcjgmch4cn9mfy0x96qnpfcyz5fy1jvfyxf";
-    };
-    sequences = fetchurl {
-      url = "http://unicode.org/Public/emoji/5.0/emoji-sequences.txt";
-      sha256 = "09bii7f5mmladg0kl3n80fa9qaix6bv5ylm92x52j7wygzv0szb1";
-    };
-    variation-sequences = fetchurl {
-      url = "http://unicode.org/Public/emoji/5.0/emoji-variation-sequences.txt";
-      sha256 = "1wlg4gbq7spmpppjfy5zdl82sj0hc836p8gljgfrjmwsjgybq286";
-    };
-    zwj-sequences = fetchurl {
-      url = "http://unicode.org/Public/emoji/5.0/emoji-zwj-sequences.txt";
-      sha256 = "16gvzv76mjv9g81lm1m6cr3rpfqyn2k4hb9a62xd329252dhl25q";
-    };
-    test = fetchurl {
-      url = "http://unicode.org/Public/emoji/5.0/emoji-test.txt";
-      sha256 = "031qk2v8xdnba7hfinmgrmpglc9l8ll2hds6mw885p0hngdb3dgw";
-    };
-  };
-  emojiData = stdenv.mkDerivation {
-    name = "emoji-data-5.0";
-    dontUnpack = true;
-    installPhase = ''
-      mkdir $out
-      ${builtins.toString (flip mapAttrsToList emojiSrcs (k: v: "cp ${v} $out/emoji-${k}.txt;"))}
-    '';
-  };
-  cldrEmojiAnnotation = stdenv.mkDerivation rec {
-    pname = "cldr-emoji-annotation";
-    version = "31.90.0_1";
-    src = fetchFromGitHub {
-      owner = "fujiwarat";
-      repo = "cldr-emoji-annotation";
-      rev = version;
-      sha256 = "1vsj32bg8ab4d80rz0fxy6sj2lv31inzyjnddjm079bnvlaf2kih";
-    };
-    nativeBuildInputs = [ autoreconfHook ];
-  };
-  ucdVersion = "12.0.0";
-  ucdSrcs = {
-    NamesList = fetchurl {
-      url = "https://www.unicode.org/Public/${ucdVersion}/ucd/NamesList.txt";
-      sha256 = "c17c7726f562bd9ef869096807f0297e1edef9a58fdae1fbae487378fa43586f";
-    };
-    Blocks = fetchurl {
-      url = "https://www.unicode.org/Public/${ucdVersion}/ucd/Blocks.txt";
-      sha256 = "a1a3ca4381eb91f7b65afe7cb7df615cdcf67993fef4b486585f66b349993a10";
-    };
-  };
-  ucd = stdenv.mkDerivation {
-    name = "ucd-${ucdVersion}";
-    dontUnpack = true;
-    installPhase = ''
-      mkdir $out
-      ${builtins.toString (flip mapAttrsToList ucdSrcs (k: v: "cp ${v} $out/${k}.txt;"))}
-    '';
-  };
   python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
   python3BuildEnv = python3.buildEnv.override {
     # ImportError: No module named site
@@ -82,13 +51,13 @@ in
 
 stdenv.mkDerivation rec {
   pname = "ibus";
-  version = "1.5.20";
+  version = "1.5.21";
 
   src = fetchFromGitHub {
     owner = "ibus";
     repo = "ibus";
     rev = version;
-    sha256 = "1npavb896qrp6qbqayb0va4mpsi68wybcnlbjknzgssqyw2ylh9r";
+    sha256 = "0fjbqj7d2g5c8i1wdggzhz269xisxv4xb1pa9swalm5p2b2vrjlx";
   };
 
   patches = [
@@ -99,7 +68,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  outputs = [ "out" "dev" ];
+  outputs = [ "out" "dev" "installedTests" ];
 
   postPatch = ''
     echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh
@@ -116,9 +85,15 @@ stdenv.mkDerivation rec {
     (enableFeature enablePython2Library "python-library")
     (enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway
     (enableFeature enableUI "ui")
-    "--with-unicode-emoji-dir=${emojiData}"
-    "--with-emoji-annotation-dir=${cldrEmojiAnnotation}/share/unicode/cldr/common/annotations"
-    "--with-ucd-dir=${ucd}"
+    "--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 = [
@@ -132,7 +107,9 @@ stdenv.mkDerivation rec {
     wrapGAppsHook
   ];
 
-  propagatedBuildInputs = [ glib ];
+  propagatedBuildInputs = [
+    glib
+  ];
 
   buildInputs = [
     dbus
@@ -154,10 +131,31 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # requires X11 daemon
   doInstallCheck = true;
-  installCheckPhase = "$out/bin/ibus version";
+  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;
+    homepage = "https://github.com/ibus/ibus";
     description = "Intelligent Input Bus, input method framework";
     license = licenses.lgpl21Plus;
     platforms = platforms.linux;
diff --git a/pkgs/tools/inputmethods/ibus/fix-paths.patch b/pkgs/tools/inputmethods/ibus/fix-paths.patch
index 192aa7d6395..60269c6c241 100644
--- a/pkgs/tools/inputmethods/ibus/fix-paths.patch
+++ b/pkgs/tools/inputmethods/ibus/fix-paths.patch
@@ -40,6 +40,6 @@
  export IBUS_DATAROOTDIR=@datarootdir@
  export IBUS_LOCALEDIR=@localedir@
  export IBUS_LIBEXECDIR=${libexecdir}
--exec @PYTHON@ @prefix@/share/ibus/setup/main.py $@
+-exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py $@
 +exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py $@
  
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9810986b89b..0f13b529e17 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17129,6 +17129,8 @@ in
 
   cherry = callPackage ../data/fonts/cherry { inherit (xorg) fonttosfnt mkfontdir; };
 
+  cldr-emoji-annotation = callPackage ../data/misc/cldr-emoji-annotation { };
+
   clearlooks-phenix = callPackage ../data/themes/clearlooks-phenix { };
 
   cnstrokeorder = callPackage ../data/fonts/cnstrokeorder {};
@@ -17740,6 +17742,12 @@ in
 
   uni-vga = callPackage ../data/fonts/uni-vga { };
 
+  unicode-character-database = callPackage ../data/misc/unicode-character-database { };
+
+  unicode-emoji = callPackage ../data/misc/unicode-emoji { };
+
+  unihan-database = callPackage ../data/misc/unihan-database { };
+
   unifont = callPackage ../data/fonts/unifont { };
 
   unifont_upper = callPackage ../data/fonts/unifont_upper { };