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.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix b/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
index de260e068249..9a13c2103016 100644
--- a/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
+++ b/nixpkgs/pkgs/tools/security/ibm-sw-tpm2/default.nix
@@ -4,7 +4,12 @@
 , fetchpatch
 , openssl
 }:
-
+let
+  makefile =
+    if stdenv.isDarwin
+    then "makefile.mac"
+    else "makefile";
+in
 stdenv.mkDerivation rec {
   pname = "ibm-sw-tpm2";
   version = "1682";
@@ -30,12 +35,14 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "src";
 
+  inherit makefile;
+
   prePatch = ''
     # Fix hardcoded path to GCC.
-    substituteInPlace makefile --replace /usr/bin/gcc "${stdenv.cc}/bin/cc"
+    substituteInPlace ${makefile} --replace /usr/bin/gcc "${stdenv.cc}/bin/cc"
 
     # Remove problematic default CFLAGS.
-    substituteInPlace makefile \
+    substituteInPlace ${makefile} \
       --replace -Werror "" \
       --replace -O0 "" \
       --replace -ggdb ""
@@ -49,7 +56,7 @@ stdenv.mkDerivation rec {
   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;
+    platforms = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ delroth ];
     license = licenses.bsd3;
   };