2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, which
|
2020-04-24 23:36:52 +00:00
|
|
|
, gettext, libffi, libiconv, libtasn1
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "p11-kit";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "0.23.22";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "p11-glue";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-erWqElJr0iESNUk9EZiJRmSMYhns8GxuFLNw7mIIIWs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev"];
|
|
|
|
outputBin = "dev";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# for cross platform builds of p11-kit, libtasn1 in nativeBuildInputs
|
|
|
|
# provides the asn1Parser binary on the hostPlatform needed for building.
|
|
|
|
# at the same time, libtasn1 in buildInputs provides the libasn1 library
|
|
|
|
# to link against for the target platform.
|
|
|
|
# hence, libtasn1 is required in both native and build inputs.
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config which libtasn1 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ gettext libffi libiconv libtasn1 ];
|
|
|
|
|
|
|
|
autoreconfPhase = ''
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2020-05-03 17:38:23 +00:00
|
|
|
"--with-trust-paths=/etc/ssl/certs/ca-certificates.crt"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
# Tests run in fakeroot for non-root users
|
|
|
|
preCheck = ''
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
|
|
export FAKED_MODE=1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
installFlags = [
|
|
|
|
"exampledir=${placeholder "out"}/etc/pkcs11"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for loading and sharing PKCS#11 modules";
|
|
|
|
longDescription = ''
|
|
|
|
Provides a way to load and enumerate PKCS#11 modules.
|
|
|
|
Provides a standard configuration setup for installing
|
|
|
|
PKCS#11 modules in such a way that they're discoverable.
|
|
|
|
'';
|
|
|
|
homepage = "https://p11-glue.github.io/p11-glue/p11-kit.html";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|