Merge branch 'ibus'

This commit is contained in:
Thomas Tuegel 2016-02-26 18:10:11 -06:00
commit 272cf5c44f
7 changed files with 168 additions and 71 deletions

View File

@ -9,6 +9,17 @@ let
name = "ibus-engine";
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isIbusEngine"] false x);
};
ibusAutostart = pkgs.writeTextFile {
name = "autostart-ibus-daemon";
destination = "/etc/xdg/autostart/ibus-daemon.desktop";
text = ''
[Desktop Entry]
Name=IBus
Type=Application
Exec=${ibusPackage}/bin/ibus-daemon -dx
'';
};
in
{
options = {
@ -27,17 +38,14 @@ in
config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
# Without dconf enabled it is impossible to use IBus
environment.systemPackages = [ ibusPackage pkgs.gnome3.dconf ];
gtkPlugins = [ pkgs.ibus ];
qtPlugins = [ pkgs.ibus-qt ];
environment.systemPackages = with pkgs; [
ibusPackage ibus-qt gnome3.dconf ibusAutostart
];
environment.variables = {
GTK_IM_MODULE = "ibus";
QT_IM_MODULE = "ibus";
XMODIFIERS = "@im=ibus";
};
services.xserver.displayManager.sessionCommands = "${ibusPackage}/bin/ibus-daemon --daemonize --xim --cache=none";
};
}

View File

