summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-26 13:35:04 +0000
committerAlyssa Ross <hi@alyssa.is>2021-02-02 17:13:53 +0000
commitcfa16434c2acef56ec2f59760a8eb8d69265dfc7 (patch)
treeccbeee2b6a7fc1f1f30f7f81a165be3a6b946f37
parent410bbd828cdc6156aecd5bc91772ad3a6b1099c7 (diff)
downloadnixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.tar
nixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.tar.gz
nixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.tar.bz2
nixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.tar.lz
nixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.tar.xz
nixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.tar.zst
nixpkgs-cfa16434c2acef56ec2f59760a8eb8d69265dfc7.zip
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
-rw-r--r--pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix
index 07e4dd54e5e..20aebebf7da 100644
--- a/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix
+++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix
@@ -70,6 +70,10 @@ in buildPythonPackage {
   '';
 
   dontPatchShebangs = true;
+  postFixup = ''
+    addToSearchPath program_PYTHONPATH $out/${python.sitePackages}
+    patchPythonScript $out/share/matrix.py
+  '';
 
   meta = with lib; {
     description = "A Python plugin for Weechat that lets Weechat communicate over the Matrix protocol";