Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document wrapGAppsHook #16285

Closed
bennofs opened this issue Jun 17, 2016 · 4 comments · Fixed by #43150
Closed

Document wrapGAppsHook #16285

bennofs opened this issue Jun 17, 2016 · 4 comments · Fixed by #43150
Assignees
Labels
0.kind: enhancement Add something new 6.topic: GNOME GNOME desktop environment and its underlying platform 9.needs: documentation

Comments

@bennofs
Copy link
Contributor

bennofs commented Jun 17, 2016

I just found out about wrapGAppsHook by examining a gnome package, but there really should be documentation about this in the Nixpkgs User Guide (a section about Gnome would be nice, which would show the right way to package GTK3 / GTK2 glib based apps).

Also, perhaps there are other things I missed that one should know when packaging Gnome Applications or GTK3/2 apps?

/cc @lethalman @jgeerds @DamienCassou Gnome maintainers

@bennofs bennofs added 0.kind: enhancement Add something new 6.topic: GNOME GNOME desktop environment and its underlying platform 9.needs: documentation labels Jun 17, 2016
@jtojnar jtojnar self-assigned this Nov 25, 2017
@CMCDragonkai
Copy link
Member

CMCDragonkai commented Mar 4, 2018

I'd like to know as well. Currently receiving this error:

(gpredict:7844): GLib-GIO-ERROR **: No GSettings schemas are installed on the system

On one of the packages I'm trying to put into nixpkgs.

Apparently sometimes you need gnome3.defaultIconTheme for buildInputs.

So apparently all you need to do to use this is:

nativeBuildInputs = [ wrapGAppsHook ];

@jtojnar
Copy link
Member

jtojnar commented Mar 4, 2018

The error occurs when you do not have any directory containing glib-2.0/schemas/gschemas.compiled in XDG_DATA_DIRS variable. One of the things wrapGAppsHook does is adding share/gsettings-schemas/$name (which usually contains the aforementioned file) of dependencies to XDG_DATA_DIRS. (Actually this happens in cooperation with glib setup hook via $GSETTINGS_SCHEMAS_PATH variable.)

Icon themes work in the same vein, only XDG_ICON_DIRS variable is used and it is populated by hicolor-icon-theme’s setup hook which is propagated to gnome3.defaultIconTheme (adwaita-icon-theme).

hicolor-icon-theme (XDG fallback theme) should be probably added to any GTK application that uses icons (I think that is every GTK applicaton nowadays due to CSD) but some applications require Adwaita because they use icons not in hicolor. Not sure if this functions correctly though, at least it should not according to my mental model of how icon theme selection works; I will need to read the relevant XDG spec before I can finish the documentation.

@tbenst
Copy link
Contributor

tbenst commented May 27, 2019

Just thought I'd leave this comment here for future reference: if you get an error like ValueError: Namespace Gtk not available for python gtk applications, try adding wrapGAppsHook to propogatedBuildInputs!

@jtojnar
Copy link
Member

jtojnar commented May 27, 2019

@tbenst It should go to nativeBuildInputs, though. But be wary of #56943

jtojnar added a commit to jtojnar/nixpkgs that referenced this issue Sep 6, 2019
jtojnar added a commit that referenced this issue Sep 10, 2019
Closes: #16285
(cherry picked from commit 075b528)
KoviRobi pushed a commit to KoviRobi/Pye-Menu that referenced this issue Dec 10, 2019
I had

```
Traceback (most recent call last):
  File "/nix/store/sg2pb6pyl5w5jw9g2p145c0h6n7ngxvi-workspace-renumber", li
ne 2, in <module>
    from pye_menu import TopMenu, SubMenu, MenuItem, SubMenuItem, ExecMenuI
tem
  File "/nix/store/wq8m6gxcwbi5502javwkc7drvmh5sk7g-python3-3.7.5-env/lib/python3.7/site-packages/pye_menu.py", line 6, in <module>
    gi.require_versions({'Gtk': '3.0', 'PangoCairo': '1.0'})
  File "/nix/store/wq8m6gxcwbi5502javwkc7drvmh5sk7g-python3-3.7.5-env/lib/p
ython3.7/site-packages/gi/__init__.py", line 152, in require_versions
    require_version(module_name, module_version)
  File "/nix/store/wq8m6gxcwbi5502javwkc7drvmh5sk7g-python3-3.7.5-env/lib/p
ython3.7/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
```

when trying to use it as a library. See

NixOS/nixpkgs#16285
NixOS/nixpkgs#56943
KoviRobi pushed a commit to KoviRobi/Pye-Menu that referenced this issue Dec 10, 2019
I had

```
Traceback (most recent call last):
  File "/nix/store/sg2pb6pyl5w5jw9g2p145c0h6n7ngxvi-workspace-renumber", li
ne 2, in <module>
    from pye_menu import TopMenu, SubMenu, MenuItem, SubMenuItem, ExecMenuI
tem
  File "/nix/store/wq8m6gxcwbi5502javwkc7drvmh5sk7g-python3-3.7.5-env/lib/python3.7/site-packages/pye_menu.py", line 6, in <module>
    gi.require_versions({'Gtk': '3.0', 'PangoCairo': '1.0'})
  File "/nix/store/wq8m6gxcwbi5502javwkc7drvmh5sk7g-python3-3.7.5-env/lib/p
ython3.7/site-packages/gi/__init__.py", line 152, in require_versions
    require_version(module_name, module_version)
  File "/nix/store/wq8m6gxcwbi5502javwkc7drvmh5sk7g-python3-3.7.5-env/lib/p
ython3.7/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
```

when trying to use it as a library. See

NixOS/nixpkgs#16285
NixOS/nixpkgs#56943
@seam345 seam345 mentioned this issue Apr 19, 2023
12 tasks
seam345 added a commit to seam345/nixpkgs that referenced this issue Apr 21, 2023
Fixes no Gsettings error when clicking saveAs.
Following method mentioned in NixOS#16285
seam345 added a commit to seam345/nixpkgs that referenced this issue Apr 21, 2023
Fixes no Gsettings error when clicking Open or SaveAs.
Following method mentioned in NixOS#16285
seam345 added a commit to seam345/nixpkgs that referenced this issue Apr 21, 2023
Fixes no Gsettings error when trying to open file picker.
Following method mentioned in NixOS#16285
rodarima pushed a commit to rodarima/bscpkgs that referenced this issue Mar 14, 2024
Needed to fix the error on NixOS:

  GLib-GIO-ERROR **: No GSettings schemas are installed on the system

See NixOS/nixpkgs#16285

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
@JohnRTitor JohnRTitor added this to GNOME Jun 20, 2024
@JohnRTitor JohnRTitor moved this to Done in GNOME Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 6.topic: GNOME GNOME desktop environment and its underlying platform 9.needs: documentation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants