biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / security / opensc / default.nix
blob412053af2b4b3f25410f843cbdbb8f82eb0daf75
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
6 }:
8 stdenv.mkDerivation rec {
9   pname = "opensc";
10   version = "0.25.1";
12   src = fetchFromGitHub {
13     owner = "OpenSC";
14     repo = "OpenSC";
15     rev = version;
16     sha256 = "sha256-Ktvp/9Hca87qWmDlQhFzvWsr7TvNpIAvOFS+4zTZbB8=";
17   };
19   nativeBuildInputs = [ pkg-config autoreconfHook ];
20   buildInputs = [
21     zlib readline openssl libassuan
22     libXt libxslt libiconv docbook_xml_dtd_412
23   ]
24   ++ lib.optional stdenv.hostPlatform.isDarwin Carbon
25   ++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]);
27   env.NIX_CFLAGS_COMPILE = "-Wno-error";
29   configureFlags = [
30     "--enable-zlib"
31     "--enable-readline"
32     "--enable-openssl"
33     "--enable-pcsc"
34     "--enable-sm"
35     "--enable-man"
36     "--enable-doc"
37     "--localstatedir=/var"
38     "--sysconfdir=/etc"
39     "--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook"
40     "--with-pcsc-provider=${
41       if withApplePCSC then
42         "${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
43       else
44         "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
45       }"
46     (lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform)
47       "XSLTPROC=${buildPackages.libxslt}/bin/xsltproc")
48   ];
50   PCSC_CFLAGS = lib.optionalString withApplePCSC
51     "-I${PCSC}/Library/Frameworks/PCSC.framework/Headers";
53   installFlags = [
54     "sysconfdir=$(out)/etc"
55     "completiondir=$(out)/etc"
56   ];
58   meta = with lib; {
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 ];
64   };