NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.4k stars 14.35k forks source link

Problem setting typelibs #25493

Closed johnramsden closed 7 years ago

johnramsden commented 7 years ago

Issue description

I'm trying to package the application onboard, and I had opened a pull request #24986 that I think I should have opened as an issue first.

I tried getting help on IRC but it didn't really go anywhere so I was hoping I could get some help here.

I'm having trouble setting typelibs.

It looks like some typelibs are missing.

marmuta (marmuta) said 16 hours ago: Great, getting closer. Is Gtk-3.0.typelib installed? On Ubuntu this is a separate package gir1.2-gtk-3.0 that contains /usr/lib/x86_64-linux-gnu/girepository-1.0/Gdk-3.0.typelib /usr/lib/x86_64-linux-gnu/girepository-1.0/GdkX11-3.0.typelib /usr/lib/x86_64-linux-gnu/girepository-1.0/Gtk-3.0.typelib

Onboard uses all of these and a couple other typelibs: grep gir debian/control Depends: gir1.2-gdkpixbuf-2.0, gir1.2-glib-2.0, gir1.2-gtk-3.0, gir1.2-pango-1.0 (>= 1.29.3), Recommends: gir1.2-appindicator3-0.1, gir1.2-atspi-2.0,

appindicator3 is for the status icon - optional if the desktop environment is fine with the old GtkStatusIcon. I believe KDE Plasma needs it. Atspi is for auto-show, word suggestions and others, but not strictly required for a plain keyboard.

I have found the typelibs in <nix store>/lib/girepository-1.0 I can't seem to find a package that provides this but I have seen other people set a variable $GI_TYPELIB_PATH with wrapProgram. Is this the proper way to set the typelibs?

I tried wrapping the package but it didn't help.

wrapProgram "$out/usr/bin/nylas-mail" \
     --prefix PYTHONPATH : "$PYTHONPATH" \
     --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"

Is there a better way to set the typelibs?

Technical details

System: (NixOS: 17.03.1019.dc7dc77cde (Gorilla)) Nix version: (nix-env (Nix) 1.11.8) Nixpkgs version: ("17.03.1019.dc7dc77cde")

jtojnar commented 7 years ago

gobjectIntrospection’s setup hook is what adds the typelibs to the environment variable. The wrapProgram invocation is copying the value of the variables during build into a wrapper, which passes them to the wrapped executable when it is run. Just calling wrapProgram and adding the dependencies that provide the typelibs to buildInputs should be enough.