2020-06-16 14:01:11 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
|
|
|
, autoreconfHook, pkg-config, autoconf-archive, makeWrapper, which
|
|
|
|
, tpm2-tss, glib, dbus
|
|
|
|
, cmocka
|
|
|
|
}:
|
2019-10-26 12:45:30 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tpm2-abrmd";
|
2020-08-24 12:53:55 +01:00
|
|
|
version = "2.3.3";
|
2019-10-26 12:45:30 +01:00
|
|
|
|
2020-06-16 14:01:11 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tpm2-software";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-08-24 12:53:55 +01:00
|
|
|
sha256 = "17nv50w1yh6fg7393vfvys9y13lp0gvxx9vcw2pb87ky551d7xkf";
|
2019-10-26 12:45:30 +01:00
|
|
|
};
|
|
|
|
|
2020-06-16 14:01:11 +01:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook autoconf-archive which ];
|
2020-06-16 14:01:40 +01:00
|
|
|
buildInputs = [ tpm2-tss glib dbus ];
|
|
|
|
checkInputs = [ cmocka ];
|
2019-10-26 12:45:30 +01:00
|
|
|
|
2020-06-16 12:18:11 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-06-16 14:01:11 +01:00
|
|
|
# Emulate the required behavior of ./bootstrap in the original
|
|
|
|
# package
|
|
|
|
preAutoreconf = ''
|
|
|
|
echo "${version}" > VERSION
|
|
|
|
'';
|
|
|
|
|
2019-10-26 12:45:30 +01:00
|
|
|
# Unit tests are currently broken as the check phase attempts to start a dbus daemon etc.
|
|
|
|
#configureFlags = [ "--enable-unit" ];
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-06-16 11:47:37 +01: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 ]}"
|
|
|
|
'';
|
|
|
|
|
2019-10-26 12:45:30 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "TPM2 resource manager, accessible via D-Bus";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/tpm2-software/tpm2-tools";
|
2019-10-26 12:45:30 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
2020-10-28 13:33:03 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
2019-10-26 12:45:30 +01:00
|
|
|
};
|
|
|
|
}
|