Merge pull request #273060 from FedericoSchonborn/libpeas-pygobject3

libpeas, libpeas2: Fix Python loader

authored by Bobby Rong and committed by GitHub 8ec87806 e52366c4

+60 -31
+1 -1
pkgs/applications/audio/rhythmbox/default.nix
··· 101 101 102 102 preFixup = '' 103 103 gappsWrapperArgs+=( 104 - --prefix PYTHONPATH : "${python3.pkgs.pygobject3}/${python3.sitePackages}:$out/lib/rhythmbox/plugins/" 104 + --prefix PYTHONPATH : "$out/lib/rhythmbox/plugins/" 105 105 ) 106 106 ''; 107 107
-5
pkgs/applications/editors/gnome-builder/default.nix
··· 73 73 ninja 74 74 pkg-config 75 75 python3 76 - python3.pkgs.wrapPython 77 76 wrapGAppsHook4 78 77 ]; 79 78 ··· 137 136 meson test --print-errorlogs 138 137 ''; 139 138 140 - pythonPath = with python3.pkgs; requiredPythonModules [ pygobject3 ]; 141 - 142 139 preFixup = '' 143 - buildPythonPath "$out $pythonPath" 144 140 gappsWrapperArgs+=( 145 - --prefix PYTHONPATH : "$program_PYTHONPATH" 146 141 # For sysprof-agent 147 142 --prefix PATH : "${sysprof}/bin" 148 143 )
+1 -1
pkgs/applications/networking/mailreaders/astroid/default.nix
··· 47 47 sed -i "s~ -geom 10x10~~g" src/config.cc 48 48 ''; 49 49 50 - pythonPath = with python3.pkgs; requiredPythonModules [ pygobject3 ] ++ extraPythonPackages; 50 + pythonPath = with python3.pkgs; requiredPythonModules extraPythonPackages; 51 51 preFixup = '' 52 52 buildPythonPath "$out $pythonPath" 53 53 gappsWrapperArgs+=(
+3 -8
pkgs/applications/networking/newsreaders/liferea/default.nix
··· 73 73 74 74 enableParallelBuilding = true; 75 75 76 - pythonPath = with python3Packages; [ 77 - pygobject3 78 - pycairo 79 - ]; 80 - 81 - preFixup = '' 82 - buildPythonPath "$out $pythonPath" 83 - gappsWrapperArgs+=(--prefix PYTHONPATH : "$program_PYTHONPATH") 76 + postFixup = '' 77 + buildPythonPath ${python3Packages.pycairo} 78 + patchPythonScript $out/lib/liferea/plugins/trayicon.py 84 79 ''; 85 80 86 81 passthru.updateScript = gitUpdater {
+6 -12
pkgs/applications/video/xplayer/default.nix
··· 25 25 , xapp 26 26 , yelp-tools }: 27 27 28 - let 29 - pythonenv = python3.withPackages (ps: [ 30 - ps.pygobject3 31 - ps.dbus-python # For one plugin 32 - ]); 33 - in 34 - 35 28 stdenv.mkDerivation rec { 36 29 pname = "xplayer"; 37 30 version = "2.4.4"; ··· 66 59 intltool 67 60 itstool 68 61 pkg-config 62 + python3.pkgs.wrapPython 69 63 yelp-tools 70 64 gobject-introspection 71 65 ]; ··· 82 76 libpeas 83 77 libxml2 84 78 libxplayer-plparser 85 - pythonenv 79 + python3 86 80 xapp 87 81 # to satisfy configure script 88 - pythonenv.pkgs.pygobject3 82 + python3.pkgs.pygobject3 89 83 ]; 90 84 91 - postInstall = '' 92 - wrapProgram $out/bin/xplayer \ 93 - --prefix PATH : ${lib.makeBinPath [ pythonenv ]} 85 + postFixup = '' 86 + buildPythonPath ${python3.pkgs.dbus-python} 87 + patchPythonScript $out/lib/xplayer/plugins/dbus/dbusservice.py 94 88 ''; 95 89 96 90 meta = with lib; {
-4
pkgs/desktops/gnome/core/totem/default.nix
··· 91 91 adwaita-icon-theme 92 92 gnome-desktop 93 93 gsettings-desktop-schemas 94 - # for plug-ins 95 94 python3Packages.pygobject3 96 - python3Packages.dbus-python 97 95 ]; 98 96 99 97 nativeCheckInputs = [ ··· 123 121 124 122 runHook postCheck 125 123 ''; 126 - 127 - wrapPrefixVariables = [ "PYTHONPATH" ]; 128 124 129 125 passthru = { 130 126 updateScript = gnome.updateScript {
+11
pkgs/desktops/mate/pluma/default.nix
··· 32 32 itstool 33 33 perl 34 34 pkg-config 35 + python3.pkgs.wrapPython 35 36 wrapGAppsHook 36 37 ]; 37 38 ··· 46 47 ]; 47 48 48 49 enableParallelBuilding = true; 50 + 51 + pythonPath = with python3.pkgs; [ 52 + pycairo 53 + six 54 + ]; 55 + 56 + postFixup = '' 57 + buildPythonPath "$pythonPath" 58 + patchPythonScript $out/lib/pluma/plugins/snippets/Snippet.py 59 + ''; 49 60 50 61 passthru.updateScript = mateUpdateScript { inherit pname; }; 51 62
+11
pkgs/development/libraries/libpeas/2.x.nix
··· 1 1 { stdenv 2 2 , lib 3 3 , fetchurl 4 + , substituteAll 4 5 , pkg-config 5 6 , gi-docgen 6 7 , gobject-introspection ··· 24 25 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 25 26 hash = "sha256-ndwdUfOGY9pN9SFjBRt7LOo6JCz67p9afhQPB4TIqnc="; 26 27 }; 28 + 29 + patches = [ 30 + # Make PyGObject’s gi library available. 31 + (substituteAll { 32 + src = ./fix-paths.patch; 33 + pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [ 34 + python3.pkgs.pygobject3 35 + ]; 36 + }) 37 + ]; 27 38 28 39 depsBuildBuild = [ 29 40 pkg-config
+13
pkgs/development/libraries/libpeas/default.nix
··· 1 1 { stdenv 2 2 , lib 3 3 , fetchurl 4 + , substituteAll 4 5 , meson 5 6 , ninja 6 7 , pkg-config ··· 12 13 , gobject-introspection 13 14 , python3 14 15 , ncurses 16 + , wrapGAppsHook 15 17 }: 16 18 17 19 stdenv.mkDerivation rec { ··· 25 27 sha256 = "KXy5wszNjoYXYj0aPoQVtFMLjlqJPjUnu/0e3RMje0w="; 26 28 }; 27 29 30 + patches = [ 31 + # Make PyGObject’s gi library available. 32 + (substituteAll { 33 + src = ./fix-paths.patch; 34 + pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [ 35 + python3.pkgs.pygobject3 36 + ]; 37 + }) 38 + ]; 39 + 28 40 depsBuildBuild = [ 29 41 pkg-config 30 42 ]; ··· 36 48 gettext 37 49 gi-docgen 38 50 gobject-introspection 51 + wrapGAppsHook 39 52 ]; 40 53 41 54 buildInputs = [
+14
pkgs/development/libraries/libpeas/fix-paths.patch
··· 1 + diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c 2 + index 26edbf3..0d65ada 100644 3 + --- a/loaders/python/peas-plugin-loader-python.c 4 + +++ b/loaders/python/peas-plugin-loader-python.c 5 + @@ -248,6 +248,9 @@ peas_plugin_loader_python_initialize (PeasPluginLoader *loader) 6 + goto python_init_error; 7 + } 8 + 9 + + /* 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 + /* Initialize PyGObject */ 13 + pygobject_init (PYGOBJECT_MAJOR_VERSION, 14 + PYGOBJECT_MINOR_VERSION,