From d37982385b2f8d2b1c2d1ab13c7941da6ed2b16c Mon Sep 17 00:00:00 2001 From: CM Geldenhuys <4649249+CMGeldenhuys@users.noreply.github.com> Date: Tue, 21 Jul 2026 20:45:04 +0200 Subject: [PATCH] textext: fix GUI library (GTK3) detection TexText probes for a GUI toolkit by spawning a subprocess (roughly `import gi; gi.require_version('Gtk', '3.0'); from gi.repository import Gtk`) instead of importing in-process. The Python wrapper makes runtime dependencies importable via a site.addsitedir preamble and deliberately does not export PYTHONPATH, so the spawned probe interpreter cannot import gi. TexText then reports "Neither GTK nor TkInter has been found" and refuses to launch. Export PYTHONPATH on the wrapper so the probe subprocess inherits the runtime dependencies too. Resolves #384042 --- .../inkscape/extensions/textext/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/applications/graphics/inkscape/extensions/textext/default.nix b/pkgs/applications/graphics/inkscape/extensions/textext/default.nix index 20f7f2a2a055..2e2fd2abe665 100644 --- a/pkgs/applications/graphics/inkscape/extensions/textext/default.nix +++ b/pkgs/applications/graphics/inkscape/extensions/textext/default.nix @@ -109,6 +109,20 @@ python3.pkgs.buildPythonApplication (finalAttrs: { # Include gobject-introspection typelibs in the wrapper. makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + + # TexText probes for a GUI toolkit by spawning a subprocess + # (`sys.executable -c "import gi; gi.require_version('Gtk', '3.0'); ..."`) + # instead of importing in-process. The Python wrapper makes runtime + # dependencies importable via a site.addsitedir preamble and deliberately + # does not export PYTHONPATH, so the spawned probe interpreter cannot import + # gi and TexText aborts with "Neither GTK nor TkInter has been found". + # Export PYTHONPATH so the probe subprocess inherits the dependencies too. + # See https://github.com/NixOS/nixpkgs/issues/384042 + makeWrapperArgs+=(--prefix PYTHONPATH : "${ + lib.makeSearchPath python3.sitePackages ( + finalAttrs.propagatedBuildInputs ++ [ python3.pkgs.pycairo ] + ) + }") ''; postFixup = ''