1 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, zlib, readline, openssl
2 , libiconv, pcsclite, libassuan, libXt
3 , docbook_xsl, libxslt, docbook_xml_dtd_412
4 , Carbon, PCSC, buildPackages
5 , withApplePCSC ? stdenv.hostPlatform.isDarwin
8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
16 sha256 = "sha256-Ktvp/9Hca87qWmDlQhFzvWsr7TvNpIAvOFS+4zTZbB8=";
19 nativeBuildInputs = [ pkg-config autoreconfHook ];
21 zlib readline openssl libassuan
22 libXt libxslt libiconv docbook_xml_dtd_412
24 ++ lib.optional stdenv.hostPlatform.isDarwin Carbon
25 ++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]);
27 env.NIX_CFLAGS_COMPILE = "-Wno-error";
37 "--localstatedir=/var"
39 "--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook"
40 "--with-pcsc-provider=${
42 "${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
44 "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
46 (lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform)
47 "XSLTPROC=${buildPackages.libxslt}/bin/xsltproc")
50 PCSC_CFLAGS = lib.optionalString withApplePCSC
51 "-I${PCSC}/Library/Frameworks/PCSC.framework/Headers";
54 "sysconfdir=$(out)/etc"
55 "completiondir=$(out)/etc"
59 description = "Set of libraries and utilities to access smart cards";
60 homepage = "https://github.com/OpenSC/OpenSC/wiki";
61 license = licenses.lgpl21Plus;
62 platforms = platforms.all;
63 maintainers = [ maintainers.michaeladler ];