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