mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
gnome.nautilus-python: fix loading gi
This commit is contained in:
parent
34ad3ffe08
commit
6767e0ed8e
|
@ -1,4 +1,6 @@
|
||||||
{ lib, stdenv
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, substituteAll
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, which
|
, which
|
||||||
|
@ -23,6 +25,16 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "161050sx3sdxqcpjkjcpf6wl4kx0jydihga7mcvrj9c2f8ly0g07";
|
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 = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
which
|
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