2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, gtk-doc
|
|
|
|
, installShellFiles
|
|
|
|
, libxslt # for xsltproc
|
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, libffi
|
|
|
|
, libiconv
|
|
|
|
, libintl
|
|
|
|
, libtasn1
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "p11-kit";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.24.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "p11-glue";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-02-10 20:34:41 +00:00
|
|
|
hash = "sha256-1QIMEGBZsqLYU3v5ZswD5K9VcIGLBovJlC10lBHhH7c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
outputs = [ "out" "bin" "dev"];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# For cross platform builds of p11-kit, libtasn1 in nativeBuildInputs
|
2020-09-25 04:45:31 +00:00
|
|
|
# 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.
|
2022-02-10 20:34:41 +00:00
|
|
|
# Hence, libtasn1 is required in both native and build inputs.
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
docbook-xsl-nons
|
|
|
|
gtk-doc
|
|
|
|
installShellFiles
|
|
|
|
libtasn1
|
|
|
|
libxslt.bin
|
|
|
|
pkg-config
|
|
|
|
which
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libffi
|
|
|
|
libiconv
|
|
|
|
libintl
|
|
|
|
libtasn1
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
autoreconfPhase = ''
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
2022-02-10 20:34:41 +00:00
|
|
|
"--enable-doc"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2021-12-06 16:07:01 +00:00
|
|
|
"--with-trust-paths=${lib.concatStringsSep ":" [
|
2022-07-14 12:49:19 +00:00
|
|
|
"/etc/ssl/trust-source" # p11-kit trust source
|
|
|
|
"/etc/ssl/certs/ca-certificates.crt" # NixOS + Debian/Ubuntu/Arch/Gentoo...
|
|
|
|
"/etc/pki/tls/certs/ca-bundle.crt" # Fedora/CentOS
|
|
|
|
"/var/lib/ca-certificates/ca-bundle.pem" # openSUSE
|
2021-12-06 16:07:01 +00:00
|
|
|
]}"
|
2020-05-03 17:38:23 +00:00
|
|
|
];
|
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
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --bash bash-completion/{p11-kit,trust}
|
|
|
|
'';
|
|
|
|
|
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";
|
2022-02-10 20:34:41 +00:00
|
|
|
changelog = [
|
|
|
|
"https://github.com/p11-glue/p11-kit/raw/${version}/NEWS"
|
|
|
|
"https://github.com/p11-glue/p11-kit/releases/tag/${version}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|