gnumeric: fix wrapping

Incorporate wrapGAppsHook so that all gnumeric binaries are wrapped,
following the convention used by many gnome applications.

This addresses two issues:

1.  The packaged ssconvert, ssdiff, ssgrep, and ssindex executables
    in bin are not currently wrapped so some expected environment
    variables including XDG_DATA_DIRS and GIO_EXTRA_MODULES are not
    set. The result is many warnings on stderr when running these
    commands, e.g.

    ==================================================================
    CRITICAL **:...go_conf_add_monitor: assertion 'node || key' failed
    CRITICAL **:...go_conf_get_node: assertion 'parent || key' failed
    WARNING **:...unknown GOConfMonitor id.
    ==================================================================

2.  None of the binaries, including gnumeric, currently wrap the
    environment variable GDK_PIXBUF_MODULE_FILE. This can cause
    segfaults if an incompatible GDK_PIXBUF_MODULE_FILE is already set
    in the environment (e.g. by plasma5). This could be encountered
    running a nixos pre-19.03 gnumeric binary from a nixos 18.09 KDE
    session.
This commit is contained in:
Bruce Toll 2019-01-26 10:23:23 -05:00
parent 4fb8bc8238
commit 85961441ee

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, intltool, perlPackages
, goffice, gnome3, makeWrapper, gtk3, bison, pythonPackages
, goffice, gnome3, wrapGAppsHook, gtk3, bison, pythonPackages
, itstool
}:
@ -16,7 +16,7 @@ in stdenv.mkDerivation rec {
configureFlags = [ "--disable-component" ];
nativeBuildInputs = [ pkgconfig intltool bison itstool makeWrapper ];
nativeBuildInputs = [ pkgconfig intltool bison itstool wrapGAppsHook ];
# ToDo: optional libgda, introspection?
buildInputs = [
@ -26,14 +26,6 @@ in stdenv.mkDerivation rec {
enableParallelBuilding = true;
preFixup = ''
for f in "$out"/bin/gnumeric-*; do
wrapProgram $f \
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
${stdenv.lib.optionalString (!stdenv.isDarwin) "--prefix GIO_EXTRA_MODULES : '${stdenv.lib.getLib gnome3.dconf}/lib/gio/modules'"}
done
'';
passthru = {
updateScript = gnome3.updateScript {
packageName = pname;