Skip to content

Commit 13d38bf

Browse files
kevingriffinrisicle
authored andcommitted
pythonPackages.pyscard: Fix build on Darwin
The previously provided patch is still necessary, as nix python reports an old version of macOS that has the bug, when in fact modern macOS does not have the misspelling. The patch has been upstreamed, so we take it to fix 1.9.9 in anticipation of the next release. (cherry picked from commit 44fd570)
1 parent a9f0ffa commit 13d38bf

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

pkgs/development/python-modules/pyscard/default.nix

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ stdenv, fetchPypi, buildPythonPackage, swig, pcsclite, PCSC }:
1+
{ stdenv, fetchPypi, fetchpatch, buildPythonPackage, swig, pcsclite, PCSC }:
22

33
let
44
# Package does not support configuring the pcsc library.
@@ -30,6 +30,21 @@ buildPythonPackage rec {
3030
NIX_CFLAGS_COMPILE = optionalString (! withApplePCSC)
3131
"-I ${getDev pcsclite}/include/PCSC";
3232

33+
# The error message differs depending on the macOS host version.
34+
# Since Nix reports a constant host version, but proxies to the
35+
# underlying library, it's not possible to determine the correct
36+
# expected error message. This patch allows both errors to be
37+
# accepted.
38+
# See: https://github.com/LudovicRousseau/pyscard/issues/77
39+
# Building with python from nix on macOS version 10.13 or
40+
# greater still causes this issue to occur.
41+
patches = optionals withApplePCSC [
42+
(fetchpatch {
43+
url = "https://github.com/LudovicRousseau/pyscard/commit/945e9c4cd4036155691f6ce9706a84283206f2ef.patch";
44+
sha256 = "19n8w1wzn85zywr6xf04d8nfg7sgzjyvxp1ccp3rgfr4mcc36plc";
45+
})
46+
];
47+
3348
propagatedBuildInputs = if withApplePCSC then [ PCSC ] else [ pcsclite ];
3449
nativeBuildInputs = [ swig ];
3550

pkgs/development/python-modules/pyscard/ignore-macos-bug.patch

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)