depot/third_party/nixpkgs/pkgs/development/python-modules/python-telegram/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

57 lines
1.1 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, setuptools
, tdlib
, telegram-text
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "python-telegram";
version = "0.18.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "alexander-akhmetov";
repo = "python-telegram";
rev = version;
hash = "sha256-2Q0nUZ2TMVWznd05+fqYojkRn4xfFZJrlqb1PMuBsAY=";
};
postPatch = ''
# Remove bundled libtdjson
rm -fr telegram/lib
substituteInPlace telegram/tdjson.py \
--replace "ctypes.util.find_library(\"tdjson\")" \
"\"${tdlib}/lib/libtdjson${stdenv.hostPlatform.extensions.sharedLibrary}\""
'';
propagatedBuildInputs = [
setuptools
telegram-text
];
nativeCheckInputs = [
pytestCheckHook
];
disabledTests = [
"TestGetTdjsonTdlibPath"
];
pythonImportsCheck = [
"telegram.client"
];
meta = with lib; {
description = "Python client for the Telegram's tdlib";
homepage = "https://github.com/alexander-akhmetov/python-telegram";
license = licenses.mit;
maintainers = with maintainers; [ sikmir ];
};
}