depot/third_party/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

39 lines
983 B
Nix

{ stdenv, fetchurl, lib, openssl }:
stdenv.mkDerivation rec {
pname = "ibm-sw-tpm2";
version = "1563";
src = fetchurl {
url = "mirror://sourceforge/ibmswtpm2/ibmtpm${version}.tar.gz";
sha256 = "1sfi7drmbm08rgd2414s3sxd7h5g8d4kiwk40xklf7sw67w1ffpw";
};
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;
};
}