diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix index 3e17e721f7be..8b830c257f07 100644 --- a/pkgs/tools/inputmethods/ibus/default.nix +++ b/pkgs/tools/inputmethods/ibus/default.nix @@ -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 ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 71695b6b28be..29bb2dd1306e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1162,7 +1162,10 @@ 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 { };