diff --git a/pkgs/development/python-modules/mat2/default.nix b/pkgs/development/python-modules/mat2/default.nix index 31bf90f7f0ae..80719e1076b5 100644 --- a/pkgs/development/python-modules/mat2/default.nix +++ b/pkgs/development/python-modules/mat2/default.nix @@ -47,6 +47,11 @@ buildPythonPackage rec { ./executable-name.patch # hardcode path to mat2 executable ./tests.patch + # fix gobject-introspection typelib path for Nautilus extension + (substituteAll { + src = ./fix_poppler.patch; + poppler_path = "${poppler_gi}/lib/girepository-1.0"; + }) ]; postPatch = '' @@ -76,7 +81,7 @@ buildPythonPackage rec { install -Dm 444 data/mat2.svg -t "$out/share/icons/hicolor/scalable/apps" install -Dm 444 doc/mat2.1 -t "$out/share/man/man1" install -Dm 444 nautilus/mat2.py -t "$out/share/nautilus-python/extensions" - buildPythonPath "$out $pythonPath" + buildPythonPath "$out $pythonPath $propagatedBuildInputs" patchPythonScript "$out/share/nautilus-python/extensions/mat2.py" '' + lib.optionalString dolphinIntegration '' install -Dm 444 dolphin/mat2.desktop -t "$out/share/kservices5/ServiceMenus" diff --git a/pkgs/development/python-modules/mat2/fix_poppler.patch b/pkgs/development/python-modules/mat2/fix_poppler.patch new file mode 100644 index 000000000000..02bdbb6345dc --- /dev/null +++ b/pkgs/development/python-modules/mat2/fix_poppler.patch @@ -0,0 +1,14 @@ +diff --git a/nautilus/mat2.py b/nautilus/mat2.py +index 11e6986..5a0e68f 100644 +--- a/nautilus/mat2.py ++++ b/nautilus/mat2.py +@@ -22,6 +22,9 @@ import gi + gi.require_version('Nautilus', '3.0') + gi.require_version('Gtk', '3.0') + gi.require_version('GdkPixbuf', '2.0') ++gi.require_version('GIRepository', '2.0') ++from gi.repository import GIRepository ++GIRepository.Repository.prepend_search_path('@poppler_path@') + from gi.repository import Nautilus, GObject, Gtk, Gio, GLib, GdkPixbuf + + from libmat2 import parser_factory