···116116117117- []{#ssec-gnome-hooks-gobject-introspection} `gobject-introspection` setup hook populates `GI_TYPELIB_PATH` variable with `lib/girepository-1.0` directories of dependencies, which is then added to wrapper by `wrapGAppsHook`. It also adds `share` directories of dependencies to `XDG_DATA_DIRS`, which is intended to promote GIR files but it also [pollutes the closures](https://github.com/NixOS/nixpkgs/issues/32790) of packages using `wrapGAppsHook`.
118118119119- ::: {.warning}
120120- The setup hook [currently](https://github.com/NixOS/nixpkgs/issues/56943) does not work in expressions with `strictDeps` enabled, like Python packages. In those cases, you will need to disable it with `strictDeps = false;`.
121121- :::
122122-123119- []{#ssec-gnome-hooks-gst-grl-plugins} Setup hooks of `gst_all_1.gstreamer` and `grilo` will populate the `GST_PLUGIN_SYSTEM_PATH_1_0` and `GRL_PLUGIN_PATH` variables, respectively, which will then be added to the wrapper by `wrapGAppsHook`.
124120125121You can also pass additional arguments to `makeWrapper` using `gappsWrapperArgs` in `preFixup` hook:
···2727 intltool
2828 wrapGAppsHook
2929 glibcLocales
3030+ gobject-introspection
3031 ];
31323232- # as of 2021-07, the gobject-introspection setup hook does not
3333- # work with `strictDeps` enabled, thus for proper `wrapGAppsHook`
3434- # it needs to be disabled explicitly. https://github.com/NixOS/nixpkgs/issues/56943
3535- strictDeps = false;
3636-3733 buildInputs = [
3834 python3
3935 gtk3
4040- gobject-introspection
4136 gnome.adwaita-icon-theme
4237 ];
4338
-4
pkgs/applications/audio/sonata/default.nix
···3939 setuptools
4040 ];
41414242- # Otherwise the setup hook for gobject-introspection is not run:
4343- # https://github.com/NixOS/nixpkgs/issues/56943
4444- strictDeps = false;
4545-4642 postPatch = ''
4743 # Remove "Local MPD" tab which is not suitable for NixOS.
4844 sed -i '/localmpd/d' sonata/consts.py
···6464 --replace "gtk-update-icon-cache" "gtk4-update-icon-cache"
6565 '';
66666767- # Fix setup-hooks https://github.com/NixOS/nixpkgs/issues/56943
6868- strictDeps = false;
6969-7067 meta = with lib; {
7168 description = "A Reddit app, built with Python, GTK and Handy; Created with mobile Linux in mind";
7269 maintainers = with maintainers; [ dasj19 ];
···6767 '';
68686969 format = "other";
7070- strictDeps = false; # gobject-introspection does not run with strictDeps (https://github.com/NixOS/nixpkgs/issues/56943)
71707271 checkPhase = "xvfb-run pytest ../tests/";
7372
···5252 pycairo
5353 ];
54545555- # gobject-introspection and some other similar setup hooks do not currently work with strictDeps.
5656- # https://github.com/NixOS/nixpkgs/issues/56943
5757- strictDeps = false;
5858-5955 postPatch = ''
6056 patchShebangs meson_shebang_normalisation.py
6157 '';
···1717 propagatedBuildInputs = [
1818 # We use the wrapProgram function.
1919 makeWrapper
2020- ] ++ lib.optionals (!stdenv.isDarwin) [
2121- # It is highly probable that a program will use GSettings,
2222- # at minimum through GTK file chooser dialogue.
2323- # Let’s add a GIO module for “dconf” GSettings backend
2424- # to avoid falling back to “memory” backend. This is
2525- # required for GSettings-based settings to be persisted.
2626- # Unfortunately, it also requires the user to have dconf
2727- # D-Bus service enabled globally (e.g. through a NixOS module).
2828- dconf.lib
2929-3020 ] ++ lib.optionals isGraphical [
3121 # TODO: remove this, packages should depend on GTK explicitly.
3222 gtk3
···3525 ];
36263727 # depsTargetTargetPropagated will essentially be buildInputs when wrapGAppsHook is placed into nativeBuildInputs
3838- # the librsvg above should be removed but kept to not break anything that implicitly depended on its binaries
2828+ # the librsvg and gtk3 above should be removed but kept to not break anything that implicitly depended on its binaries
3929 depsTargetTargetPropagated = assert (lib.assertMsg (!targetPackages ? raw) "wrapGAppsHook must be in nativeBuildInputs"); lib.optionals isGraphical [
4030 # librsvg provides a module for gdk-pixbuf to allow rendering
4131 # SVG icons. Most icon themes are SVG-based and so are some
4232 # graphics in GTK (e.g. cross for closing window in window title bar)
4333 # so it is pretty much required for applications using GTK.
4434 librsvg
3535+3636+ # TODO: remove this, packages should depend on GTK explicitly.
3737+ gtk3
3838+ ] ++ lib.optionals (!stdenv.isDarwin) [
3939+ # It is highly probable that a program will use GSettings,
4040+ # at minimum through GTK file chooser dialogue.
4141+ # Let’s add a GIO module for “dconf” GSettings backend
4242+ # to avoid falling back to “memory” backend. This is
4343+ # required for GSettings-based settings to be persisted.
4444+ # Unfortunately, it also requires the user to have dconf
4545+ # D-Bus service enabled globally (e.g. through a NixOS module).
4646+ dconf.lib
4547 ];
4648 passthru = {
4749 tests = let
···56585759 src = sample-project;
58606161+ strictDeps = true;
5962 nativeBuildInputs = [ wrapGAppsHook ];
60636164 installFlags = [ "bin-foo" "libexec-bar" ];
···86898790 src = sample-project;
88919292+ strictDeps = true;
9393+8994 installFlags = [ "typelib-Mahjong" ];
9095 };
9196···9510096101 src = sample-project;
97102103103+ strictDeps = true;
98104 nativeBuildInputs = [
99105 gobject-introspection
100106 wrapGAppsHook
···126132127133 src = sample-project;
128134135135+ strictDeps = true;
136136+129137 makeFlags = [
130138 "LIBDIR=${placeholder "lib"}/lib"
131139 ];
···139147140148 src = sample-project;
141149150150+ strictDeps = true;
142151 nativeBuildInputs = [
143152 gobject-introspection
144153 wrapGAppsHook
···169178170179 src = sample-project;
171180181181+ strictDeps = true;
172182 nativeBuildInputs = [
173183 gobject-introspection
174184 wrapGAppsHook