Files
nixpkgs/pkgs/development/python-modules/pyscard/default.nix
Martin Weinelt 701b40f37a python3Packages.pyscard: 2.2.2 -> 2.3.0
https://github.com/LudovicRousseau/pyscard/releases/tag/2.3.0

This commit was automatically generated using update-python-libraries.
2025-08-09 19:02:41 +02:00

52 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pcsclite,
pkg-config,
pytestCheckHook,
setuptools,
stdenv,
swig,
}:
buildPythonPackage rec {
pname = "pyscard";
version = "2.3.0";
pyproject = true;
src = fetchFromGitHub {
owner = "LudovicRousseau";
repo = "pyscard";
tag = version;
hash = "sha256-rz3m8eVbmJUMcQFuEMZwF3k/ES75KcNA8R+xix+Mgq8=";
};
build-system = [ setuptools ];
nativeBuildInputs = [ swig ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ pcsclite ];
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'requires = ["setuptools","swig"]' 'requires = ["setuptools"]'
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG"
substituteInPlace src/smartcard/scard/winscarddll.c \
--replace-fail "libpcsclite.so.1" \
"${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
'';
meta = {
description = "Smartcard library for python";
homepage = "https://pyscard.sourceforge.io/";
changelog = "https://github.com/LudovicRousseau/pyscard/releases/tag/${src.tag}";
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ layus ];
};
}