Merge pull request #142824 from jtojnar/nautilus-python
gnome.nautilus-python: fix loading gi
This commit is contained in:
commit
39423b9f03
2 changed files with 27 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
|||
{ lib, stdenv
|
||||
{ stdenv
|
||||
, lib
|
||||
, substituteAll
|
||||
, fetchurl
|
||||
, pkg-config
|
||||
, which
|
||||
|
@ -23,6 +25,16 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "161050sx3sdxqcpjkjcpf6wl4kx0jydihga7mcvrj9c2f8ly0g07";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Make PyGObject’s gi library available.
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [
|
||||
python3.pkgs.pygobject3
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
which
|
||||
|
|
14
pkgs/desktops/gnome/misc/nautilus-python/fix-paths.patch
Normal file
14
pkgs/desktops/gnome/misc/nautilus-python/fix-paths.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
|
||||
index 843e3c6..466a513 100644
|
||||
--- a/src/nautilus-python.c
|
||||
+++ b/src/nautilus-python.c
|
||||
@@ -184,6 +184,9 @@ nautilus_python_init_python (void) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ debug("Add PyGObject to path");
|
||||
+ PyRun_SimpleString("import site;import functools; functools.reduce(lambda k, p: site.addsitedir(p, k), [@pythonPaths@], site._init_pathinfo())");
|
||||
+
|
||||
/* import gobject */
|
||||
debug("init_pygobject");
|
||||
if (!np_init_pygobject()) {
|
Loading…
Reference in a new issue