2019-06-16 20:59:06 +01:00
|
|
|
{ stdenv, fetchurl, lib
|
2019-10-27 10:30:06 +00:00
|
|
|
, pandoc, pkgconfig, makeWrapper, curl, openssl, tpm2-tss
|
|
|
|
, abrmdSupport ? true, tpm2-abrmd ? null }:
|
2019-02-14 05:12:32 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tpm2-tools";
|
2019-12-09 22:15:23 +00:00
|
|
|
version = "4.1";
|
2019-02-14 05:12:32 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
|
2019-12-09 22:15:23 +00:00
|
|
|
sha256 = "1wnw4i2m6dkafqjjma8mxw9419py2v1knhn3zf1gaizdabskgkh7";
|
2019-02-14 05:12:32 +00:00
|
|
|
};
|
|
|
|
|
2019-10-27 10:30:06 +00:00
|
|
|
nativeBuildInputs = [ pandoc pkgconfig makeWrapper ];
|
2019-02-14 05:12:32 +00:00
|
|
|
buildInputs = [
|
|
|
|
curl openssl tpm2-tss
|
|
|
|
];
|
|
|
|
|
2019-10-27 10:30:06 +00:00
|
|
|
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;
|
2019-02-14 05:12:32 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|