diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix index 244169cf46b6..3d78a8ec69e7 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix @@ -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; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 29bb2dd1306e..8ec3fe3d5adb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1181,7 +1181,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;