weechatScripts.weechat-matrix: fix PYTHONPATH

matrix.py tries to import its dependencies, and its own code from
$out/${python.sitePackages}, and neither of these worked because
nothing was telling Python where to load that stuff from.

Using patchPythonScript made it so matrix.py could find its
dependencies, but it still wasn't able to find its own code, so that
had to be added to program_PYTHONPATH beforehand so patchPythonScript
would include it as well.

Fixes: https://github.com/NixOS/nixpkgs/issues/89499
This commit is contained in:
Alyssa Ross 2021-01-26 13:35:04 +00:00
parent 410bbd828c
commit cfa16434c2

View File

@ -70,6 +70,10 @@ in buildPythonPackage {
''; '';
dontPatchShebangs = true; dontPatchShebangs = true;
postFixup = ''
addToSearchPath program_PYTHONPATH $out/${python.sitePackages}
patchPythonScript $out/share/matrix.py
'';
meta = with lib; { meta = with lib; {
description = "A Python plugin for Weechat that lets Weechat communicate over the Matrix protocol"; description = "A Python plugin for Weechat that lets Weechat communicate over the Matrix protocol";