@ -1,5 +1,7 @@
{ stdenv, fetchFromGitHub, makeWrapper, ibus, anthy, intltool, pkgconfig, glib, gobjectIntrospection,
python, pythonPackages, gtk3, libtool, automake, autoconf }:
{ stdenv, fetchFromGitHub, makeWrapper, ibus, anthy, intltool
, pkgconfig, glib, gobjectIntrospection
, python3, pygobject3, gtk3, libtool, automake, autoconf
}:
stdenv.mkDerivation rec {
name = "ibus-anthy-${version}";
@ -18,12 +20,14 @@ stdenv.mkDerivation rec {
configureFlags = "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t";
buildInputs = [ makeWrapper ibus anthy intltool pkgconfig glib gobjectIntrospection
python pythonPackages.pygobject3 gtk3 libtool automake autoconf ];
buildInputs = [
makeWrapper ibus anthy intltool pkgconfig glib gobjectIntrospection
python3 pygobject3 gtk3 libtool automake autoconf
];
postFixup = ''
substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
for file in "$out"/libexec/*; do
for file in "$out"/libexec/*; do # */
wrapProgram "$file" \
--prefix PYTHONPATH : $PYTHONPATH \
--prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH:$out/lib/girepository-1.0

View File

@ -1,24 +1,20 @@
{ stdenv, gnome, fetchFromGitHub, ibus, libhangul, autoconf, automake, gettext, libtool, librsvg,
intltool, pkgconfig, pythonPackages, makeWrapper, gtk3, python }:
{ stdenv, fetchurl, makeWrapper
, intltool, pkgconfig
, gtk3, ibus, libhangul, librsvg, python3, pygobject3
}:
stdenv.mkDerivation rec {
name = "ibus-hangul-${version}";
version = "1.5.0";
src = fetchFromGitHub {
owner = "choehwanjin";
repo = "ibus-hangul";
rev = version;
sha256 = "12l2spr32biqdbz01bzkamgq5gskbi6cd7ai343wqyy1ibjlkmp8";
src = fetchurl {
url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${name}.tar.gz";
sha256 = null;
};
buildInputs = [ ibus libhangul autoconf gettext automake libtool
intltool pkgconfig python pythonPackages.pygobject3 gtk3 makeWrapper ];
buildInputs = [ gtk3 ibus libhangul python3 pygobject3 ];
preConfigure = ''
autoreconf --verbose --force --install
intltoolize --automake --force --copy
'';
nativeBuildInputs = [ intltool makeWrapper pkgconfig ];
postInstall = ''
wrapProgram $out/bin/ibus-setup-hangul \

View File

@ -1,15 +1,53 @@
{ stdenv, fetchurl, ibus, pkgconfig, python3, pythonPackages }:
{ stdenv, fetchurl, makeWrapper, ibus, pkgconfig, python3, pygobject3
, gtk3, atk, dconf, gobjectIntrospection }:
stdenv.mkDerivation rec {
name = "ibus-table-${version}";
version = "1.9.6";
version = "1.9.11";
src = fetchurl {
url = "https://github.com/kaio/ibus-table/releases/download/${version}/${name}.tar.gz";
sha256 = "0xygfscmsx0x80c4d4v40k9bc7831kgdsc74mc84ljxbjg9p9lcf";
sha256 = "14sb89z1inbbhcrbsm5nww8la04ncy2lk32mxfqpi4ghl22ixxqd";
};
buildInputs = [ ibus pkgconfig python3 pythonPackages.pygobject3 ];
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"
'';
buildInputs = [
gtk3 dconf gobjectIntrospection
ibus
pkgconfig
python3 pygobject3
];
nativeBuildInputs = [ makeWrapper ];
preFixup = ''
for prog in "$out/bin"/*; do #*/
wrapProgram "$prog" \
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
--prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules"
done
for prog in "$out/libexec"/*; do #*/
wrapProgram "$prog" \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0"
done
'';
meta = with stdenv.lib; {
isIbusEngine = true;

View File

@ -1,42 +1,71 @@
{ stdenv, fetchurl, makeWrapper, python, intltool, pkgconfig
, gnome3, atk, pygobject3, dbus, libnotify, isocodes, gobjectIntrospection, wayland }:
{ stdenv, fetchurl, makeWrapper
, intltool, isocodes, pkgconfig
, python3, pygobject3
, gtk2, gtk3, atk, dconf, glib
, dbus, libnotify, gobjectIntrospection, wayland
}:
stdenv.mkDerivation rec {
name = "ibus-${version}";
version = "1.5.11";
version = "1.5.13";
src = fetchurl {
url = "https://github.com/ibus/ibus/releases/download/${version}/${name}.tar.gz";
sha256 = "1g26llizd26h9sfz4xdq8krhz19hn08pirvfbkk3g89ri8lmm6a9";
sha256 = "1wd5azlsgdih8qw6gi15rv130s6d90846n3r1ccwmp6z882xhwzd";
};
configureFlags = "--disable-gconf --enable-dconf --disable-memconf --enable-ui --enable-python-library";
postPatch = ''
# These paths will be set in the wrapper.
sed -e "/export IBUS_DATAROOTDIR/ s/^.*$//" \
-e "/export IBUS_LIBEXECDIR/ s/^.*$//" \
-e "/export IBUS_LOCALEDIR/ s/^.*$//" \
-e "/export IBUS_PREFIX/ s/^.*$//" \
-i "setup/ibus-setup.in"
'';
buildInputs = [
makeWrapper python gnome3.glib wayland
intltool pkgconfig gnome3.gtk2
gnome3.gtk3 dbus gnome3.dconf gnome3.gconf
libnotify isocodes gobjectIntrospection
configureFlags = [
"--disable-gconf"
"--enable-dconf"
"--disable-memconf"
"--enable-ui"
"--enable-python-library"
];
buildInputs = [
python3 pygobject3
intltool isocodes pkgconfig
gtk2 gtk3 dconf glib
dbus libnotify gobjectIntrospection wayland
];
nativeBuildInputs = [ makeWrapper ];
preConfigure = ''
# Fix hard-coded installation paths, so make does not try to overwrite our
# Python installation.
sed -e "/py2overridesdir=/ s|=.*$|=$out/lib/${python3.libPrefix}|" \
-e "/pyoverridesdir=/ s|=.*$|=$out/lib/${python3.libPrefix}|" \
-e "/PYTHON2_LIBDIR/ s|=.*|=$out/lib/${python3.libPrefix}|" \
-i configure
# Don't try to generate a system-wide dconf database; it wouldn't work.
substituteInPlace data/dconf/Makefile.in --replace "dconf update" "echo"
sed -i "s|PYTHON2_LIBDIR=.*|PYTHON2_LIBDIR=$out/lib/${python.libPrefix}|" configure
'';
preFixup = ''
for f in "$out"/bin/*; do
wrapProgram "$f" --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
--prefix PYTHONPATH : "$(toPythonPath ${pygobject3})" \
--prefix LD_LIBRARY_PATH : "${gnome3.gtk3}/lib:${atk}/lib:$out/lib" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
--prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules"
for f in "$out/bin"/*; do #*/
wrapProgram "$f" \
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
--prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules"
done
'';
meta = {
meta = with stdenv.lib; {
homepage = https://github.com/ibus/ibus;
description = "Intelligent Input Bus for Linux / Unix OS";
platforms = stdenv.lib.platforms.linux;
platforms = platforms.linux;
maintainers = [ maintainers.ttuegel ];
};
}

View File

@ -1,24 +1,36 @@
{ stdenv, buildEnv, ibus, makeWrapper, plugins, hicolor_icon_theme }:
{ stdenv, runCommand, ibus, lndir, makeWrapper, plugins, hicolor_icon_theme }:
let
drv = buildEnv {
name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version;
paths = [ ibus hicolor_icon_theme ] ++ plugins;
postBuild = ''
# TODO: This could be avoided if buildEnv could be forced to create all directories
if [ -L $out/bin ]; then
rm $out/bin
mkdir $out/bin
for i in ${ibus}/bin/*; do
ln -s $i $out/bin
done
fi
wrapProgram $out/bin/ibus \
--set IBUS_COMPONENT_PATH "$out/share/ibus/component/"
wrapProgram $out/bin/ibus-daemon \
--set IBUS_COMPONENT_PATH "$out/share/ibus/component/"
'';
env = {
nativeBuildInputs = [ lndir makeWrapper ];
propagatedUserEnvPackages = [ hicolor_icon_theme ];
paths = [ ibus ] ++ plugins;
};
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
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 ibus-daemon ibus-setup; do
wrapProgram "$out/bin/$prog" \
--suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" \
--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" \
--set IBUS_TABLE_DEBUG_LEVEL 1
done
'';
in
runCommand name env command

View File

@ -1162,15 +1162,22 @@ let
m17n_lib = callPackage ../tools/inputmethods/m17n-lib { };
ibus = callPackage ../tools/inputmethods/ibus { };
ibus = callPackage ../tools/inputmethods/ibus {
inherit (python3Packages) pygobject3;
inherit (gnome3) dconf glib;
};
ibus-qt = callPackage ../tools/inputmethods/ibus/ibus-qt.nix { };
ibus-engines = {
anthy = callPackage ../tools/inputmethods/ibus-engines/ibus-anthy { };
anthy = callPackage ../tools/inputmethods/ibus-engines/ibus-anthy {
inherit (python3Packages) pygobject3;
};
hangul = callPackage ../tools/inputmethods/ibus-engines/ibus-hangul { };
hangul = callPackage ../tools/inputmethods/ibus-engines/ibus-hangul {
inherit (python3Packages) pygobject3;
};
m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { };
@ -1178,7 +1185,10 @@ let
inherit (pythonPackages) gyp;
};
table = callPackage ../tools/inputmethods/ibus-engines/ibus-table { };
table = callPackage ../tools/inputmethods/ibus-engines/ibus-table {
inherit (python3Packages) pygobject3;
inherit (gnome3) dconf;
};
table-others = callPackage ../tools/inputmethods/ibus-engines/ibus-table-others {
ibus-table = ibus-engines.table;