weechatScripts.wee-slack: 2.7.0 -> 2.8.0

https://github.com/wee-slack/wee-slack/releases/tag/v2.8.0
(cherry picked from commit d7de7087fc)
wip/little-gl
Martin Weinelt 3 years ago committed by github-actions[bot]
parent 9130b8c465
commit 9bbf2ec131
  1. 35
      pkgs/applications/networking/irc/weechat/scripts/wee-slack/0001-hardcode-json-file-path.patch
  2. 11
      pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix
  3. 14
      pkgs/applications/networking/irc/weechat/scripts/wee-slack/libpath.patch
  4. 25
      pkgs/applications/networking/irc/weechat/scripts/wee-slack/load_weemoji_path.patch

@ -1,35 +0,0 @@
From 5dd2593369645b11a9dc03e1930617d2f5dbd039 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 11 Nov 2020 11:48:49 +0100
Subject: [PATCH] hardcode json file path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
wee_slack.py | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/wee_slack.py b/wee_slack.py
index a3d779c..5942289 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -5136,13 +5136,7 @@ def create_slack_debug_buffer():
def load_emoji():
try:
- weechat_dir = 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('The weemoji.json file is in an old format. Please update it.')
--
2.29.0

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "wee-slack";
version = "2.7.0";
version = "2.8.0";
src = fetchFromGitHub {
repo = "wee-slack";
owner = "wee-slack";
rev = "v${version}";
sha256 = "sha256-6Z/H15bKe0PKpNe9PCgc5mLOii3CILCAVon7EgzIkx8=";
sha256 = "0xfklr0gsc9jgxfyrrb2j756lclz9g8imcb0pk0xgyj8mhsw23zk";
};
patches = [
@ -16,10 +16,13 @@ stdenv.mkDerivation rec {
src = ./libpath.patch;
env = "${buildEnv {
name = "wee-slack-env";
paths = with python3Packages; [ websocket_client six ];
paths = with python3Packages; [
websocket_client
six
];
}}/${python3Packages.python.sitePackages}";
})
./0001-hardcode-json-file-path.patch
./load_weemoji_path.patch
];
postPatch = ''

@ -1,13 +1,13 @@
diff --git a/wee_slack.py b/wee_slack.py
index dbe6446..d1b7546 100644
index e4716b4..f673b7c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -25,6 +25,8 @@ import random
import socket
import string
@@ -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 ABNF, create_connection, WebSocketConnectionClosedException
try:
from websocket import ( # noqa: E402
ABNF,
create_connection,

@ -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(
Loading…
Cancel
Save