about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyscard/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyscard/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyscard/default.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyscard/default.nix b/nixpkgs/pkgs/development/python-modules/pyscard/default.nix
index 4bda0b3c65c0..d563a62a46b3 100644
--- a/nixpkgs/pkgs/development/python-modules/pyscard/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/pyscard/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchPypi, buildPythonPackage, swig, pcsclite, PCSC }:
+{ stdenv, fetchPypi, fetchpatch, buildPythonPackage, swig, pcsclite, PCSC }:
 
 let
   # Package does not support configuring the pcsc library.
@@ -30,6 +30,21 @@ buildPythonPackage rec {
   NIX_CFLAGS_COMPILE = optionalString (! withApplePCSC)
     "-I ${getDev pcsclite}/include/PCSC";
 
+  # The error message differs depending on the macOS host version.
+  # Since Nix reports a constant host version, but proxies to the
+  # underlying library, it's not possible to determine the correct
+  # expected error message.  This patch allows both errors to be
+  # accepted.
+  # See: https://github.com/LudovicRousseau/pyscard/issues/77
+  # Building with python from nix on macOS version 10.13 or
+  # greater still causes this issue to occur.
+  patches = optionals withApplePCSC [
+    (fetchpatch {
+      url = "https://github.com/LudovicRousseau/pyscard/commit/945e9c4cd4036155691f6ce9706a84283206f2ef.patch";
+      sha256 = "19n8w1wzn85zywr6xf04d8nfg7sgzjyvxp1ccp3rgfr4mcc36plc";
+    })
+  ];
+
   propagatedBuildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ];
   nativeBuildInputs = [ swig ];