Skip to content

gi hook can fail to find GIR files. #9374

Description

@Lord-Kamina

Description of the issue

I am trying to bundle a package that uses gi and Gtkosxapplication. I am using macports, which frequently puts things in subfolders to deal with libraries that can conflict but would potentially be able to live alongside each other.

In this case, GtkOsxApplication could conceivably built against Gtk2 or against Gtk3.

As per above, the gtk3 variant of the port might install the following files (locale files omitted but they're there too):

 /opt/local/include/gtkmacintegration-gtk3/gtkmacintegration/gtkosxapplication.h
  /opt/local/lib/gtkmacintegration-gtk3/girepository-1.0/GtkosxApplication-1.0.typelib
  /opt/local/lib/gtkmacintegration-gtk3/libgtkmacintegration-gtk3.4.dylib
  /opt/local/lib/gtkmacintegration-gtk3/libgtkmacintegration-gtk3.dylib
  /opt/local/lib/pkgconfig/gtk-mac-integration-gtk3.pc
  /opt/local/lib/pkgconfig/gtk-mac-integration.pc
  /opt/local/share/gtkmacintegration-gtk3/gir-1.0/GtkosxApplication-1.0.gir

Using PyInstaller normally, it fails to find it at all. If I add the appropriate subfolders to GI_TYPELIB_PATH, it finds the typelib, but still fails with the following error:
29984 ERROR: Unable to find gir file: /opt/local/share/gir-1.0/GtkosxApplication-1.0.gir.

Which is obvious, because in my case the file is actually at /opt/local/share/gtkmacintegration-gtk3/gir-1.0/GtkosxApplication-1.0.gir, but I have no way to tell PyInstaller that.

Context information (for bug reports)

  • Output of pyinstaller --version: ```6.19.0
  • Version of Python: 3.13
  • Platform: macOS 13
  • How you installed Python: Macports
  • Did you also try this on another platform? Does it work there? No, irrelevant. Possibly would work in Homebrew but ew

This can be directly traced to https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/utils/hooks/gi.py#L212-L221

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagePlease triage and relabel this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions