diff options
author | nyanloutre <paul@nyanlout.re> | 2019-01-29 14:46:44 +0100 |
---|---|---|
committer | nyanloutre <paul@nyanlout.re> | 2019-01-31 09:55:55 +0100 |
commit | 53fddad692c0892161dfb5eec3a78c650b7466ec (patch) | |
tree | 199ac78ecbb7f553e7f4db66a4d3bad3d1254402 /pkgs/servers/mautrix-telegram | |
parent | 9cc5a48329246a32e17de7bcae68295417e99109 (diff) |
mautrix-telegram: init at 0.4.0.post1
Diffstat (limited to 'pkgs/servers/mautrix-telegram')
-rw-r--r-- | pkgs/servers/mautrix-telegram/default.nix | 50 | ||||
-rw-r--r-- | pkgs/servers/mautrix-telegram/fix_patch_conflicts.patch | 27 |
2 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/servers/mautrix-telegram/default.nix b/pkgs/servers/mautrix-telegram/default.nix new file mode 100644 index 0000000000000..9aa4fc24e4bf5 --- /dev/null +++ b/pkgs/servers/mautrix-telegram/default.nix @@ -0,0 +1,50 @@ +{ lib, fetchpatch, python3 }: + +with python3.pkgs; + +buildPythonPackage rec { + pname = "mautrix-telegram"; + version = "0.4.0.post1"; + + src = fetchPypi { + inherit pname version; + sha256 = "7a51e55a7f362013ce1cce7d850c65dc8d4651dd05c63004429bc521b461d029"; + }; + + patches = [ + (fetchpatch { + url = "https://github.com/tulir/mautrix-telegram/commit/a258c59ca3558ad91b1fee190c624763ca835d2f.patch"; + sha256 = "04z4plsmqmg38rsw9irp5xc9wdgjvg6xba69mixi5v82h9lg3zzp"; + }) + + ./fix_patch_conflicts.patch + + (fetchpatch { + url = "https://github.com/tulir/mautrix-telegram/commit/8021fcc24cbf8c88d9bcb2601333863c9615bd4f.patch"; + sha256 = "0cdfv8ggnjdwdhls1lk6498b233lvnb6175xbxr206km5mxyvqyk"; + }) + ]; + + propagatedBuildInputs = [ + aiohttp + mautrix-appservice + sqlalchemy + alembic + CommonMark + ruamel_yaml + future-fstrings + python_magic + telethon + telethon-session-sqlalchemy + ]; + + # No tests available + doCheck = false; + + meta = with lib; { + homepage = https://github.com/tulir/mautrix-telegram; + description = "A Matrix-Telegram hybrid puppeting/relaybot bridge"; + license = licenses.agpl3Plus; + maintainers = with maintainers; [ nyanloutre ]; + }; +} diff --git a/pkgs/servers/mautrix-telegram/fix_patch_conflicts.patch b/pkgs/servers/mautrix-telegram/fix_patch_conflicts.patch new file mode 100644 index 0000000000000..99c902ce03b7d --- /dev/null +++ b/pkgs/servers/mautrix-telegram/fix_patch_conflicts.patch @@ -0,0 +1,27 @@ +diff --git a/mautrix_telegram/abstract_user.py b/mautrix_telegram/abstract_user.py +index 11273f8..aadaf5d 100644 +--- a/mautrix_telegram/abstract_user.py ++++ b/mautrix_telegram/abstract_user.py +@@ -21,14 +21,14 @@ import logging + import platform + + from sqlalchemy import orm +-from telethon.tl.types import Channel, ChannelForbidden, Chat, ChatForbidden, Message, \ +- MessageActionChannelMigrateFrom, MessageService, PeerUser, TypeUpdate, \ +- UpdateChannelPinnedMessage, UpdateChatAdmins, UpdateChatParticipantAdmin, \ +- UpdateChatParticipants, UpdateChatUserTyping, UpdateDeleteChannelMessages, \ +- UpdateDeleteMessages, UpdateEditChannelMessage, UpdateEditMessage, UpdateNewChannelMessage, \ +- UpdateNewMessage, UpdateReadHistoryOutbox, UpdateShortChatMessage, UpdateShortMessage, \ +- UpdateUserName, UpdateUserPhoto, UpdateUserStatus, UpdateUserTyping, User, UserStatusOffline, \ +- UserStatusOnline ++from telethon.tl.patched import MessageService, Message ++from telethon.tl.types import ( ++ Channel, ChannelForbidden, Chat, ChatForbidden, MessageActionChannelMigrateFrom, PeerUser, ++ TypeUpdate, UpdateChannelPinnedMessage, UpdateChatAdmins, UpdateChatParticipantAdmin, ++ UpdateChatParticipants, UpdateChatUserTyping, UpdateDeleteChannelMessages, UpdateDeleteMessages, ++ UpdateEditChannelMessage, UpdateEditMessage, UpdateNewChannelMessage, UpdateNewMessage, ++ UpdateReadHistoryOutbox, UpdateShortChatMessage, UpdateShortMessage, UpdateUserName, ++ UpdateUserPhoto, UpdateUserStatus, UpdateUserTyping, User, UserStatusOffline, UserStatusOnline) + + from mautrix_appservice import MatrixRequestError, AppService + from alchemysession import AlchemySessionContainer |