2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, zlib, readline, openssl
|
2020-11-30 08:33:03 +00:00
|
|
|
, libiconv, pcsclite, libassuan, libXt
|
2020-04-24 23:36:52 +00:00
|
|
|
, docbook_xsl, libxslt, docbook_xml_dtd_412
|
|
|
|
, Carbon, PCSC, buildPackages
|
|
|
|
, withApplePCSC ? stdenv.isDarwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opensc";
|
2021-08-10 14:31:46 +00:00
|
|
|
version = "0.22.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenSC";
|
|
|
|
repo = "OpenSC";
|
|
|
|
rev = version;
|
2021-08-10 14:31:46 +00:00
|
|
|
sha256 = "sha256-0IFpiG1SJq4cpS5z6kwpWSPVWjO0q0SHs+doD2vbUKs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
zlib readline openssl libassuan
|
|
|
|
libXt libxslt libiconv docbook_xml_dtd_412
|
|
|
|
]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Carbon
|
2020-04-24 23:36:52 +00:00
|
|
|
++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]);
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error";
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-zlib"
|
|
|
|
"--enable-readline"
|
|
|
|
"--enable-openssl"
|
|
|
|
"--enable-pcsc"
|
|
|
|
"--enable-sm"
|
|
|
|
"--enable-man"
|
|
|
|
"--enable-doc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook"
|
|
|
|
"--with-pcsc-provider=${
|
|
|
|
if withApplePCSC then
|
|
|
|
"${PCSC}/Library/Frameworks/PCSC.framework/PCSC"
|
|
|
|
else
|
2021-01-15 22:18:51 +00:00
|
|
|
"${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2020-04-24 23:36:52 +00:00
|
|
|
}"
|
2021-01-15 22:18:51 +00:00
|
|
|
(lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform)
|
2020-04-24 23:36:52 +00:00
|
|
|
"XSLTPROC=${buildPackages.libxslt}/bin/xsltproc")
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
PCSC_CFLAGS = lib.optionalString withApplePCSC
|
2020-04-24 23:36:52 +00:00
|
|
|
"-I${PCSC}/Library/Frameworks/PCSC.framework/Headers";
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=$(out)/etc"
|
|
|
|
"completiondir=$(out)/etc"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Set of libraries and utilities to access smart cards";
|
|
|
|
homepage = "https://github.com/OpenSC/OpenSC/wiki";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.all;
|
2021-08-11 14:56:57 +00:00
|
|
|
maintainers = [ maintainers.michaeladler ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|