From cfa16434c2acef56ec2f59760a8eb8d69265dfc7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 26 Jan 2021 13:35:04 +0000 Subject: [PATCH] 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 --- .../networking/irc/weechat/scripts/weechat-matrix/default.nix | 4 ++++ 1 file changed, 4 insertions(+) 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";