gnome.nautilus-python: fix loading gi

+27 -1
+13 -1
pkgs/desktops/gnome/misc/nautilus-python/default.nix
··· 1 - { lib, stdenv 2 , fetchurl 3 , pkg-config 4 , which ··· 22 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 23 sha256 = "161050sx3sdxqcpjkjcpf6wl4kx0jydihga7mcvrj9c2f8ly0g07"; 24 }; 25 26 nativeBuildInputs = [ 27 pkg-config
··· 1 + { stdenv 2 + , lib 3 + , substituteAll 4 , fetchurl 5 , pkg-config 6 , which ··· 24 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 25 sha256 = "161050sx3sdxqcpjkjcpf6wl4kx0jydihga7mcvrj9c2f8ly0g07"; 26 }; 27 + 28 + patches = [ 29 + # Make PyGObject’s gi library available. 30 + (substituteAll { 31 + src = ./fix-paths.patch; 32 + pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [ 33 + python3.pkgs.pygobject3 34 + ]; 35 + }) 36 + ]; 37 38 nativeBuildInputs = [ 39 pkg-config
+14
pkgs/desktops/gnome/misc/nautilus-python/fix-paths.patch
···
··· 1 + diff --git a/src/nautilus-python.c b/src/nautilus-python.c 2 + index 843e3c6..466a513 100644 3 + --- a/src/nautilus-python.c 4 + +++ b/src/nautilus-python.c 5 + @@ -184,6 +184,9 @@ nautilus_python_init_python (void) { 6 + return FALSE; 7 + } 8 + 9 + + debug("Add PyGObject to path"); 10 + + PyRun_SimpleString("import site;import functools; functools.reduce(lambda k, p: site.addsitedir(p, k), [@pythonPaths@], site._init_pathinfo())"); 11 + + 12 + /* import gobject */ 13 + debug("init_pygobject"); 14 + if (!np_init_pygobject()) {