diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/0001-hardcode-json-file-path.patch b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/0001-hardcode-json-file-path.patch new file mode 100644 index 00000000000..45e620db258 --- /dev/null +++ b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/0001-hardcode-json-file-path.patch @@ -0,0 +1,35 @@ +From 5dd2593369645b11a9dc03e1930617d2f5dbd039 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= +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 +--- + 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 + diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix index 9650f903ed6..4be611eb71f 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "wee-slack"; - version = "2.6.0"; + version = "8bd734c8e9a6b133a65548672f8a11ee3b3ce677"; src = fetchFromGitHub { repo = "wee-slack"; owner = "wee-slack"; - rev = "v${version}"; - sha256 = "0s4qd1z40c1bczkvc840jwjmzbv7nyj06xqs1si9v54qmkh4gaq4"; + rev = version; + sha256 = "0p48cpaqfqja9i68dqyladwif7x8c19ii8v27p9cxz5y9impc9qk"; }; patches = [ @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { paths = with python3Packages; [ websocket_client six ]; }}/${python3Packages.python.sitePackages}"; }) - ./hardcode-json-file-path.patch + ./0001-hardcode-json-file-path.patch ]; postPatch = '' diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/hardcode-json-file-path.patch b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/hardcode-json-file-path.patch deleted file mode 100644 index 7413a9229ce..00000000000 --- a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/hardcode-json-file-path.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/wee_slack.py -+++ b/wee_slack.py -@@ -4560,8 +4560,7 @@ - - def load_emoji(): - try: -- DIR = w.info_get('weechat_dir', '') -- with open('{}/weemoji.json'.format(DIR), '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.')