mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 07:44:14 +01:00
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
54 lines
1.2 KiB
Nix
54 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
pytestCheckHook,
|
|
setuptools-scm,
|
|
setuptools,
|
|
tdlib,
|
|
telegram-text,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "python-telegram";
|
|
version = "0.19.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "alexander-akhmetov";
|
|
repo = "python-telegram";
|
|
tag = version;
|
|
hash = "sha256-JnU59DZXpnaZXIY/apXQ2gBgiwT12rJIeVqzaP0l7Zk=";
|
|
};
|
|
|
|
postPatch = ''
|
|
# Remove bundled libtdjson
|
|
rm -fr telegram/lib
|
|
|
|
substituteInPlace telegram/tdjson.py \
|
|
--replace-fail "ctypes.util.find_library(\"tdjson\")" \
|
|
"\"${tdlib}/lib/libtdjson${stdenv.hostPlatform.extensions.sharedLibrary}\""
|
|
'';
|
|
|
|
build-inputs = [ setuptools ];
|
|
|
|
dependencies = [
|
|
setuptools-scm
|
|
telegram-text
|
|
];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
disabledTests = [ "TestGetTdjsonTdlibPath" ];
|
|
|
|
pythonImportsCheck = [ "telegram.client" ];
|
|
|
|
meta = {
|
|
description = "Python client for the Telegram's tdlib";
|
|
homepage = "https://github.com/alexander-akhmetov/python-telegram";
|
|
changelog = "https://github.com/alexander-akhmetov/python-telegram/releases/tag/${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ sikmir ];
|
|
};
|
|
}
|