From 033908bbadf9176453989f957dbf305641c55f8d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 2 May 2024 11:50:39 +0200 Subject: [PATCH 1/2] Revert "python3Packages.pygobject3: propagate gobject-introspection" Will be fixed less invasively in next commit. This reverts commit dd897ede49954633e34ae9ec694ab7be361993d2. --- pkgs/development/python-modules/pygobject/3.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix index f1dff5b24e31c..c80d7a6dda56a 100644 --- a/pkgs/development/python-modules/pygobject/3.nix +++ b/pkgs/development/python-modules/pygobject/3.nix @@ -50,7 +50,6 @@ buildPythonPackage rec { propagatedBuildInputs = [ pycairo - gobject-introspection # e.g. try building: python3Packages.urwid python3Packages.pydbus ]; mesonFlags = [ From 6e9e56e11437f5008cfc1e681a52fd6fc1547793 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 2 May 2024 12:02:49 +0200 Subject: [PATCH 2/2] python3.pkgs.pygobject3: propagate gobject-introspection setup hook and glib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, if a package just depended on GLib (or other bindings shipped with gobject-introspection), wrapper was not needed since `${gobject-introspection}/lib/girepository-1.0` is implicitly on typelib path. Now that GLib bindings were moved to `glib` package, `${glib}/lib/girepository-1.0` must be added to `GI_TYPELIB_PATH` by the wrapper (or `gobject-introspection` setup hook for build time). This broke packages like `power-profile-daemon` at runtime and `python3.pkgs.pydbus` at build time. While we cannot sensibly propagate wrapping, we can at least fix the build time issues by propagating `glib` and the g-i setup hook. --- I believe it should be possible to use `pygobject3` without `GLib` bindings in theory, so propagating `glib` is not exactly correct. But since all practical projects will probably need `GLib` or `GObject` anyway, it might still be a a good idea to propagate `glib` from `pygobject3`. We probably want to propagate `gobject-introspection.setupHook` from `pygobject3` all the time because without the environment variables set by the setup hook, no bindings will be available. I do not think we do not want to propagate `gobject-introspection` since it now just contains typelibs for bunch of third-party libraries (e.g. cairo, fontconfig, xrandr…) which are not needed most of the time, the old libgirepository (which is usually only linked against) and build tools (needed for producing bindings, not for consuming them). --- If `pygobject3` goes to `buildInputs` (`(0,1)`), `gobject-introspection.setupHook` should go to `depsBuildBuildPropagated` (`(-1,-1)`) in `pygobject3` to result in `(-1,0)` (`nativeBuildInputs`) in dependents, and `glib` should go to `depsHostHostPropagated` (`(0,0)`), if we want it in `(0,1)` (`buildInputs`). We cannot propagate `setupHook` attribute directly, since it is not a package, though. --- pkgs/development/python-modules/pygobject/3.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix index c80d7a6dda56a..2b6c1438f2136 100644 --- a/pkgs/development/python-modules/pygobject/3.nix +++ b/pkgs/development/python-modules/pygobject/3.nix @@ -11,6 +11,7 @@ , meson , ninja , pythonOlder +, runCommandLocal , gnome , python }: @@ -48,6 +49,15 @@ buildPythonPackage rec { ncurses ]; + depsBuildBuildPropagated = [ + glib # TODO: Not sure why it works here, when the proper place is depsHostHostPropagated IMO. + gobject-introspection.setupHook + ]; + + depsHostHostPropagated = [ + glib + ]; + propagatedBuildInputs = [ pycairo ];