about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyscard/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyscard/default.nix')
-rw-r--r--pkgs/development/python-modules/pyscard/default.nix70
1 files changed, 38 insertions, 32 deletions
diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix
index 5fa9e60ae5c6c..3fd9d3c2fbd46 100644
--- a/pkgs/development/python-modules/pyscard/default.nix
+++ b/pkgs/development/python-modules/pyscard/default.nix
@@ -1,13 +1,14 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, buildPythonPackage
-, setuptools
-, pkg-config
-, swig
-, pcsclite
-, PCSC
-, pytestCheckHook
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  PCSC,
+  pcsclite,
+  pkg-config,
+  pytestCheckHook,
+  setuptools,
+  stdenv,
+  swig,
 }:
 
 let
@@ -16,8 +17,8 @@ let
 in
 
 buildPythonPackage rec {
-  version = "2.0.9";
   pname = "pyscard";
+  version = "2.0.9";
   pyproject = true;
 
   src = fetchFromGitHub {
@@ -27,40 +28,45 @@ buildPythonPackage rec {
     hash = "sha256-DO4Ea+mlrWPpOLI8Eki+03UnsOXEhN2PAl0+gdN5sTo=";
   };
 
-  nativeBuildInputs = [
-    setuptools
-    swig
-  ] ++ lib.optionals (!withApplePCSC) [
-    pkg-config
-  ];
+  build-system = [ setuptools ];
+
+  nativeBuildInputs = [ swig ] ++ lib.optionals (!withApplePCSC) [ pkg-config ];
 
   buildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ];
 
-  nativeCheckInputs = [
-    pytestCheckHook
-  ];
+  nativeCheckInputs = [ pytestCheckHook ];
 
   postPatch =
-    if withApplePCSC then ''
-      substituteInPlace smartcard/scard/winscarddll.c \
-        --replace "/System/Library/Frameworks/PCSC.framework/PCSC" \
-                  "${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
-    '' else ''
-      substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG"
-      substituteInPlace smartcard/scard/winscarddll.c \
-        --replace "libpcsclite.so.1" \
-                  "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
-    '';
+    if withApplePCSC then
+      ''
+        substituteInPlace smartcard/scard/winscarddll.c \
+          --replace-fail "/System/Library/Frameworks/PCSC.framework/PCSC" \
+                    "${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
+      ''
+    else
+      ''
+        substituteInPlace setup.py --replace "pkg-config" "$PKG_CONFIG"
+        substituteInPlace smartcard/scard/winscarddll.c \
+          --replace-fail "libpcsclite.so.1" \
+                    "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
+      '';
 
   preCheck = ''
     # remove src module, so tests use the installed module instead
     rm -r smartcard
   '';
 
+  disabledTests = [
+    # AssertionError
+    "test_hresult"
+    "test_low_level"
+  ];
+
   meta = with lib; {
-    homepage = "https://pyscard.sourceforge.io/";
     description = "Smartcard library for python";
-    license = licenses.lgpl21;
+    homepage = "https://pyscard.sourceforge.io/";
+    changelog = "https://github.com/LudovicRousseau/pyscard/releases/tag/${version}";
+    license = licenses.lgpl21Plus;
     maintainers = with maintainers; [ layus ];
   };
 }