2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, which
|
2019-05-13 22:28:31 +01:00
|
|
|
, gettext, libffi, libiconv, libtasn1
|
|
|
|
}:
|
2011-11-07 16:48:14 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-13 22:28:31 +01:00
|
|
|
pname = "p11-kit";
|
2021-01-20 13:43:28 +00:00
|
|
|
version = "0.23.22";
|
2011-11-07 16:48:14 +00:00
|
|
|
|
2017-08-01 01:03:23 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "p11-glue";
|
2019-05-13 22:28:31 +01:00
|
|
|
repo = pname;
|
2017-08-01 01:03:23 +01:00
|
|
|
rev = version;
|
2021-01-20 13:43:28 +00:00
|
|
|
sha256 = "sha256-erWqElJr0iESNUk9EZiJRmSMYhns8GxuFLNw7mIIIWs=";
|
2011-11-07 16:48:14 +00:00
|
|
|
};
|
|
|
|
|
2017-09-19 21:24:36 +01:00
|
|
|
outputs = [ "out" "dev"];
|
2015-10-07 21:36:11 +01:00
|
|
|
outputBin = "dev";
|
|
|
|
|
2020-08-31 20:28:42 +01: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-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config which libtasn1 ];
|
2019-05-13 22:28:31 +01:00
|
|
|
buildInputs = [ gettext libffi libiconv libtasn1 ];
|
2017-08-01 01:03:23 +01:00
|
|
|
|
|
|
|
autoreconfPhase = ''
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
'';
|
2011-11-07 16:48:14 +00:00
|
|
|
|
2015-04-20 06:43:41 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2020-04-25 17:27:34 +01:00
|
|
|
"--with-trust-paths=/etc/ssl/certs/ca-certificates.crt"
|
|
|
|
];
|
2014-01-10 00:17:54 +00:00
|
|
|
|
2018-06-02 04:14:27 +01:00
|
|
|
enableParallelBuilding = true;
|
2018-04-25 04:20:18 +01:00
|
|
|
|
2020-10-25 21:17:24 +00:00
|
|
|
# Tests run in fakeroot for non-root users
|
|
|
|
preCheck = ''
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
|
|
export FAKED_MODE=1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2019-06-04 01:21:56 +01:00
|
|
|
doCheck = !stdenv.isDarwin;
|
2019-05-13 22:28:31 +01:00
|
|
|
|
2020-04-25 17:27:34 +01:00
|
|
|
installFlags = [
|
|
|
|
"exampledir=${placeholder "out"}/etc/pkcs11"
|
|
|
|
];
|
2019-05-13 22:28:31 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-05-13 22:28:31 +01: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.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://p11-glue.github.io/p11-glue/p11-kit.html";
|
2015-04-20 06:43:41 +01:00
|
|
|
platforms = platforms.all;
|
2019-05-13 22:28:31 +01:00
|
|
|
license = licenses.bsd3;
|
2011-11-07 16:48:14 +00:00
|
|
|
};
|
|
|
|
}
|