summary refs log tree commit diff
path: root/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp')
-rw-r--r--pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/default.nix36
-rw-r--r--pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/libpath.patch16
2 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/default.nix
new file mode 100644
index 00000000000..dad5b9c5e02
--- /dev/null
+++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, xmpppy, pydns, substituteAll, buildEnv }:
+
+stdenv.mkDerivation {
+  name = "weechat-jabber-2017-08-30";
+
+  src = fetchFromGitHub {
+    repo = "weechat-xmpp";
+    owner = "sleduc";
+    sha256 = "0s02xs0ynld9cxxzj07al364sfglyc5ir1i82133mq0s8cpphnxv";
+    rev = "8f6c21f5a160c9318c7a2d8fd5dcac7ab2e0d843";
+  };
+
+  installPhase = ''
+    mkdir -p $out/share
+    cp jabber.py $out/share/jabber.py
+  '';
+
+  patches = [
+    (substituteAll {
+      src = ./libpath.patch;
+      env = "${buildEnv {
+        name = "weechat-xmpp-env";
+        paths = [ pydns xmpppy ];
+      }}/lib/python2.7/site-packages";
+    })
+  ];
+
+  passthru.scripts = [ "jabber.py" ];
+
+  meta = with stdenv.lib; {
+    description = "A fork of the jabber plugin for weechat";
+    homepage = "https://github.com/sleduc/weechat-xmpp";
+    maintainers = with maintainers; [ ma27 ];
+    license = licenses.gpl3Plus;
+  };
+}
diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/libpath.patch b/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/libpath.patch
new file mode 100644
index 00000000000..372c83944a2
--- /dev/null
+++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-xmpp/libpath.patch
@@ -0,0 +1,16 @@
+diff --git a/jabber.py b/jabber.py
+index 27006a3..e53c2c0 100644
+--- a/jabber.py
++++ b/jabber.py
+@@ -95,6 +95,11 @@ SCRIPT_COMMAND = SCRIPT_NAME
+ import re
+ import warnings
+ 
++import sys
++
++sys.path.append('@env@')
++
++
+ import_ok = True
+ 
+ try: