From b76822209adcf26e074dc743cefe6ede70c6f01c Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Thu, 27 Jul 2023 07:11:27 +0000 Subject: [PATCH] tpm2-tools: rework argv0 parsing `tpm2 --version` relies on `ARGV[0]` being `tpm2` which is not possible with `makeWrapper`. this pulls the fix from https://github.com/tpm2-software/tpm2-tools/pull/3271 Signed-off-by: Arthur Gautier --- pkgs/tools/security/tpm2-tools/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/tpm2-tools/default.nix b/pkgs/tools/security/tpm2-tools/default.nix index a2687103e38..4e8fd919f9a 100644 --- a/pkgs/tools/security/tpm2-tools/default.nix +++ b/pkgs/tools/security/tpm2-tools/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, lib +{ stdenv, fetchurl, lib, fetchpatch , pandoc, pkg-config, makeWrapper, curl, openssl, tpm2-tss, libuuid , abrmdSupport ? true, tpm2-abrmd ? null }: @@ -11,6 +11,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-H9tJxzBTe/2u0IiISIGmHjv9Eh6VfsC9zu7AJhI2wSM="; }; + patches = [ + # https://github.com/tpm2-software/tpm2-tools/pull/3271 + (fetchpatch { + url = "https://github.com/tpm2-software/tpm2-tools/commit/b98be08f6f88b0cca9e0667760c4e1e5eb417fbd.patch"; + sha256 = "sha256-2sEam9i4gwscJhLwraX2EAjVM8Dh1vmNnG3zYsOF0fc="; + }) + ]; + nativeBuildInputs = [ pandoc pkg-config makeWrapper ]; buildInputs = [ curl openssl tpm2-tss libuuid