2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-08-10 07:59:29 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2022-02-10 20:34:41 +00:00
|
|
|
, pkg-config
|
2023-08-10 07:59:29 +00:00
|
|
|
, libtasn1
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, gettext
|
|
|
|
, mesonEmulatorHook
|
2022-02-10 20:34:41 +00:00
|
|
|
, libffi
|
|
|
|
, libintl
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "p11-kit";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.25.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "p11-glue";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-zIbkw0pwt4TdyjncnSDeTN6Gsx7cc+x7Un4rnagZxQk=";
|
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
outputs = [ "out" "bin" "dev" ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
nativeBuildInputs = [
|
2023-08-10 07:59:29 +00:00
|
|
|
meson
|
|
|
|
ninja
|
2022-02-10 20:34:41 +00:00
|
|
|
pkg-config
|
2023-08-10 07:59:29 +00:00
|
|
|
libtasn1 # asn1Parser
|
|
|
|
libxslt # xsltproc
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_43
|
|
|
|
gettext
|
|
|
|
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libffi
|
|
|
|
libtasn1
|
2023-08-10 07:59:29 +00:00
|
|
|
libintl
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
mesonFlags = [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--sysconfdir=/etc"
|
2023-08-10 07:59:29 +00:00
|
|
|
(lib.mesonBool "man" true)
|
|
|
|
(lib.mesonEnable "systemd" false)
|
|
|
|
(lib.mesonOption "bashcompdir" "${placeholder "bin"}/share/bash-completion/completions")
|
|
|
|
(lib.mesonOption "trust_paths" (lib.concatStringsSep ":" [
|
|
|
|
"/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
|
2022-07-14 12:49:19 +00:00
|
|
|
"/var/lib/ca-certificates/ca-bundle.pem" # openSUSE
|
2023-08-10 07:59:29 +00:00
|
|
|
"/etc/ssl/cert.pem" # Darwin/macOS
|
|
|
|
]))
|
2020-05-03 17:38:23 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Install sample config files to $out/etc even though they will be loaded from /etc.
|
|
|
|
substituteInPlace p11-kit/meson.build \
|
|
|
|
--replace 'install_dir: prefix / p11_system_config' "install_dir: '$out/etc/pkcs11'"
|
2022-02-10 20:34:41 +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";
|
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;
|
|
|
|
};
|
|
|
|
}
|