Merge pull request #293815 from Aleksanaa/tg

tg: fix sending message and desktop notification

authored by Nikolay Korotkiy and committed by GitHub 2340120c 8b7eef36

+23 -1
+23 -1
pkgs/applications/networking/instant-messengers/telegram/tg/default.nix
··· 1 - { lib, buildPythonApplication, fetchFromGitHub, pythonOlder, python-telegram }: 2 3 buildPythonApplication rec { 4 pname = "tg"; ··· 11 rev = "v${version}"; 12 hash = "sha256-apHd26XnOz5nak+Kz8PJPsonQfTWDyPz7Mi/tWf7zwM="; 13 }; 14 15 propagatedBuildInputs = [ python-telegram ]; 16
··· 1 + { lib 2 + , buildPythonApplication 3 + , fetchFromGitHub 4 + , pythonOlder 5 + , fetchpatch 6 + , stdenv 7 + , libnotify 8 + , python-telegram 9 + }: 10 11 buildPythonApplication rec { 12 pname = "tg"; ··· 19 rev = "v${version}"; 20 hash = "sha256-apHd26XnOz5nak+Kz8PJPsonQfTWDyPz7Mi/tWf7zwM="; 21 }; 22 + 23 + patches = [ 24 + # Fix sending messages 25 + # https://github.com/paul-nameless/tg/pull/306 26 + (fetchpatch { 27 + url = "https://github.com/mindtheegab/tg/commit/13e2b266989d2d757a394b0fb8cb7fd6ccc2b70c.patch"; 28 + hash = "sha256-Wja6xBOlPuACzhbT8Yl3F8qSh3Kd9G1lnr9VarbPrfM="; 29 + }) 30 + ]; 31 + 32 + # Fix notifications on platforms other than darwin by providing notify-send 33 + postPatch = lib.optionalString (!stdenv.isDarwin) '' 34 + sed -i 's|^NOTIFY_CMD = .*|NOTIFY_CMD = "${libnotify}/bin/notify-send {title} {message} -i {icon_path}"|' tg/config.py 35 + ''; 36 37 propagatedBuildInputs = [ python-telegram ]; 38