Skip to content

Commit

Permalink
doc/languages-frameworks/gnome: update Qt package example
Browse files Browse the repository at this point in the history
Part of #180841

Updated the existing example to reflect changes from a later version of
the same package:
https://github.com/NixOS/nixpkgs/blob/b293f6561ea74ccd9ddafe49f8227caf5b85f720/pkgs/applications/misc/calibre/default.nix
  • Loading branch information
tomodachi94 committed Oct 19, 2024
1 parent 04a0e06 commit b75d1e4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions doc/languages-frameworks/gnome.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ There are no schemas available in `XDG_DATA_DIRS`. Temporarily add a random pack

Package is missing some GSettings schemas. You can find out the package containing the schema with `nix-locate org.gnome.foo.gschema.xml` and let the hooks handle the wrapping as [above](#ssec-gnome-common-issues-no-schemas).

### When using `wrapGApps*` hook with special derivers you can end up with double wrapped binaries. {#ssec-gnome-common-issues-double-wrapped}
### When using `wrapGApps*` hook with special derivers or hooks you can end up with double wrapped binaries. {#ssec-gnome-common-issues-double-wrapped}

This is because derivers like `python.pkgs.buildPythonApplication` or `qt5.mkDerivation` have setup-hooks automatically added that produce wrappers with makeWrapper. The simplest way to workaround that is to disable the `wrapGApps*` hook automatic wrapping with `dontWrapGApps = true;` and pass the arguments it intended to pass to makeWrapper to another.
This is because derivers like `python.pkgs.buildPythonApplication` or hooks like `qt5.wrapQtAppsHook` have setup-hooks automatically added that produce wrappers with makeWrapper. The simplest way to workaround that is to disable the `wrapGApps*` hook automatic wrapping with `dontWrapGApps = true;` and pass the arguments it intended to pass to makeWrapper to another.

In the case of a Python application it could look like:

Expand All @@ -184,21 +184,26 @@ python3.pkgs.buildPythonApplication {
And for a QT app like:

```nix
mkDerivation {
stdenv.mkDerivation {
pname = "calibre";
version = "3.47.0";
nativeBuildInputs = [
wrapGAppsHook3
qt6.wrapQtAppsHook
qmake
# ...
];
dontWrapQtApps = true;
dontWrapGApps = true;
# Arguments to be passed to `makeWrapper`, only used by qt5’s mkDerivation
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
for program in $out/bin/*; do
wrapProgram $program \
''${qtWrapperArgs[@]} \
''${gappsWrapperArgs[@]}
done
'';
}
```
Expand Down

0 comments on commit b75d1e4

Please sign in to comment.