From acfc45baccda8f16278793b9cdd8e6617f85960a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 24 Oct 2020 10:23:57 +0200 Subject: [PATCH] wrapGAppsNoGuiHook: init --- doc/languages-frameworks/gnome.xml | 13 ++++++++++--- .../setup-hooks/wrap-gapps-hook/default.nix | 4 +++- pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/languages-frameworks/gnome.xml b/doc/languages-frameworks/gnome.xml index 159216ca981..49b0a62eb7c 100644 --- a/doc/languages-frameworks/gnome.xml +++ b/doc/languages-frameworks/gnome.xml @@ -100,9 +100,16 @@ preFixup = '' done ''; - Fortunately, there is wrapGAppsHook, that does the wrapping for us. In particular, it works in conjunction with other setup hooks that will populate the variable: + + + Fortunately, there is wrapGAppsHook. It works in conjunction with other setup hooks that populate environment variables, and it will then wrap all executables in bin and libexec directories using said variables. + + + For convenience, it also adds dconf.lib for a GIO module implementing a GSettings backend using dconf, gtk3 for GSettings schemas, and librsvg for GdkPixbuf loader to the closure. In case you are packaging a program without a graphical interface, you might want to use wrapGAppsNoGuiHook, which runs the same script as wrapGAppsHook but does not bring gtk3 and librsvg into the closure. + + - + wrapGAppsHook itself will add the package’s share directory to XDG_DATA_DIRS. @@ -178,7 +185,7 @@ preFixup = '' - There are no schemas avalable in XDG_DATA_DIRS. Temporarily add a random package containing schemas like gsettings-desktop-schemas to buildInputs. glib and wrapGAppsHook setup hooks will take care of making the schemas available to application and you will see the actual missing schemas with the next error. Or you can try looking through the source code for the actual schemas used. + There are no schemas available in XDG_DATA_DIRS. Temporarily add a random package containing schemas like gsettings-desktop-schemas to buildInputs. glib and wrapGAppsHook setup hooks will take care of making the schemas available to application and you will see the actual missing schemas with the next error. Or you can try looking through the source code for the actual schemas used. diff --git a/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix b/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix index 5a87893d972..d0ea088bf71 100644 --- a/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix +++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix @@ -3,6 +3,7 @@ , makeSetupHook , makeWrapper , gobject-introspection +, isGraphical ? true , gtk3 , librsvg , dconf @@ -21,7 +22,7 @@ makeSetupHook { # Unfortunately, it also requires the user to have dconf # D-Bus service enabled globally (e.g. through a NixOS module). dconf.lib - ] ++ [ + ] ++ lib.optionals isGraphical [ # TODO: remove this, packages should depend on GTK explicitly. gtk3 @@ -30,6 +31,7 @@ makeSetupHook { # graphics in GTK (e.g. cross for closing window in window title bar) # so it is pretty much required for applications using GTK. librsvg + ] ++ [ # We use the wrapProgram function. makeWrapper diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 92e68417e47..c872af35386 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -540,6 +540,8 @@ in wrapGAppsHook = callPackage ../build-support/setup-hooks/wrap-gapps-hook { }; + wrapGAppsNoGuiHook = wrapGAppsHook.override { isGraphical = false; }; + separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh; setupDebugInfoDirs = makeSetupHook { } ../build-support/setup-hooks/setup-debug-info-dirs.sh;