diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | 0001-Use-system-tdlib.diff | 27 | ||||
-rw-r--r-- | 0002-Remove-binarys.diff | 15 | ||||
-rw-r--r-- | PKGBUILD | 15 |
4 files changed, 59 insertions, 2 deletions
@@ -8,7 +8,11 @@ pkgbase = python-telegram depends = python3 conflicts = python-telegram-bot source = python-telegram-0.12.0.tar.gz::https://github.com/alexander-akhmetov/python-telegram/archive/0.12.0.tar.gz + source = 0001-Use-system-tdlib.diff + source = 0002-Remove-binarys.diff md5sums = ebf3e34648e21da96e6470474e0fd7eb + md5sums = 287acb342038ba44bb86cdc2c6cb303b + md5sums = c9085c229e25cab11bffd1431c220ef1 pkgname = python-telegram diff --git a/0001-Use-system-tdlib.diff b/0001-Use-system-tdlib.diff new file mode 100644 index 000000000000..a5f9340cc6df --- /dev/null +++ b/0001-Use-system-tdlib.diff @@ -0,0 +1,27 @@ +diff --git a/telegram/tdjson.py b/telegram/tdjson.py +index 091145e..21c0361 100644 +--- a/telegram/tdjson.py ++++ b/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/0002-Remove-binarys.diff b/0002-Remove-binarys.diff new file mode 100644 index 000000000000..72b1744dfb54 --- /dev/null +++ b/0002-Remove-binarys.diff @@ -0,0 +1,15 @@ +diff --git a/setup.py b/setup.py +index a1ac7b0..aecc107 100644 +--- a/setup.py ++++ b/setup.py +@@ -25,10 +25,4 @@ setup( + packages=[ + 'telegram', + ], +- package_data={ +- 'telegram': [ +- 'lib/darwin/*', +- 'lib/linux/*', +- ], +- }, + ) @@ -8,8 +8,19 @@ url="https://github.com/alexander-akhmetov/python-telegram" license=('MIT') depends=('python3') conflicts=('python-telegram-bot') -source=("$pkgname-$pkgver.tar.gz::https://github.com/alexander-akhmetov/$pkgname/archive/$pkgver.tar.gz") -md5sums=('ebf3e34648e21da96e6470474e0fd7eb') +source=("$pkgname-$pkgver.tar.gz::https://github.com/alexander-akhmetov/$pkgname/archive/$pkgver.tar.gz" + "0001-Use-system-tdlib.diff" + "0002-Remove-binarys.diff") +md5sums=('ebf3e34648e21da96e6470474e0fd7eb' + '287acb342038ba44bb86cdc2c6cb303b' + 'c9085c229e25cab11bffd1431c220ef1') + +prepare() { + cd "${pkgname}-${pkgver}" + patch -p1 -i ${srcdir}/0001-Use-system-tdlib.diff + patch -p1 -i ${srcdir}/0002-Remove-binarys.diff + rm -r telegram/lib +} build() { cd "$pkgname-$pkgver" |