diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/irc/weechat/scripts')
21 files changed, 728 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix new file mode 100644 index 000000000000..a2e9fc3265a3 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, weechat }: + +stdenv.mkDerivation { + pname = "buffer_autoset"; + version = "1.2"; + + src = fetchurl { + url = "https://raw.githubusercontent.com/weechat/scripts/2b308b44df39ba6563d02b2bcd40c384ec2777dc/python/buffer_autoset.py"; + sha256 = "0csl3sfpijdbq1j6wabx347lvn91a24a2jfx5b5pspfxz7gixli1"; + }; + + dontUnpack = true; + + passthru.scripts = [ "buffer_autoset.py" ]; + + installPhase = '' + install -D $src $out/share/buffer_autoset.py + ''; + + meta = with lib; { + inherit (weechat.meta) platforms; + description = "buffer_autoset.py is a weechat script which auto-set buffer properties when a buffer is opened."; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ govanify ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix new file mode 100644 index 000000000000..0b6d355797f3 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, fetchurl, weechat }: + +stdenv.mkDerivation { + pname = "weechat-colorize_nicks"; + version = "27"; + + src = fetchurl { + url = "https://github.com/weechat/scripts/raw/bc8a9051800779a036ba11689a277cd5f03657b2/python/colorize_nicks.py"; + sha256 = "0hiay88vvy171jiq6ahflm0ipb7sslfxwhmmm8psv6qk19rv2sxs"; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out/share + cp $src $out/share/colorize_nicks.py + ''; + + passthru = { + scripts = [ "colorize_nicks.py" ]; + }; + + meta = with lib; { + inherit (weechat.meta) platforms; + description = "Use the weechat nick colors in the chat area"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ qyliss ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/default.nix new file mode 100644 index 000000000000..f84e2307acb1 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/default.nix @@ -0,0 +1,37 @@ +{ callPackage, luaPackages, perlPackages, python3Packages }: + +{ + colorize_nicks = callPackage ./colorize_nicks { }; + + edit = callPackage ./edit { }; + + multiline = callPackage ./multiline { + inherit (perlPackages) PodParser; + }; + + url_hint = callPackage ./url_hint { }; + + weechat-grep = callPackage ./weechat-grep { }; + + weechat-matrix-bridge = callPackage ./weechat-matrix-bridge { + inherit (luaPackages) cjson luaffi; + }; + + weechat-matrix = python3Packages.callPackage ./weechat-matrix { }; + + weechat-notify-send = python3Packages.callPackage ./weechat-notify-send { }; + + wee-slack = callPackage ./wee-slack { }; + + weechat-autosort = callPackage ./weechat-autosort { }; + + weechat-otr = callPackage ./weechat-otr { }; + + weechat-go = callPackage ./weechat-go { }; + + buffer_autoset = callPackage ./buffer_autoset { }; + + highmon = callPackage ./highmon { }; + + zncplayback = callPackage ./zncplayback { }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/edit/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/edit/default.nix new file mode 100644 index 000000000000..5f91417b76fa --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/edit/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, weechat }: + +stdenv.mkDerivation rec { + pname = "edit-weechat"; + version = "1.0.2"; + + src = fetchFromGitHub { + owner = "keith"; + repo = "edit-weechat"; + rev = version; + sha256 = "1s42r0l0xkhlp6rbc23cm4vlda91il6cg53w33hqfhd2wz91s66w"; + }; + + dontBuild = true; + + passthru.scripts = [ "edit.py" ]; + + installPhase = '' + runHook preInstall + install -D edit.py $out/share/edit.py + runHook postInstall + ''; + + meta = with lib; { + inherit (weechat.meta) platforms; + description = "This simple weechat plugin allows you to compose messages in your $EDITOR."; + license = licenses.mit; + maintainers = with maintainers; [ eraserhd ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/highmon/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/highmon/default.nix new file mode 100644 index 000000000000..f65322465707 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/highmon/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, weechat }: + +stdenv.mkDerivation { + pname = "highmon"; + version = "2.7"; + + src = fetchurl { + url = "https://raw.githubusercontent.com/KenjiE20/highmon/182e67d070c75efc81999e68c2ac7fdfe44d2872/highmon.pl"; + sha256 = "1vvgzscb12l3cp2nq954fx6j3awvpjsb0nqylal51ps9cq9a3wir"; + }; + + dontUnpack = true; + + passthru.scripts = [ "highmon.pl" ]; + + installPhase = '' + runHook preInstall + + install -D $src $out/share/highmon.pl + + runHook postInstall + ''; + + meta = with lib; { + inherit (weechat.meta) platforms; + homepage = "https://github.com/KenjiE20/highmon/"; + description = "highmon.pl is a weechat script that adds 'Highlight Monitor'."; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ govanify ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix new file mode 100644 index 000000000000..f61b4391e18d --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, fetchurl, substituteAll, PodParser }: + +stdenv.mkDerivation { + pname = "multiline"; + version = "0.6.4"; + + src = fetchurl { + url = "https://raw.githubusercontent.com/weechat/scripts/5f073d966e98d54344a91be4f5afc0ec9e2697dc/perl/multiline.pl"; + sha256 = "sha256-TXbU2Q7Tm8iTwOQqrWpqHXuKrjoBFLyUWRsH+TsR9Lo="; + }; + + dontUnpack = true; + prePatch = '' + cp $src multiline.pl + ''; + + patches = [ + # The script requires a special Perl environment. + (substituteAll { + src = ./libpath.patch; + env = PodParser; + }) + ]; + + passthru.scripts = [ "multiline.pl" ]; + + installPhase = '' + runHook preInstall + + install -D multiline.pl $out/share/multiline.pl + + runHook postInstall + ''; + + meta = with lib; { + description = "Multi-line edit box"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ oxzi ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/multiline/libpath.patch b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/multiline/libpath.patch new file mode 100644 index 000000000000..34299f20d8c2 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/multiline/libpath.patch @@ -0,0 +1,9 @@ +diff --git a/multiline.pl b/multiline.pl +index 54474d4..42fbef8 100644 +--- a/multiline.pl ++++ b/multiline.pl +@@ -1,3 +1,4 @@ ++use lib '@env@/lib/perl5/site_perl'; + use strict; use warnings; + $INC{'Encode/ConfigLocal.pm'}=1; + require Encode; diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/url_hint/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/url_hint/default.nix new file mode 100644 index 000000000000..90c98b8fe769 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/url_hint/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchurl, weechat }: + +stdenv.mkDerivation { + pname = "url_hint"; + version = "0.8"; + + src = fetchurl { + url = "https://raw.githubusercontent.com/weechat/scripts/10671d785ea3f9619d0afd0d7a1158bfa4ee3938/python/url_hint.py"; + sha256 = "0aw59kq74yqh0qbdkldfl6l83d0bz833232xr2w4741szck43kss"; + }; + + dontUnpack = true; + + passthru.scripts = [ "url_hint.py" ]; + + installPhase = '' + runHook preInstall + install -D $src $out/share/url_hint.py + runHook postInstall + ''; + + meta = with lib; { + inherit (weechat.meta) platforms; + description = "url_hint.py is a URL opening script."; + license = licenses.mit; + maintainers = with maintainers; [ eraserhd ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix new file mode 100644 index 000000000000..c1b9b9fd6063 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix @@ -0,0 +1,48 @@ +{ lib, stdenv, substituteAll, buildEnv, fetchFromGitHub, python3Packages }: + +stdenv.mkDerivation rec { + pname = "wee-slack"; + version = "2.10.1"; + + src = fetchFromGitHub { + repo = "wee-slack"; + owner = "wee-slack"; + rev = "v${version}"; + sha256 = "sha256-J4s7+JFd/y1espp3HZCs48++fhN6lmpaglGkgomtf3o="; + }; + + patches = [ + (substituteAll { + src = ./libpath.patch; + env = "${buildEnv { + name = "wee-slack-env"; + paths = with python3Packages; [ + websocket-client + six + ]; + }}/${python3Packages.python.sitePackages}"; + }) + ./load_weemoji_path.patch + ]; + + postPatch = '' + substituteInPlace wee_slack.py --subst-var out + ''; + + passthru.scripts = [ "wee_slack.py" ]; + + installPhase = '' + mkdir -p $out/share + cp wee_slack.py $out/share/wee_slack.py + install -D -m 0444 weemoji.json $out/share/wee-slack/weemoji.json + ''; + + meta = with lib; { + homepage = "https://github.com/wee-slack/wee-slack"; + license = licenses.mit; + maintainers = with maintainers; [ willibutz ]; + description = '' + A WeeChat plugin for Slack.com. Synchronizes read markers, provides typing notification, search, etc.. + ''; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch new file mode 100644 index 000000000000..a6e38c16fb14 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch @@ -0,0 +1,13 @@ +diff --git a/wee_slack.py b/wee_slack.py +index e4716b4..f673b7c 100644 +--- a/wee_slack.py ++++ b/wee_slack.py +@@ -31,6 +31,8 @@ import string + # See https://github.com/numpy/numpy/issues/11925 + sys.modules["numpy"] = None + ++sys.path.append('@env@') ++ + from websocket import ( # noqa: E402 + ABNF, + create_connection, diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/load_weemoji_path.patch b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/load_weemoji_path.patch new file mode 100644 index 000000000000..1e97dc32fa65 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/load_weemoji_path.patch @@ -0,0 +1,25 @@ +diff --git a/wee_slack.py b/wee_slack.py +index e4716b4..ffd122d 100644 +--- a/wee_slack.py ++++ b/wee_slack.py +@@ -6092,19 +6092,7 @@ def create_slack_debug_buffer(): + + def load_emoji(): + try: +- weechat_dir = w.info_get("weechat_data_dir", "") or w.info_get( +- "weechat_dir", "" +- ) +- weechat_sharedir = w.info_get("weechat_sharedir", "") +- local_weemoji, global_weemoji = ( +- "{}/weemoji.json".format(path) for path in (weechat_dir, weechat_sharedir) +- ) +- path = ( +- global_weemoji +- if os.path.exists(global_weemoji) and not os.path.exists(local_weemoji) +- else local_weemoji +- ) +- with open(path, "r") as ef: ++ with open("@out@/share/wee-slack/weemoji.json", "r") as ef: + emojis = json.loads(ef.read()) + if "emoji" in emojis: + print_error( diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix new file mode 100644 index 000000000000..c20d8f0a8079 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "weechat-autosort"; + version = "3.9"; + + src = fetchFromGitHub { + owner = "de-vri-es"; + repo = pname; + rev = "d62fa8633015ebc2676060fcdae88c402977be46"; + sha256 = "sha256-doYDRIWiuHam2i3r3J3BZuWEhopoN4jms/xPXGyypok="; + }; + + passthru.scripts = [ "autosort.py" ]; + installPhase = '' + install -D autosort.py $out/share/autosort.py + ''; + + meta = with lib; { + description = "Autosort is a weechat script to automatically or manually keep your buffers sorted"; + homepage = "https://github.com/de-vri-es/weechat-autosort"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ emily flokli ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix new file mode 100644 index 000000000000..623b2570b475 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, weechat }: + +stdenv.mkDerivation { + pname = "weechat-go"; + version = "2.7"; + + src = fetchurl { + url = "https://github.com/weechat/scripts/raw/414cff3ee605ba204b607742430a21443c035b08/python/go.py"; + sha256 = "0bnbfpj1qg4yzwbikh1aw5ajc8l44lkb0y0m6mz8grpf5bxk5cwm"; + }; + + dontUnpack = true; + + passthru.scripts = [ "go.py" ]; + + installPhase = '' + install -D $src $out/share/go.py + ''; + + meta = with lib; { + inherit (weechat.meta) platforms; + description = "go.py is a weechat script to quickly jump to different buffers"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ govanify ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix new file mode 100644 index 000000000000..efc575bd3e29 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "weechat-grep"; + version = "0.8.5"; + + src = fetchurl { + url = "https://github.com/weechat/scripts/raw/5ee93d56f371c829d2798a5446a14292c180f70b/python/grep.py"; + sha256 = "sha256-EVcoxjTTjXOYD8DppD+IULxpKerEdolmlgphrulFGC0="; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out/share + cp $src $out/share/grep.py + ''; + + passthru = { + scripts = [ "grep.py" ]; + }; + + meta = with lib; { + description = "Search in Weechat buffers and logs (for Weechat 0.3.*)"; + homepage = "https://github.com/weechat/scripts/blob/master/python/grep.py"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ flokli ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix new file mode 100644 index 000000000000..282603f99248 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, curl, fetchFromGitHub, cjson, olm, luaffi }: + +stdenv.mkDerivation { + pname = "weechat-matrix-bridge"; + version = "unstable-2018-11-19"; + src = fetchFromGitHub { + owner = "torhve"; + repo = "weechat-matrix-protocol-script"; + rev = "8d32e90d864a8f3f09ecc2857cd5dd6e39a8c3f7"; + sha256 = "0qqd6qmkrdc0r3rnl53c3yp93fbcz7d3mdw3vq5gmdqxyym4s9lj"; + }; + + patches = [ + ./library-path.patch + ]; + + buildInputs = [ curl cjson olm luaffi ]; + + postPatch = '' + substituteInPlace matrix.lua \ + --replace "/usr/bin/curl" "${curl}/bin/curl" \ + --replace "__NIX_LIB_PATH__" "$out/lib/?.so" \ + --replace "__NIX_OLM_PATH__" "$out/share/?.lua" + + substituteInPlace olm.lua \ + --replace "__NIX_LIB_PATH__" "$out/lib/?.so" + ''; + + passthru.scripts = [ "matrix.lua" ]; + + installPhase = '' + mkdir -p $out/{share,lib} + + cp {matrix.lua,olm.lua} $out/share + cp ${cjson}/lib/lua/${cjson.lua.luaversion}/cjson.so $out/lib/cjson.so + cp ${olm}/lib/libolm.so $out/lib/libolm.so + cp ${luaffi}/lib/lua/${luaffi.lua.luaversion}/ffi.so $out/lib/ffi.so + ''; + + meta = with lib; { + description = "A WeeChat script in Lua that implements the matrix.org chat protocol"; + homepage = "https://github.com/torhve/weechat-matrix-protocol-script"; + maintainers = with maintainers; [ ]; + license = licenses.mit; # see https://github.com/torhve/weechat-matrix-protocol-script/blob/0052e7275ae149dc5241226391c9b1889ecc3c6b/matrix.lua#L53 + platforms = platforms.unix; + + # As of 2019-06-30, all of the dependencies are available on macOS but the + # package itself does not build. + broken = stdenv.isDarwin; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/library-path.patch b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/library-path.patch new file mode 100644 index 000000000000..d9945c2993b7 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/library-path.patch @@ -0,0 +1,28 @@ +diff --git a/matrix.lua b/matrix.lua +index b79f500..32b37a2 100644 +--- a/matrix.lua ++++ b/matrix.lua +@@ -43,6 +43,9 @@ This script maps this as follows: + + ]] + ++package.cpath = package.cpath .. ";__NIX_LIB_PATH__" ++package.path = package.path .. ";__NIX_OLM_PATH__" ++ + local json = require 'cjson' -- apt-get install lua-cjson + local olmstatus, olm = pcall(require, 'olm') -- LuaJIT olm FFI binding ln -s ~/olm/olm.lua /usr/local/share/lua/5.1 + local w = weechat +diff --git a/olm.lua b/olm.lua +index 114649c..4828371 100644 +--- a/olm.lua ++++ b/olm.lua +@@ -17,6 +17,9 @@ + * limitations under the License. + */ + --]] ++ ++package.cpath = package.cpath .. ";__NIX_LIB_PATH__" ++ + local ffi = require'ffi' + + ffi.cdef[[ 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 new file mode 100644 index 000000000000..3ae60816b5a0 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix @@ -0,0 +1,103 @@ +{ buildPythonPackage +, lib +, python +, fetchFromGitHub +, fetchpatch +, pyopenssl +, webcolors +, future +, atomicwrites +, attrs +, logbook +, pygments +, matrix-nio +, aiohttp +, requests +}: + +let + scriptPython = python.withPackages (ps: with ps; [ + aiohttp + requests + python-magic + ]); + + version = "0.3.0"; +in buildPythonPackage { + pname = "weechat-matrix"; + inherit version; + + src = fetchFromGitHub { + owner = "poljar"; + repo = "weechat-matrix"; + rev = version; + hash = "sha256-o4kgneszVLENG167nWnk2FxM+PsMzi+PSyMUMIktZcc="; + }; + + patches = [ + # server: remove set_npn_protocols() + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/poljar/weechat-matrix/pull/309.patch"; + hash = "sha256-Grdht+TOFvCYRpL7uhPivqL7YzLoNVF3iQNHgbv1Te0="; + }) + # Fix compatibility with matrix-nio 0.21 + (fetchpatch { + url = "https://github.com/poljar/weechat-matrix/commit/feae9fda26ea9de98da9cd6733980a203115537e.patch"; + hash = "sha256-MAfxJ85dqz5PNwp/GJdHA2VvXVdWh+Ayx5g0oHiw9rs="; + includes = ["matrix/config.py"]; + }) + ]; + + propagatedBuildInputs = [ + pyopenssl + webcolors + future + atomicwrites + attrs + logbook + pygments + matrix-nio + aiohttp + requests + ] ++ matrix-nio.optional-dependencies.e2e; + + passthru.scripts = [ "matrix.py" ]; + + dontBuild = true; + doCheck = false; + + format = "other"; + + installPhase = '' + mkdir -p $out/share $out/bin + cp main.py $out/share/matrix.py + + cp contrib/matrix_upload.py $out/bin/matrix_upload + cp contrib/matrix_decrypt.py $out/bin/matrix_decrypt + cp contrib/matrix_sso_helper.py $out/bin/matrix_sso_helper + substituteInPlace $out/bin/matrix_upload \ + --replace '/usr/bin/env -S python3' '${scriptPython}/bin/python' + substituteInPlace $out/bin/matrix_sso_helper \ + --replace '/usr/bin/env -S python3' '${scriptPython}/bin/python' + substituteInPlace $out/bin/matrix_decrypt \ + --replace '/usr/bin/env python3' '${scriptPython}/bin/python' + + mkdir -p $out/${python.sitePackages} + cp -r matrix $out/${python.sitePackages}/matrix + ''; + + dontPatchShebangs = true; + postFixup = '' + addToSearchPath program_PYTHONPATH $out/${python.sitePackages} + patchPythonScript $out/share/matrix.py + substituteInPlace $out/${python.sitePackages}/matrix/server.py --replace \"matrix_sso_helper\" \"$out/bin/matrix_sso_helper\" + ''; + + meta = with lib; { + description = "A Python plugin for Weechat that lets Weechat communicate over the Matrix protocol"; + homepage = "https://github.com/poljar/weechat-matrix"; + license = licenses.isc; + platforms = platforms.unix; + maintainers = with maintainers; [ tilpner emily ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix new file mode 100644 index 000000000000..78f9fc082e31 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, libnotify }: + +stdenv.mkDerivation rec { + pname = "weechat-notify-send"; + version = "0.9"; + + src = fetchFromGitHub { + owner = "s3rvac"; + repo = pname; + rev = "v${version}"; + sha256 = "1693b7axm9ls5p7hm6kq6avddsisi491khr5irvswr5lpizvys6a"; + }; + + passthru.scripts = [ "notify_send.py" ]; + + dontBuild = true; + doCheck = false; + + installPhase = '' + install -D notify_send.py $out/share/notify_send.py + substituteInPlace $out/share/notify_send.py \ + --replace "'notify-send'" "'${libnotify}/bin/notify-send'" + ''; + + meta = with lib; { + description = "A WeeChat script that sends highlight and message notifications through notify-send"; + homepage = "https://github.com/s3rvac/weechat-notify-send"; + license = licenses.mit; + maintainers = with maintainers; [ tobim ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix new file mode 100644 index 000000000000..fd5f376ad263 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix @@ -0,0 +1,77 @@ +{ lib, stdenv, substituteAll, buildEnv, fetchgit, fetchFromGitHub, python3Packages, gmp }: + +let + # pure-python-otr (potr) requires an older version of pycrypto, which is + # not compatible with pycryptodome. Therefore, the latest patched version + # of pycrypto will be fetched from the Debian project. + # https://security-tracker.debian.org/tracker/source-package/python-crypto + + pycrypto = python3Packages.buildPythonPackage rec { + pname = "pycrypto"; + version = "2.6.1-13.1"; + + src = fetchgit { + url = "https://salsa.debian.org/sramacher/python-crypto.git"; + rev = "debian/${version}"; + sha256 = "1mahqmlgilgk0rn5hfkhza7kscfm7agdakkb6rqnif9g0qp3s52f"; + }; + + postPatch = '' + for p in debian/patches/*.patch; do + patch -p1 < "$p" + done + ''; + + buildInputs = [ gmp ]; + + # Tests are relying on old Python 2 modules. + doCheck = false; + + preConfigure = '' + sed -i 's,/usr/include,/no-such-dir,' configure + sed -i "s!,'/usr/include/'!!" setup.py + ''; + }; + + potr = python3Packages.potr.overridePythonAttrs (oldAttrs: { + propagatedBuildInputs = [ pycrypto ]; + }); +in stdenv.mkDerivation rec { + pname = "weechat-otr"; + version = "1.9.2"; + + src = fetchFromGitHub { + repo = pname; + owner = "mmb"; + rev = "v${version}"; + sha256 = "1lngv98y6883vk8z2628cl4d5y8jxy39w8245gjdvshl8g18k5s2"; + }; + + patches = [ + (substituteAll { + src = ./libpath.patch; + env = "${buildEnv { + name = "weechat-otr-env"; + paths = [ potr pycrypto ]; + }}/${python3Packages.python.sitePackages}"; + }) + ]; + + passthru.scripts = [ "weechat_otr.py" ]; + + installPhase = '' + mkdir -p $out/share + cp weechat_otr.py $out/share/weechat_otr.py + ''; + + meta = with lib; { + homepage = "https://github.com/mmb/weechat-otr"; + license = licenses.gpl3; + maintainers = with maintainers; [ oxzi ]; + description = "WeeChat script for Off-the-Record messaging"; + knownVulnerabilities = [ + "There is no upstream release since 2018-03." + "Utilizes deprecated and vulnerable pycrypto library with Debian patches from 2020-04." + ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch new file mode 100644 index 000000000000..a7b77ed9b602 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/libpath.patch @@ -0,0 +1,13 @@ +diff --git a/weechat_otr.py b/weechat_otr.py +index 0ccfb35..c42bebf 100644 +--- a/weechat_otr.py ++++ b/weechat_otr.py +@@ -41,6 +41,8 @@ import shlex + import shutil + import sys + ++sys.path.append('@env@') ++ + import potr + import weechat + diff --git a/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix new file mode 100644 index 000000000000..704e909282d4 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + pname = "weechat-zncplayback"; + version = "0.2.1"; + + src = fetchurl { + url = "https://github.com/weechat/scripts/raw/bcc9643136addd2cd68ac957dd64e336e4f88aa1/python/zncplayback.py"; + sha256 = "1k32p6naxg40g664ip48zvm61xza7l9az3v3rawmjw97i0mwz7y3"; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out/share + cp $src $out/share/zncplayback.py + ''; + + passthru = { + scripts = [ "zncplayback.py" ]; + }; + + meta = with lib; { + description = "Add support for the ZNC Playback module"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ qyliss ]; + }; +} + |