3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #71442 from jtojnar/ibus-fixes

Fix/clean up various ibus-engines
This commit is contained in:
Jan Tojnar 2019-12-07 12:10:44 +01:00 committed by GitHub
commit 36de08ebe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 571 additions and 242 deletions

View file

@ -53,9 +53,15 @@ in
config = mkIf (config.i18n.inputMethod.enabled == "ibus") { config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
i18n.inputMethod.package = ibusPackage; i18n.inputMethod.package = ibusPackage;
environment.systemPackages = [
ibusAutostart
];
# Without dconf enabled it is impossible to use IBus # Without dconf enabled it is impossible to use IBus
environment.systemPackages = with pkgs; [ programs.dconf.enable = true;
dconf ibusAutostart
services.dbus.packages = [
ibusAutostart
]; ];
environment.variables = { environment.variables = {

View file

@ -29,36 +29,51 @@ let
# Extra flags to pass to gnome-desktop-testing-runner. # Extra flags to pass to gnome-desktop-testing-runner.
, testRunnerFlags ? "" , testRunnerFlags ? ""
}:
makeTest rec {
name = tested.name;
meta = { # Extra attributes to pass to makeTest.
maintainers = tested.meta.maintainers; # They will be recursively merged into the attrset created by this function.
}; , ...
}@args:
makeTest
(recursiveUpdate
rec {
name = tested.name;
machine = { ... }: { meta = {
imports = [ maintainers = tested.meta.maintainers;
testConfig };
] ++ optional withX11 ../common/x11.nix;
environment.systemPackages = with pkgs; [ gnome-desktop-testing ]; machine = { ... }: {
imports = [
testConfig
] ++ optional withX11 ../common/x11.nix;
}; environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
testScript = };
optionalString withX11 ''
machine.wait_for_x() testScript =
'' + optionalString withX11 ''
optionalString (preTestScript != "") '' machine.wait_for_x()
${preTestScript} '' +
'' + optionalString (preTestScript != "") ''
'' ${preTestScript}
machine.succeed( '' +
"gnome-desktop-testing-runner ${testRunnerFlags} -d '${tested.installedTests}/share'" ''
) machine.succeed(
''; "gnome-desktop-testing-runner ${testRunnerFlags} -d '${tested.installedTests}/share'"
}; )
'';
}
(removeAttrs args [
"tested"
"testConfig"
"preTestScript"
"withX11"
"testRunnerFlags"
])
);
in in
@ -73,6 +88,7 @@ in
glib-networking = callInstalledTest ./glib-networking.nix {}; glib-networking = callInstalledTest ./glib-networking.nix {};
gnome-photos = callInstalledTest ./gnome-photos.nix {}; gnome-photos = callInstalledTest ./gnome-photos.nix {};
graphene = callInstalledTest ./graphene.nix {}; graphene = callInstalledTest ./graphene.nix {};
ibus = callInstalledTest ./ibus.nix {};
libgdata = callInstalledTest ./libgdata.nix {}; libgdata = callInstalledTest ./libgdata.nix {};
libxmlb = callInstalledTest ./libxmlb.nix {}; libxmlb = callInstalledTest ./libxmlb.nix {};
ostree = callInstalledTest ./ostree.nix {}; ostree = callInstalledTest ./ostree.nix {};

View file

@ -0,0 +1,20 @@
{ pkgs, makeInstalledTest, ... }:
makeInstalledTest {
tested = pkgs.ibus;
testConfig = {
i18n.inputMethod.enabled = "ibus";
};
preTestScript = ''
# ibus has ibus-desktop-testing-runner but it tries to manage desktop session so we just spawn ibus-daemon ourselves
machine.succeed("ibus-daemon --daemonize --verbose")
'';
withX11 = true;
# TODO: ibus-daemon is currently crashing or something
# maybe make ibus systemd service that auto-restarts?
meta.broken = true;
}

View file

@ -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;
};
}

View file

@ -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;
};
}

View file

@ -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;
};
}

View file

@ -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;
};
}

View file

