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