about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-26 13:35:04 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-26 17:21:28 +0000
commit57d722c1fbec394ebb141a3ad3b672edd5f01148 (patch)
tree5d7ede90dffac797c114557af9371be7102e4552 /nixpkgs/pkgs/applications
parent00e497ad9fa1b3b95e55d836832079b06f6fd5f9 (diff)
downloadnixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.tar
nixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.tar.gz
nixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.tar.bz2
nixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.tar.lz
nixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.tar.xz
nixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.tar.zst
nixlib-57d722c1fbec394ebb141a3ad3b672edd5f01148.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
Diffstat (limited to 'nixpkgs/pkgs/applications')
-rw-r--r--nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix
index 0b60617cbb38..b607a3bfaa69 100644
--- a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix
+++ b/nixpkgs/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 stdenv.lib; {
     description = "A Python plugin for Weechat that lets Weechat communicate over the Matrix protocol";