2020-06-18 07:06:33 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
|
|
|
, autoreconfHook, pkg-config, autoconf-archive, makeWrapper, which
|
|
|
|
, tpm2-tss, glib, dbus
|
|
|
|
, cmocka
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tpm2-abrmd";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "3.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tpm2-software";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-03-04 12:14:45 +00:00
|
|
|
sha256 = "sha256-l0ncCMsStaeFACRU3Bt6F1zyiOTGY6wOHewA4AD58Ww=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf-archive
|
|
|
|
autoreconfHook
|
|
|
|
glib
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
which
|
|
|
|
];
|
2020-06-18 07:06:33 +00:00
|
|
|
buildInputs = [ tpm2-tss glib dbus ];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ cmocka ];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# Emulate the required behavior of ./bootstrap in the original
|
|
|
|
# package
|
|
|
|
preAutoreconf = ''
|
|
|
|
echo "${version}" > VERSION
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Unit tests are currently broken as the check phase attempts to start a dbus daemon etc.
|
|
|
|
#configureFlags = [ "--enable-unit" ];
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
# Even though tpm2-tss is in the RUNPATH, starting from 2.3.0 abrmd
|
|
|
|
# seems to require the path to the device TCTI (used for accessing
|
|
|
|
# /dev/tpm0) in it's LD_LIBRARY_PATH
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/tpm2-abrmd \
|
|
|
|
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ tpm2-tss ]}"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "TPM2 resource manager, accessible via D-Bus";
|
|
|
|
homepage = "https://github.com/tpm2-software/tpm2-tools";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
2020-11-03 02:18:15 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|