From 71975fa6126bc6ee0c78c8ff54989d6372661975 Mon Sep 17 00:00:00 2001 From: Maxim Karasev Date: Tue, 11 May 2021 20:09:54 +0300 Subject: [PATCH 1/2] New package: python3-telegram-0.14.0 --- .../remove-precompiled-libraries.patch | 15 +++++++++++ .../patches/use-system-tdlib.patch | 27 +++++++++++++++++++ srcpkgs/python3-telegram/template | 22 +++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 srcpkgs/python3-telegram/patches/remove-precompiled-libraries.patch create mode 100644 srcpkgs/python3-telegram/patches/use-system-tdlib.patch create mode 100644 srcpkgs/python3-telegram/template diff --git a/srcpkgs/python3-telegram/patches/remove-precompiled-libraries.patch b/srcpkgs/python3-telegram/patches/remove-precompiled-libraries.patch new file mode 100644 index 000000000000..714faee8ca87 --- /dev/null +++ b/srcpkgs/python3-telegram/patches/remove-precompiled-libraries.patch @@ -0,0 +1,15 @@ +diff --git a/setup.py b/setup.py +index a1ac7b0..aecc107 100644 +--- setup.py ++++ setup.py +@@ -25,10 +25,4 @@ setup( + packages=[ + 'telegram', + ], +- package_data={ +- 'telegram': [ +- 'lib/darwin/*', +- 'lib/linux/*', +- ], +- }, + ) diff --git a/srcpkgs/python3-telegram/patches/use-system-tdlib.patch b/srcpkgs/python3-telegram/patches/use-system-tdlib.patch new file mode 100644 index 000000000000..294f8fe798e4 --- /dev/null +++ b/srcpkgs/python3-telegram/patches/use-system-tdlib.patch @@ -0,0 +1,27 @@ +diff --git a/telegram/tdjson.py b/telegram/tdjson.py +index 091145e..21c0361 100644 +--- telegram/tdjson.py ++++ telegram/tdjson.py +@@ -2,6 +2,7 @@ import json + import logging + import platform + from ctypes import CDLL, CFUNCTYPE, c_int, c_char_p, c_double, c_void_p, c_longlong ++from ctypes.util import find_library + from typing import Any, Dict, Optional, Union + + import pkg_resources +@@ -10,13 +11,7 @@ logger = logging.getLogger(__name__) + + + def _get_tdjson_lib_path() -> str: +- if platform.system().lower() == 'darwin': +- lib_name = 'darwin/libtdjson.dylib' +- else: +- lib_name = 'linux/libtdjson.so' +- +- return pkg_resources.resource_filename('telegram', f'lib/{lib_name}') +- ++ return find_library("tdjson") + + class TDJson: + def __init__(self, library_path: Optional[str] = None, verbosity: int = 2) -> None: diff --git a/srcpkgs/python3-telegram/template b/srcpkgs/python3-telegram/template new file mode 100644 index 000000000000..13cc66ab33c7 --- /dev/null +++ b/srcpkgs/python3-telegram/template @@ -0,0 +1,22 @@ +# Template file for 'python3-telegram' +pkgname=python3-telegram +version=0.14.0 +revision=1 +wrksrc=python-telegram-${version} +build_style=python3-module +hostmakedepends="python3" +depends="libtd python3-setuptools" +short_desc="Python library for building Telegram clients" +maintainer="Maxim Karasev " +license="MIT" +homepage="https://github.com/alexander-akhmetov/python-telegram" +distfiles="https://github.com/alexander-akhmetov/python-telegram/archive/${version}.tar.gz" +checksum=11b0a2387bae642eb7f134fe35b9ef67b8183aa961412bcdfa86ff404beed897 + +post_extract() { + rm -r telegram/lib +} + +post_install() { + vlicense LICENSE +} From 030661a845a13dec42a363041bc2a6a9efd53a67 Mon Sep 17 00:00:00 2001 From: Maxim Karasev Date: Tue, 11 May 2021 20:10:12 +0300 Subject: [PATCH 2/2] New package: telegram-tg-0.17.0 --- srcpkgs/telegram-tg/template | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 srcpkgs/telegram-tg/template diff --git a/srcpkgs/telegram-tg/template b/srcpkgs/telegram-tg/template new file mode 100644 index 000000000000..9d2c800d7a8f --- /dev/null +++ b/srcpkgs/telegram-tg/template @@ -0,0 +1,16 @@ +# Template file for 'telegram-tg' +pkgname=telegram-tg +version=0.17.0 +revision=1 +wrksrc=tg-${version} +build_style=python3-module +hostmakedepends="python3-setuptools" +depends="python3-telegram" +short_desc="Terminal Telegram client" +maintainer="Maxim Karasev " +license="Unlicense" +homepage="https://github.com/paul-nameless/tg" +distfiles="${PYPI_SITE}/t/tg/tg-${version}.tar.gz" +checksum=aab22b1e40a28710b6e3dbe4f3bba67ff02e36d612d8388f9400e4c34feab221 +# There are no tests to run +make_check=no