2023-08-04 22:07:22 +00:00
|
|
|
{ stdenv, fetchurl, lib, fetchpatch
|
2021-02-16 17:04:54 +00:00
|
|
|
, pandoc, pkg-config, makeWrapper, curl, openssl, tpm2-tss, libuuid
|
2020-04-24 23:36:52 +00:00
|
|
|
, abrmdSupport ? true, tpm2-abrmd ? null }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tpm2-tools";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "5.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
|
2023-03-04 12:14:45 +00:00
|
|
|
sha256 = "sha256-H9tJxzBTe/2u0IiISIGmHjv9Eh6VfsC9zu7AJhI2wSM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/tpm2-software/tpm2-tools/pull/3271
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tpm2-software/tpm2-tools/commit/b98be08f6f88b0cca9e0667760c4e1e5eb417fbd.patch";
|
|
|
|
sha256 = "sha256-2sEam9i4gwscJhLwraX2EAjVM8Dh1vmNnG3zYsOF0fc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pandoc pkg-config makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-02-16 17:04:54 +00:00
|
|
|
curl openssl tpm2-tss libuuid
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preFixup = let
|
|
|
|
ldLibraryPath = lib.makeLibraryPath ([
|
|
|
|
tpm2-tss
|
|
|
|
] ++ (lib.optional abrmdSupport tpm2-abrmd));
|
|
|
|
in ''
|
2021-05-03 20:48:10 +00:00
|
|
|
wrapProgram $out/bin/tpm2 --suffix LD_LIBRARY_PATH : "${ldLibraryPath}"
|
|
|
|
wrapProgram $out/bin/tss2 --suffix LD_LIBRARY_PATH : "${ldLibraryPath}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
# 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 ];
|
|
|
|
};
|
|
|
|
}
|