@ -1,11 +1,48 @@
{ stdenv, intltool, fetchFromGitLab, pkgconfig, gtk3, adwaita-icon-theme { stdenv
, glib, desktop-file-utils, gtk-doc, autoconf, automake, libtool , intltool
, wrapGAppsHook, gnome3, itstool, libxml2, yelp-tools , fetchFromGitLab
, docbook_xsl, docbook_xml_dtd_412, gsettings-desktop-schemas , fetchpatch
, callPackage, unzip, gobject-introspection }: , 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 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 { in stdenv.mkDerivation rec {
pname = "gucharmap"; pname = "gucharmap";
version = "12.0.1"; version = "12.0.1";
@ -20,16 +57,41 @@ in stdenv.mkDerivation rec {
sha256 = "0si3ymyfzc5v7ly0dmcs3qgw2wp8cyasycq5hmcr8frl09lr6gkw"; sha256 = "0si3ymyfzc5v7ly0dmcs3qgw2wp8cyasycq5hmcr8frl09lr6gkw";
}; };
nativeBuildInputs = [ patches = [
pkgconfig wrapGAppsHook unzip intltool itstool # fix build with Unicode 12.1
autoconf automake libtool gtk-doc docbook_xsl docbook_xml_dtd_412 (fetchpatch {
yelp-tools libxml2 desktop-file-utils gobject-introspection url = "https://salsa.debian.org/gnome-team/gucharmap/raw/de079ad494a15f662416257fca2f2b8db757f4ea/debian/patches/update-to-unicode-12.1.patch";
sha256 = "093gqsxfpp3s0b88p1dgkskr4ng3hv8irmxc60l3fdrkl8am00xh";
})
]; ];
buildInputs = [ gtk3 glib gsettings-desktop-schemas adwaita-icon-theme ]; 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
];
buildInputs = [
gtk3
glib
gsettings-desktop-schemas
adwaita-icon-theme
];
configureFlags = [ configureFlags = [
"--with-unicode-data=${unicode-data}" "--with-unicode-data=${ucd}/share/unicode"
"--enable-gtk-doc" "--enable-gtk-doc"
]; ];
@ -51,7 +113,7 @@ in stdenv.mkDerivation rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "GNOME Character Map, based on the Unicode Character Database"; 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; license = licenses.gpl3;
maintainers = gnome3.maintainers; maintainers = gnome3.maintainers;
platforms = platforms.linux; platforms = platforms.linux;

View file

@ -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;
};
}

View file

@ -1,35 +1,57 @@
{ stdenv, fetchurl, intltool, pkgconfig { stdenv
, anthy, ibus, glib, gobject-introspection, gtk3, python3 , fetchurl
, gettext
, pkgconfig
, wrapGAppsHook
, anthy
, ibus
, glib
, gobject-introspection
, gtk3
, python3
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ibus-anthy"; pname = "ibus-anthy";
version = "1.5.11"; 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 ];
};
configureFlags = [ "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t" ];
buildInputs = [
anthy glib gobject-introspection gtk3 ibus (python3.withPackages (ps: [ps.pygobject3]))
];
nativeBuildInputs = [ intltool pkgconfig python3.pkgs.wrapPython ];
postFixup = ''
wrapPythonPrograms
substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
'';
src = fetchurl { src = fetchurl {
url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz"; url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz";
sha256 = "1zwgswpibh67sgbza8kvg03v06maxc08ihkgm5hmh333sjq9d5c0"; 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 ];
};
} }

View file

