3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

2021-10-16 17:27:42 +01:00
{ stdenv, fetchurl, fetchpatch, lib, openssl }:
2019-02-14 03:42:07 +00:00
stdenv.mkDerivation rec {
pname = "ibm-sw-tpm2";
2021-03-23 10:19:00 +00:00
version = "1661";
2019-02-14 03:42:07 +00:00
src = fetchurl {
url = "mirror://sourceforge/ibmswtpm2/ibmtpm${version}.tar.gz";
2021-03-23 10:19:00 +00:00
sha256 = "sha256-VRRZKK0rJPNL5qDqz5+0kuEODqkZuEKMch+pcOhdYUc=";
2019-02-14 03:42:07 +00:00
};
2021-10-16 17:27:42 +01:00
patches = [
(fetchpatch {
url = "https://github.com/kgoldman/ibmswtpm2/commit/e6684009aff9c1bad38875e3319c2e02ef791424.patch";
sha256 = "1flzlri807c88agmpb0w8xvh5f16mmqv86xw4ic4z272iynzd40j";
})
];
patchFlags = [ "-p2" ];
2019-02-14 03:42:07 +00:00
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/";
2019-02-14 03:42:07 +00:00
platforms = platforms.linux;
maintainers = with maintainers; [ delroth ];
license = licenses.bsd3;
};
}