2016-02-27 13:30:04 +01:00
|
|
|
{ stdenv, runCommand, makeWrapper, lndir
|
2018-02-25 03:23:58 +01:00
|
|
|
, dconf, hicolor-icon-theme, ibus, librsvg, plugins
|
2016-02-27 13:30:04 +01:00
|
|
|
}:
|
2016-02-10 07:57:05 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version;
|
2016-02-27 00:30:20 +01:00
|
|
|
env = {
|
2016-02-27 13:30:04 +01:00
|
|
|
buildInputs = [ ibus ] ++ plugins;
|
2016-02-27 00:30:20 +01:00
|
|
|
nativeBuildInputs = [ lndir makeWrapper ];
|
2018-02-25 03:23:58 +01:00
|
|
|
propagatedUserEnvPackages = [ hicolor-icon-theme ];
|
2016-02-27 00:30:20 +01:00
|
|
|
paths = [ ibus ] ++ plugins;
|
2016-02-27 13:30:04 +01:00
|
|
|
inherit (ibus) meta;
|
2016-02-27 00:30:20 +01:00
|
|
|
};
|
|
|
|
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
|
2016-02-10 07:57:05 +01:00
|
|
|
|
2017-09-27 20:27:15 +02:00
|
|
|
for prog in ibus; do
|
2016-02-27 00:30:20 +01:00
|
|
|
wrapProgram "$out/bin/$prog" \
|
2016-06-21 16:36:21 +02:00
|
|
|
--set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
|
2016-02-27 13:30:04 +01:00
|
|
|
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
|
2017-07-24 06:24:11 +02:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules" \
|
2016-02-27 00:30:20 +01:00
|
|
|
--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" \
|
2016-02-27 13:30:04 +01:00
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH" \
|
|
|
|
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
|
2018-02-25 03:23:58 +01:00
|
|
|
--suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share"
|
2016-02-27 00:30:20 +01:00
|
|
|
done
|
2016-10-03 12:24:33 +02:00
|
|
|
|
|
|
|
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" \
|
2017-07-24 06:24:11 +02:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules" \
|
2016-10-03 12:24:33 +02:00
|
|
|
--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" \
|
2018-02-25 03:23:58 +01:00
|
|
|
--suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
|
2016-10-03 12:24:33 +02:00
|
|
|
--add-flags "--cache=refresh"
|
|
|
|
done
|
2016-02-10 07:57:05 +01:00
|
|
|
'';
|
2016-02-27 00:30:20 +01:00
|
|
|
in
|
|
|
|
runCommand name env command
|