@ -1,7 +1,8 @@
{ stdenv { stdenv
, fetchurl , fetchurl
, substituteAll , substituteAll
, intltool , appstream-glib
, gettext
, pkgconfig , pkgconfig
, wrapGAppsHook , wrapGAppsHook
, gtk3 , gtk3
@ -12,11 +13,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ibus-hangul"; pname = "ibus-hangul";
version = "1.5.1"; version = "1.5.3";
src = fetchurl { src = fetchurl {
url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${pname}-${version}.tar.gz"; url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${pname}-${version}.tar.gz";
sha256 = "0gha8dfdf54rx8fv3yfikbgdg6lqq6l883lhg7q68ybvkjx9bwbs"; sha256 = "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy";
}; };
patches = [ patches = [
@ -27,9 +28,9 @@ stdenv.mkDerivation rec {
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
intltool appstream-glib
gettext
pkgconfig pkgconfig
python3.pkgs.wrapPython
wrapGAppsHook wrapGAppsHook
]; ];

View file

@ -1,33 +1,54 @@
{ stdenv, fetchFromGitHub, autoreconfHook { stdenv
, intltool, pkgconfig, sqlite, libpinyin, db , fetchFromGitHub
, ibus, glib, gtk3, python3 , autoreconfHook
, gettext
, pkgconfig
, wrapGAppsHook
, sqlite
, libpinyin
, db
, ibus
, glib
, gtk3
, python3
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ibus-libpinyin"; pname = "ibus-libpinyin";
version = "1.10.0"; version = "1.11.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "libpinyin"; owner = "libpinyin";
repo = "ibus-libpinyin"; repo = "ibus-libpinyin";
rev = version; rev = version;
sha256 = "0zkzz6ig74nws8phqxbsggnpf5g5f2hxi0mdyn2m3s4nm14q3ma6"; sha256 = "0b8rilk9zil9gvfhlk3rphcby6ph11dw66j175wp0na6h6hjlaf2";
}; };
buildInputs = [ ibus glib sqlite libpinyin python3 gtk3 db ]; nativeBuildInputs = [
nativeBuildInputs = [ autoreconfHook intltool pkgconfig python3.pkgs.wrapPython ]; autoreconfHook
gettext
pkgconfig
wrapGAppsHook
];
postAutoreconf = '' buildInputs = [
intltoolize ibus
''; glib
sqlite
postFixup = "wrapPythonPrograms"; libpinyin
(python3.withPackages (pypkgs: with pypkgs; [
pygobject3
(toPythonModule ibus)
]))
gtk3
db
];
meta = with stdenv.lib; { meta = with stdenv.lib; {
isIbusEngine = true; isIbusEngine = true;
description = "IBus interface to the libpinyin input method"; description = "IBus interface to the libpinyin input method";
license = licenses.gpl2; license = licenses.gpl2;
maintainers = with maintainers; [ ericsagnes ]; maintainers = with maintainers; [ ericsagnes ];
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View file

@ -1,6 +1,14 @@
{ stdenv, fetchFromGitHub { stdenv
, autoreconfHook, pkgconfig , fetchFromGitHub
, ibus, m17n_lib, m17n_db, gettext, python3 , autoreconfHook
, pkgconfig
, ibus
, gtk3
, m17n_lib
, m17n_db
, gettext
, python3
, wrapGAppsHook
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -8,27 +16,40 @@ stdenv.mkDerivation rec {
version = "1.4.1"; version = "1.4.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ibus"; owner = "ibus";
repo = "ibus-m17n"; repo = "ibus-m17n";
rev = version; rev = version;
sha256 = "1xl7swqn46nhi43rka0zx666mpk667ykag3sz07x0zqrwi41frps"; sha256 = "1xl7swqn46nhi43rka0zx666mpk667ykag3sz07x0zqrwi41frps";
}; };
buildInputs = [ nativeBuildInputs = [
ibus m17n_lib m17n_db gettext autoreconfHook
python3 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; { meta = with stdenv.lib; {
isIbusEngine = true; isIbusEngine = true;
description = "m17n engine for ibus"; description = "m17n engine for ibus";
homepage = https://github.com/ibus/ibus-m17n; homepage = https://github.com/ibus/ibus-m17n;
license = licenses.gpl2; license = licenses.gpl2;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ ericsagnes ]; maintainers = with maintainers; [ ericsagnes ];
}; };
} }

View file

@ -32,7 +32,6 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
dconf dconf
gtk3 gtk3
gobject-introspection
ibus ibus
(python3.withPackages (pypkgs: with pypkgs; [ (python3.withPackages (pypkgs: with pypkgs; [
pygobject3 pygobject3
@ -44,7 +43,7 @@ stdenv.mkDerivation rec {
autoreconfHook autoreconfHook
docbook2x docbook2x
pkgconfig pkgconfig
python3.pkgs.wrapPython gobject-introspection
wrapGAppsHook wrapGAppsHook
]; ];

View file

@ -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>

View file

@ -1,8 +1,19 @@
{ stdenv, fetchFromGitHub { stdenv
, python3Packages , 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"; pname = "ibus-uniemoji";
version = "0.6.0"; version = "0.6.0";
@ -13,25 +24,39 @@ stdenv.mkDerivation rec {
sha256 = "121zh3q0li1k537fcvbd4ns4jgl9bbb9gm9ihy8cfxgirv38lcfa"; 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 = '' postFixup = ''
buildPythonPath $out wrapGApp $out/share/ibus-uniemoji/uniemoji.py
patchPythonScript $out/share/ibus-uniemoji/uniemoji.py
''; '';
makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc"
"PYTHON=${python3Packages.python.interpreter}"
];
meta = with stdenv.lib; { meta = with stdenv.lib; {
isIbusEngine = true; isIbusEngine = true;
description = "Input method (ibus) for entering unicode symbols and emoji by name"; description = "Input method (ibus) for entering unicode symbols and emoji by name";
homepage = "https://github.com/salty-horse/ibus-uniemoji"; homepage = "https://github.com/salty-horse/ibus-uniemoji";
license = with licenses; [ gpl3 mit ]; license = with licenses; [ gpl3 mit ];
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ aske ]; maintainers = with maintainers; [ aske ];
}; };
} }

View file

@ -1,74 +1,43 @@
{ stdenv, substituteAll, fetchurl, fetchFromGitHub, autoreconfHook, gettext, makeWrapper, pkgconfig { stdenv
, vala, wrapGAppsHook, dbus, dconf ? null, glib, gdk-pixbuf, gobject-introspection, gtk2 , substituteAll
, gtk3, gtk-doc, isocodes, python3, json-glib, libnotify ? null, enablePython2Library ? false , fetchurl
, enableUI ? true, withWayland ? false, libxkbcommon ? null, wayland ? null , fetchFromGitHub
, buildPackages, runtimeShell }: , 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; assert withWayland -> wayland != null && libxkbcommon != null;
with stdenv.lib; with stdenv.lib;
let 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 ]); python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
python3BuildEnv = python3.buildEnv.override { python3BuildEnv = python3.buildEnv.override {
# ImportError: No module named site # ImportError: No module named site
@ -82,13 +51,13 @@ in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ibus"; pname = "ibus";
version = "1.5.20"; version = "1.5.21";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ibus"; owner = "ibus";
repo = "ibus"; repo = "ibus";
rev = version; rev = version;
sha256 = "1npavb896qrp6qbqayb0va4mpsi68wybcnlbjknzgssqyw2ylh9r"; sha256 = "0fjbqj7d2g5c8i1wdggzhz269xisxv4xb1pa9swalm5p2b2vrjlx";
}; };
patches = [ patches = [
@ -99,7 +68,7 @@ stdenv.mkDerivation rec {
}) })
]; ];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" "installedTests" ];
postPatch = '' postPatch = ''
echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh
@ -116,9 +85,15 @@ stdenv.mkDerivation rec {
(enableFeature enablePython2Library "python-library") (enableFeature enablePython2Library "python-library")
(enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway (enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway
(enableFeature enableUI "ui") (enableFeature enableUI "ui")
"--with-unicode-emoji-dir=${emojiData}" "--enable-install-tests"
"--with-emoji-annotation-dir=${cldrEmojiAnnotation}/share/unicode/cldr/common/annotations" "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji"
"--with-ucd-dir=${ucd}" "--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 = [ nativeBuildInputs = [
@ -132,7 +107,9 @@ stdenv.mkDerivation rec {
wrapGAppsHook wrapGAppsHook
]; ];
propagatedBuildInputs = [ glib ]; propagatedBuildInputs = [
glib
];
buildInputs = [ buildInputs = [
dbus dbus
@ -154,10 +131,31 @@ stdenv.mkDerivation rec {
doCheck = false; # requires X11 daemon doCheck = false; # requires X11 daemon
doInstallCheck = true; 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 = { meta = {
homepage = https://github.com/ibus/ibus; homepage = "https://github.com/ibus/ibus";
description = "Intelligent Input Bus, input method framework"; description = "Intelligent Input Bus, input method framework";
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;
platforms = platforms.linux; platforms = platforms.linux;

View file

@ -40,6 +40,6 @@
export IBUS_DATAROOTDIR=@datarootdir@ export IBUS_DATAROOTDIR=@datarootdir@
export IBUS_LOCALEDIR=@localedir@ export IBUS_LOCALEDIR=@localedir@
export IBUS_LIBEXECDIR=${libexecdir} 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 $@ +exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py $@

View file

@ -17129,6 +17129,8 @@ in
cherry = callPackage ../data/fonts/cherry { inherit (xorg) fonttosfnt mkfontdir; }; 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 { }; clearlooks-phenix = callPackage ../data/themes/clearlooks-phenix { };
cnstrokeorder = callPackage ../data/fonts/cnstrokeorder {}; cnstrokeorder = callPackage ../data/fonts/cnstrokeorder {};
@ -17740,6 +17742,12 @@ in
uni-vga = callPackage ../data/fonts/uni-vga { }; 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 = callPackage ../data/fonts/unifont { };
unifont_upper = callPackage ../data/fonts/unifont_upper { }; unifont_upper = callPackage ../data/fonts/unifont_upper { };