New package: python3-telegram-0.14.0

This commit is contained in:
Maxim Karasev 2021-05-16 22:34:02 +03:00 committed by Piraty
parent e3f354399d
commit 0185509d8e
3 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,17 @@
# Patch from https://aur.archlinux.org/cgit/aur.git/plain/0002-Remove-binarys.diff?h=python-telegram
# Upstream issue: https://github.com/alexander-akhmetov/python-telegram/issues/119
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/*',
- ],
- },
)

View file

@ -0,0 +1,29 @@
# Patch from https://aur.archlinux.org/cgit/aur.git/plain/0001-Use-system-tdlib.diff?h=python-telegram
# Upstream issue: https://github.com/alexander-akhmetov/python-telegram/issues/119
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:

View file

@ -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 <begs@disroot.org>"
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
}