Getting Things Gnome, ModuleNotFoundError: No module named 'gi'

I am trying to package Getting Things Gnome.
The package is building

{ stdenv
, fetchFromGitHub
, meson
, python3
, python3Packages
, pkgconfig
, ninja
, gtk3
, wrapGAppsHook
, glib
, itstool
, gettext
, pango
, gdk-pixbuf
, gobject-introspection
}:

stdenv.mkDerivation rec {
  pname = "gtg";
  version = "0.4";

  src = fetchFromGitHub {
      owner = "getting-things-gnome";
      repo = "gtg";
      rev = "v${version}";
      sha256 = "0r28vyr88rj3kd3cg4gj7sd29wadjchi92wzmbx67d4hlg25h8kk";
    };


  nativeBuildInputs = [
    meson
    ninja
    pkgconfig
    wrapGAppsHook
    gobject-introspection
    (python3.withPackages (ps: with ps; [
      docutils
      pygobject3
    ]))
  ];

  buildInputs = [
    python3
    glib
    gtk3
    itstool
    gettext
    pango
    gdk-pixbuf
  ];


  propagatedBuildInputs = with python3Packages; [ pycairo pygobject3 lxml dbus-python gst-python ];

  #strictDeps = false;
  
  #propagatedBuildInputs = with python3.pkgs; [ pycairo pygobject3 lxml dbus-python ];
  #propagatedBuildInputs = with python3Packages; [ pycairo pygobject3 larch lxml dbus-python ];

  meta = with stdenv.lib; {
    description = "Getting Things GNOME! (GTG) is a personal tasks and TODO-list items organizer for the GNOME desktop environment and inspired by the ''Getting Things Done'' (GTD) methodology.";
    homepage = "https://wiki.gnome.org/Apps/GTG";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ oyren ];
    platforms = [ "x86_64-linux" ];
  };
}

I get the following error:

Traceback (most recent call last):
  File "/nix/store/1kk3cj0pj41khdchsvlrm1vh3v36hmbi-gtg-0.4/bin/.gtg-wrapped", line 52, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'

The commented out passages are things i tried to fix.

Here is a similar topic, unfortunately it didn’t get me anywhere

Also libLarch should be needed but if i add it (propagatedBuildInputs) i get the following error:

error: ttystatus-0.23 not supported for interpreter python3.8

See also GNOME gtd app · Issue #93370 · NixOS/nixpkgs · GitHub.

I assume the missing gi library is caused by conflict between various python’s you use. I would try to remove the one in nativeBuildInputs.

Thanks, now I feel stupid for not searching the issues ;).
Played a little with liblarch, but got stuck again (GNOME gtd app · Issue #93370 · NixOS/nixpkgs · GitHub).

gtg: init at 0.4.0 (Getting Things GNOME) by oyren · Pull Request #94686 · NixOS/nixpkgs · GitHub, done.

1 Like