about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix b/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
new file mode 100644
index 000000000000..d6e8a521a2fa
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, lib, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "ibm-sw-tpm2";
+  version = "1628";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ibmswtpm2/ibmtpm${version}.tar.gz";
+    sha256 = "18wywbsdp5sjrapznk2ydbmx0whz513dhybn1lls24xfl7kp9s58";
+  };
+
+  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;
+  };
+}