about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-07-13 23:20:04 +0000
committerAlyssa Ross <hi@alyssa.is>2020-07-13 23:21:06 +0000
commita42c1d6d62656dcf9bd85de620f2e200a5ad22d8 (patch)
tree7d481fea9872f62a034452612be17f4494159baa /nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix
parent55f69a6b0e53c1c4b3e0396937c53bf5662b5519 (diff)
parent9480bae337095fd24f61380bce3174fdfe926a00 (diff)
downloadnixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.gz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.bz2
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.lz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.xz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.zst
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.zip
Merge commit '9480bae337095fd24f61380bce3174fdfe926a00'
This is the last nixos-unstable release before 13b2903169f, which I'm a
bit nervous about.  So I want the update including that one to be as
small as possible, hence going to this one first.
Diffstat (limited to 'nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix40
1 files changed, 30 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix b/nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix
index fbebde2e7bf6..6fe116d7015a 100644
--- a/nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix
+++ b/nixpkgs/pkgs/tools/security/tpm2-abrmd/default.nix
@@ -1,24 +1,44 @@
-{ stdenv, fetchurl, lib
-, tpm2-tss, pkgconfig, glib, which, dbus, cmocka }:
+{ stdenv, lib, fetchFromGitHub
+, autoreconfHook, pkg-config, autoconf-archive, makeWrapper, which
+, tpm2-tss, glib, dbus
+, cmocka
+}:
 
 stdenv.mkDerivation rec {
   pname = "tpm2-abrmd";
-  version = "2.2.0";
+  version = "2.3.2";
 
-  src = fetchurl {
-    url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1lbfhyyh9k54r8s1h8ca2czxv4hg0yq984kdh3vqh3990aca0x9a";
+  src = fetchFromGitHub {
+    owner = "tpm2-software";
+    repo = pname;
+    rev = version;
+    sha256 = "0jzglnlb700clcq6mjhhgvcq29a6893h888wsn9fbrh4f255sw8q";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    tpm2-tss glib which dbus cmocka
-  ];
+  nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook autoconf-archive which ];
+  buildInputs = [ tpm2-tss glib dbus ];
+  checkInputs = [ cmocka ];
+
+  enableParallelBuilding = true;
+
+  # Emulate the required behavior of ./bootstrap in the original
+  # package
+  preAutoreconf = ''
+    echo "${version}" > VERSION
+  '';
 
   # Unit tests are currently broken as the check phase attempts to start a dbus daemon etc.
   #configureFlags = [ "--enable-unit" ];
   doCheck = false;
 
+  # Even though tpm2-tss is in the RUNPATH, starting from 2.3.0 abrmd
+  # seems to require the path to the device TCTI (used for accessing
+  # /dev/tpm0) in it's LD_LIBRARY_PATH
+  postFixup = ''
+    wrapProgram $out/bin/tpm2-abrmd \
+      --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ tpm2-tss ]}"
+  '';
+
   meta = with lib; {
     description = "TPM2 resource manager, accessible via D-Bus";
     homepage = "https://github.com/tpm2-software/tpm2-tools";