Merge pull request #55749 from delroth/tpm2-tools
Add package tpm2-tools (+ deps) to nixpkgs
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
{ stdenv, fetchurl, lib, openssl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ibm-sw-tpm2";
|
||||
version = "1332";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/ibmswtpm2/ibmtpm${version}.tar.gz";
|
||||
sha256 = "1zdhi8acd4jfp1v7ibd86hcv0g39yk8qrnhxjmmgzn8i7npr70cf";
|
||||
};
|
||||
|
||||
buildInputs = [ openssl ];
|
||||
|
||||
sourceRoot = "src";
|
||||
|
||||
prePatch = ''
|
||||
# Fix hardcoded path to GCC.
|
||||
substituteInPlace makefile --replace /usr/bin/gcc "${stdenv.cc}/bin/cc"
|
||||
|
||||
# Remove problematic default CFLAGS.
|
||||
substituteInPlace makefile \
|
||||
--replace -Werror "" \
|
||||
--replace -O0 "" \
|
||||
--replace -ggdb ""
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp tpm_server $out/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "IBM's Software TPM 2.0, an implementation of the TCG TPM 2.0 specification";
|
||||
homepage = https://sourceforge.net/projects/ibmswtpm2/;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ delroth ];
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{ stdenv, fetchurl, fetchpatch, lib
|
||||
, cmocka, curl, pandoc, pkgconfig, openssl, tpm2-tss }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "tpm2-tools";
|
||||
version = "3.1.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
|
||||
sha256 = "05is1adwcg7y2p121yldd8m1gigdnzf9izbjazvsr6yg95pmg5fc";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
name = "tests-tss-2.2.0-compat.patch";
|
||||
url = "https://patch-diff.githubusercontent.com/raw/tpm2-software/tpm2-tools/pull/1322.patch";
|
||||
sha256 = "0yy5qbgbd13d7cl8pzsji95a6qnwiik5s2cyqj35jd8blymikqxh";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pandoc pkgconfig ];
|
||||
buildInputs = [
|
||||
curl openssl tpm2-tss
|
||||
# For unit tests.
|
||||
cmocka
|
||||
];
|
||||
|
||||
configureFlags = [ "--enable-unit" ];
|
||||
doCheck = true;
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user