wrapGAppsNoGuiHook: init

This commit is contained in:
Jan Tojnar 2020-10-24 10:23:57 +02:00
parent 28ee64cd0d
commit acfc45bacc
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
3 changed files with 15 additions and 4 deletions

View File

@ -100,9 +100,16 @@ preFixup = ''
done done
''; '';
</programlisting> </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> <itemizedlist>
<listitem xml:id="ssec-gnome-hooks-wrapgappshook"> <listitem>
<para> <para>
<package>wrapGAppsHook</package> itself will add the packages <filename>share</filename> directory to <envar>XDG_DATA_DIRS</envar>. <package>wrapGAppsHook</package> itself will add the packages <filename>share</filename> directory to <envar>XDG_DATA_DIRS</envar>.
</para> </para>
@ -178,7 +185,7 @@ preFixup = ''
</term> </term>
<listitem> <listitem>
<para> <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> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -3,6 +3,7 @@
, makeSetupHook , makeSetupHook
, makeWrapper , makeWrapper
, gobject-introspection , gobject-introspection
, isGraphical ? true
, gtk3 , gtk3
, librsvg , librsvg
, dconf , dconf
@ -21,7 +22,7 @@ makeSetupHook {
# Unfortunately, it also requires the user to have dconf # Unfortunately, it also requires the user to have dconf
# D-Bus service enabled globally (e.g. through a NixOS module). # D-Bus service enabled globally (e.g. through a NixOS module).
dconf.lib dconf.lib
] ++ [ ] ++ lib.optionals isGraphical [
# TODO: remove this, packages should depend on GTK explicitly. # TODO: remove this, packages should depend on GTK explicitly.
gtk3 gtk3
@ -30,6 +31,7 @@ makeSetupHook {
# graphics in GTK (e.g. cross for closing window in window title bar) # graphics in GTK (e.g. cross for closing window in window title bar)
# so it is pretty much required for applications using GTK. # so it is pretty much required for applications using GTK.
librsvg librsvg
] ++ [
# We use the wrapProgram function. # We use the wrapProgram function.
makeWrapper makeWrapper

View File

@ -540,6 +540,8 @@ in
wrapGAppsHook = callPackage ../build-support/setup-hooks/wrap-gapps-hook { }; wrapGAppsHook = callPackage ../build-support/setup-hooks/wrap-gapps-hook { };
wrapGAppsNoGuiHook = wrapGAppsHook.override { isGraphical = false; };
separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh; separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;
setupDebugInfoDirs = makeSetupHook { } ../build-support/setup-hooks/setup-debug-info-dirs.sh; setupDebugInfoDirs = makeSetupHook { } ../build-support/setup-hooks/setup-debug-info-dirs.sh;