2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchurl, lib
|
|
|
|
, pandoc, pkgconfig, makeWrapper, curl, openssl, tpm2-tss
|
|
|
|
, abrmdSupport ? true, tpm2-abrmd ? null }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tpm2-tools";
|
2020-05-29 06:06:01 +00:00
|
|
|
version = "4.1.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
|
2020-05-29 06:06:01 +00:00
|
|
|
sha256 = "0di97zmxdh04m2ibyshcgvillwxx6rnd0543scm7q10y7nv74m0p";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pandoc pkgconfig makeWrapper ];
|
|
|
|
buildInputs = [
|
|
|
|
curl openssl tpm2-tss
|
|
|
|
];
|
|
|
|
|
|
|
|
preFixup = let
|
|
|
|
ldLibraryPath = lib.makeLibraryPath ([
|
|
|
|
tpm2-tss
|
|
|
|
] ++ (lib.optional abrmdSupport tpm2-abrmd));
|
|
|
|
in ''
|
|
|
|
for bin in $out/bin/*; do
|
|
|
|
wrapProgram $bin \
|
|
|
|
--suffix LD_LIBRARY_PATH : "${ldLibraryPath}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
# Unit tests disabled, as they rely on a dbus session
|
|
|
|
#configureFlags = [ "--enable-unit" ];
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line tools that provide access to a TPM 2.0 compatible device";
|
|
|
|
homepage = "https://github.com/tpm2-software/tpm2-tools";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ delroth ];
|
|
|
|
};
|
|
|
|
}
|