aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2020-10-24 10:23:57 +0200
committerJan Tojnar <jtojnar@gmail.com>2020-11-26 14:06:07 +0100
commitacfc45baccda8f16278793b9cdd8e6617f85960a (patch)
tree065d2db6fc1469479f51efca7be865e56341d33f
parent28ee64cd0de260e2409ef75653cbcd88b595ec4e (diff)
wrapGAppsNoGuiHook: init
-rw-r--r--doc/languages-frameworks/gnome.xml13
-rw-r--r--pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 15 insertions, 4 deletions
diff --git a/doc/languages-frameworks/gnome.xml b/doc/languages-frameworks/gnome.xml
index 159216ca981f..49b0a62eb7ca 100644
--- a/doc/languages-frameworks/gnome.xml
+++ b/doc/languages-frameworks/gnome.xml
@@ -100,9 +100,16 @@ preFixup = ''
done
'';
</programlisting>
- Fortunately, there is <package>wrapGAppsHook</package>, that does the wrapping for us. In particular, it works in conjunction with other setup hooks that will populate the variable:
+ </para>
+ <para>
+ Fortunately, there is <package xml:id="ssec-gnome-hooks-wrapgappshook">wrapGAppsHook</package>. It works in conjunction with other setup hooks that populate environment variables, and it will then wrap all executables in <filename>bin</filename> and <filename>libexec</filename> directories using said variables.
+ </para>
+ <para>
+ For convenience, it also adds <package>dconf.lib</package> for a GIO module implementing a GSettings backend using <package>dconf</package>, <package>gtk3</package> for GSettings schemas, and <package>librsvg</package> for GdkPixbuf loader to the closure. In case you are packaging a program without a graphical interface, you might want to use <package xml:id="ssec-gnome-hooks-wrapgappsnoguihook">wrapGAppsNoGuiHook</package>, which runs the same script as <package>wrapGAppsHook</package> but does not bring <package>gtk3</package> and <package>librsvg</package> into the closure.
+ </para>
+ <para>
<itemizedlist>
- <listitem xml:id="ssec-gnome-hooks-wrapgappshook">
+ <listitem>
<para>
<package>wrapGAppsHook</package> itself will add the package’s <filename>share</filename> directory to <envar>XDG_DATA_DIRS</envar>.
</para>
@@ -178,7 +185,7 @@ preFixup = ''
</term>
<listitem>
<para>
- There are no schemas avalable in <envar>XDG_DATA_DIRS</envar>. Temporarily add a random package containing schemas like <package>gsettings-desktop-schemas</package> to <literal>buildInputs</literal>. <link linkend="ssec-gnome-hooks-glib"><package>glib</package></link> and <link linkend="ssec-gnome-hooks-wrapgappshook"><package>wrapGAppsHook</package></link> setup hooks will take care of making the schemas available to application and you will see the actual missing schemas with the <link linkend="ssec-gnome-common-issues-missing-schema">next error</link>. Or you can try looking through the source code for the actual schemas used.
+ There are no schemas available in <envar>XDG_DATA_DIRS</envar>. Temporarily add a random package containing schemas like <package>gsettings-desktop-schemas</package> to <literal>buildInputs</literal>. <link linkend="ssec-gnome-hooks-glib"><package>glib</package></link> and <link linkend="ssec-gnome-hooks-wrapgappshook"><package>wrapGAppsHook</package></link> setup hooks will take care of making the schemas available to application and you will see the actual missing schemas with the <link linkend="ssec-gnome-common-issues-missing-schema">next error</link>. Or you can try looking through the source code for the actual schemas used.
</para>
</listitem>
</varlistentry>
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 5a87893d9726..d0ea088bf71e 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 92e68417e479..c872af35386c 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;