Merge branch 'ibus'
This commit is contained in:
commit
272cf5c44f
@ -9,6 +9,17 @@ let
|
|||||||
name = "ibus-engine";
|
name = "ibus-engine";
|
||||||
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isIbusEngine"] false x);
|
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
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
@ -27,17 +38,14 @@ in
|
|||||||
|
|
||||||
config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
|
config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
|
||||||
# Without dconf enabled it is impossible to use IBus
|
# Without dconf enabled it is impossible to use IBus
|
||||||
environment.systemPackages = [ ibusPackage pkgs.gnome3.dconf ];
|
environment.systemPackages = with pkgs; [
|
||||||
|
ibusPackage ibus-qt gnome3.dconf ibusAutostart
|
||||||
gtkPlugins = [ pkgs.ibus ];
|
];
|
||||||
qtPlugins = [ pkgs.ibus-qt ];
|
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
GTK_IM_MODULE = "ibus";
|
GTK_IM_MODULE = "ibus";
|
||||||
QT_IM_MODULE = "ibus";
|
QT_IM_MODULE = "ibus";
|
||||||
XMODIFIERS = "@im=ibus";
|
XMODIFIERS = "@im=ibus";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.displayManager.sessionCommands = "${ibusPackage}/bin/ibus-daemon --daemonize --xim --cache=none";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
{ stdenv, fetchFromGitHub, makeWrapper, ibus, anthy, intltool, pkgconfig, glib, gobjectIntrospection,
|
{ stdenv, fetchFromGitHub, makeWrapper, ibus, anthy, intltool
|
||||||
python, pythonPackages, gtk3, libtool, automake, autoconf }:
|
, pkgconfig, glib, gobjectIntrospection
|
||||||
|
, python3, pygobject3, gtk3, libtool, automake, autoconf
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ibus-anthy-${version}";
|
name = "ibus-anthy-${version}";
|
||||||
@ -18,12 +20,14 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
configureFlags = "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t";
|
configureFlags = "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t";
|
||||||
|
|
||||||
buildInputs = [ makeWrapper ibus anthy intltool pkgconfig glib gobjectIntrospection
|
buildInputs = [
|
||||||
python pythonPackages.pygobject3 gtk3 libtool automake autoconf ];
|
makeWrapper ibus anthy intltool pkgconfig glib gobjectIntrospection
|
||||||
|
python3 pygobject3 gtk3 libtool automake autoconf
|
||||||
|
];
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
|
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" \
|
wrapProgram "$file" \
|
||||||
--prefix PYTHONPATH : $PYTHONPATH \
|
--prefix PYTHONPATH : $PYTHONPATH \
|
||||||
--prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH:$out/lib/girepository-1.0
|
--prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH:$out/lib/girepository-1.0
|
||||||
|
@ -1,24 +1,20 @@
|
|||||||
{ stdenv, gnome, fetchFromGitHub, ibus, libhangul, autoconf, automake, gettext, libtool, librsvg,
|
{ stdenv, fetchurl, makeWrapper
|
||||||
intltool, pkgconfig, pythonPackages, makeWrapper, gtk3, python }:
|
, intltool, pkgconfig
|
||||||
|
, gtk3, ibus, libhangul, librsvg, python3, pygobject3
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ibus-hangul-${version}";
|
name = "ibus-hangul-${version}";
|
||||||
version = "1.5.0";
|
version = "1.5.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchurl {
|
||||||
owner = "choehwanjin";
|
url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${name}.tar.gz";
|
||||||
repo = "ibus-hangul";
|
sha256 = null;
|
||||||
rev = version;
|
|
||||||
sha256 = "12l2spr32biqdbz01bzkamgq5gskbi6cd7ai343wqyy1ibjlkmp8";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ibus libhangul autoconf gettext automake libtool
|
buildInputs = [ gtk3 ibus libhangul python3 pygobject3 ];
|
||||||
intltool pkgconfig python pythonPackages.pygobject3 gtk3 makeWrapper ];
|
|
||||||
|
|
||||||
preConfigure = ''
|
nativeBuildInputs = [ intltool makeWrapper pkgconfig ];
|
||||||
autoreconf --verbose --force --install
|
|
||||||
intltoolize --automake --force --copy
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/ibus-setup-hangul \
|
wrapProgram $out/bin/ibus-setup-hangul \
|
||||||
|
@ -1,15 +1,53 @@
|
|||||||
{ stdenv, fetchurl, ibus, pkgconfig, python3, pythonPackages }:
|
{ stdenv, fetchurl, makeWrapper, ibus, pkgconfig, python3, pygobject3
|
||||||
|
, gtk3, atk, dconf, gobjectIntrospection }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ibus-table-${version}";
|
name = "ibus-table-${version}";
|
||||||
version = "1.9.6";
|
version = "1.9.11";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/kaio/ibus-table/releases/download/${version}/${name}.tar.gz";
|
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; {
|
meta = with stdenv.lib; {
|
||||||
isIbusEngine = true;
|
isIbusEngine = true;
|
||||||
|
@ -1,42 +1,71 @@
|
|||||||
{ stdenv, fetchurl, makeWrapper, python, intltool, pkgconfig
|
{ stdenv, fetchurl, makeWrapper
|
||||||
, gnome3, atk, pygobject3, dbus, libnotify, isocodes, gobjectIntrospection, wayland }:
|
, intltool, isocodes, pkgconfig
|
||||||
|
, python3, pygobject3
|
||||||
|
, gtk2, gtk3, atk, dconf, glib
|
||||||
|
, dbus, libnotify, gobjectIntrospection, wayland
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ibus-${version}";
|
name = "ibus-${version}";
|
||||||
version = "1.5.11";
|
version = "1.5.13";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/ibus/ibus/releases/download/${version}/${name}.tar.gz";
|
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 = [
|
configureFlags = [
|
||||||
makeWrapper python gnome3.glib wayland
|
"--disable-gconf"
|
||||||
intltool pkgconfig gnome3.gtk2
|
"--enable-dconf"
|
||||||
gnome3.gtk3 dbus gnome3.dconf gnome3.gconf
|
"--disable-memconf"
|
||||||
libnotify isocodes gobjectIntrospection
|
"--enable-ui"
|
||||||
|
"--enable-python-library"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
python3 pygobject3
|
||||||
|
intltool isocodes pkgconfig
|
||||||
|
gtk2 gtk3 dconf glib
|
||||||
|
dbus libnotify gobjectIntrospection wayland
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
preConfigure = ''
|
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"
|
substituteInPlace data/dconf/Makefile.in --replace "dconf update" "echo"
|
||||||
sed -i "s|PYTHON2_LIBDIR=.*|PYTHON2_LIBDIR=$out/lib/${python.libPrefix}|" configure
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
for f in "$out"/bin/*; do
|
for f in "$out/bin"/*; do #*/
|
||||||
wrapProgram "$f" --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
wrapProgram "$f" \
|
||||||
--prefix PYTHONPATH : "$(toPythonPath ${pygobject3})" \
|
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
||||||
--prefix LD_LIBRARY_PATH : "${gnome3.gtk3}/lib:${atk}/lib:$out/lib" \
|
--prefix PYTHONPATH : "$PYTHONPATH" \
|
||||||
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
|
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
|
||||||
--prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules"
|
--prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
homepage = https://github.com/ibus/ibus;
|
homepage = https://github.com/ibus/ibus;
|
||||||
description = "Intelligent Input Bus for Linux / Unix OS";
|
description = "Intelligent Input Bus for Linux / Unix OS";
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
maintainers = [ maintainers.ttuegel ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,36 @@
|
|||||||
{ stdenv, buildEnv, ibus, makeWrapper, plugins, hicolor_icon_theme }:
|
{ stdenv, runCommand, ibus, lndir, makeWrapper, plugins, hicolor_icon_theme }:
|
||||||
|
|
||||||
let
|
let
|
||||||
drv = buildEnv {
|
|
||||||
name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version;
|
name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version;
|
||||||
|
env = {
|
||||||
paths = [ ibus hicolor_icon_theme ] ++ plugins;
|
nativeBuildInputs = [ lndir makeWrapper ];
|
||||||
|
propagatedUserEnvPackages = [ hicolor_icon_theme ];
|
||||||
postBuild = ''
|
paths = [ ibus ] ++ plugins;
|
||||||
# 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/"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
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
|
||||||
|
@ -1162,15 +1162,22 @@ let
|
|||||||
|
|
||||||
m17n_lib = callPackage ../tools/inputmethods/m17n-lib { };
|
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-qt = callPackage ../tools/inputmethods/ibus/ibus-qt.nix { };
|
||||||
|
|
||||||
ibus-engines = {
|
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 { };
|
m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { };
|
||||||
|
|
||||||
@ -1178,7 +1185,10 @@ let
|
|||||||
inherit (pythonPackages) gyp;
|
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 {
|
table-others = callPackage ../tools/inputmethods/ibus-engines/ibus-table-others {
|
||||||
ibus-table = ibus-engines.table;
|
ibus-table = ibus-engines.table;
|
||||||
|
Loading…
Reference in New Issue
Block a user