git.iko.soy/typeable/nixpkgs
on master help sign in
weechatScripts.wee-slack: 2.4.0 -> 2.5.0

wee-slack now (optionally) depends on a data file called weemoji.json that allows it to translate between Slack emoji names (like "slight_smile") and Unicode codepoints. For convenience, the derivation now installs this file and patches the script so that the user doesn't need to do any extra configuration to use it.

commita2d9581ac8fb7dfb1be01764e8deb7f5e9b4587c authorBenjamin Esham <benjamin@esham.io> dateWed 25 Mar 2020, 20:08 (7 years ago) parent2d48c2f
2 files changed+20−2
pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix+8−2 pkgs/applications/networking/irc/weechat/scripts/wee-slack/hardcode-json-file-path.patch+12
pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix+8−2
@@ -2,13 +2,13 @@
22
33stdenv.mkDerivation rec {
44 pname = "wee-slack";
5− version = "2.4.0";
5+ version = "2.5.0";
66
77 src = fetchFromGitHub {
88 repo = "wee-slack";
99 owner = "wee-slack";
1010 rev = "v${version}";
11− sha256 = "0h425ln5vv76zv41dccapyfbl8qmmflbpwmrd26knqyj8k24zfpr";
11+ sha256 = "0sxgi5fg8qvzqmxy7sdma6v0wj93xwh21av10n8nxvdskacw5dxz";
1212 };
1313
1414 patches = [
@@ -19,13 +19,19 @@ stdenv.mkDerivation rec {
1919 paths = with python3Packages; [ websocket_client six ];
2020 }}/${python3Packages.python.sitePackages}";
2121 })
22+ ./hardcode-json-file-path.patch
2223 ];
2324
25+ postPatch = ''
26+ substituteInPlace wee_slack.py --subst-var out
27+ '';
28+
2429 passthru.scripts = [ "wee_slack.py" ];
2530
2631 installPhase = ''
2732 mkdir -p $out/share
2833 cp wee_slack.py $out/share/wee_slack.py
34+ install -D -m 0444 weemoji.json $out/share/wee-slack/weemoji.json
2935 '';
3036
3137 meta = with stdenv.lib; {
pkgs/applications/networking/irc/weechat/scripts/wee-slack/hardcode-json-file-path.patchnew file+12
@@ -0,0 +1,12 @@
1+--- a/wee_slack.py
2++++ b/wee_slack.py
3+@@ -4560,8 +4560,7 @@
4+
5+ def load_emoji():
6+ try:
7+- DIR = w.info_get('weechat_dir', '')
8+- with open('{}/weemoji.json'.format(DIR), 'r') as ef:
9++ with open('@out@/share/wee-slack/weemoji.json', 'r') as ef:
10+ emojis = json.loads(ef.read())
11+ if 'emoji' in emojis:
12+ print_error('The weemoji.json file is in an old format. Please update it.')