about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorBobby Rong <rjl931189261@126.com>2021-12-17 15:15:55 +0800
committerGitHub <noreply@github.com>2021-12-17 15:15:55 +0800
commit31ecc61abbeea589e09795cb2741ae2547a87ed1 (patch)
treeb40f26da775dd8662e466604f5faf95aaa319440 /pkgs
parent281e50cad883f90c9c313ebbae2ce9024bcae25b (diff)
parent5e12d84c5c8f58494801eee666b0eb5ebab0196b (diff)
Merge pull request #146124 from Luflosi/update/swtpm
swtpm: 0.6.1 -> 0.7.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/security/swtpm/default.nix25
1 files changed, 14 insertions, 11 deletions
diff --git a/pkgs/tools/security/swtpm/default.nix b/pkgs/tools/security/swtpm/default.nix
index 7f2352c7282c9..f05658f8a98e4 100644
--- a/pkgs/tools/security/swtpm/default.nix
+++ b/pkgs/tools/security/swtpm/default.nix
@@ -1,6 +1,6 @@
 { lib
 , stdenv
-, fetchFromGitHub, fetchpatch
+, fetchFromGitHub
 , autoreconfHook
 , pkg-config
 , libtasn1, openssl, fuse, glib, libseccomp, json-glib
@@ -8,32 +8,32 @@
 , unixtools, expect, socat
 , gnutls
 , perl
+
+# Tests
+, python3, which
 }:
 
 stdenv.mkDerivation rec {
   pname = "swtpm";
-  version = "0.6.1";
+  version = "0.7.0";
 
   src = fetchFromGitHub {
     owner = "stefanberger";
     repo = "swtpm";
     rev = "v${version}";
-    sha256 = "sha256-iy8xjKnPLq1ntZa9x+KtLDznzu6m+1db3NPeGQESUVo=";
+    sha256 = "sha256-5MKQmZxTW8WofmTkV9kGeGN5RxsgVVMFZEF3rPDUO6Q=";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://patch-diff.githubusercontent.com/raw/stefanberger/swtpm/pull/527.patch";
-      sha256 = "sha256-cpKHP15a27ifmmswSgHoNzGPO6TY/ZuJIfM5xLOlqlU=";
-    })
-  ];
-
   nativeBuildInputs = [
     pkg-config unixtools.netstat expect socat
     perl # for pod2man
     autoreconfHook
   ];
 
+  checkInputs = [
+    python3 which
+  ];
+
   buildInputs = [
     libtpms
     openssl libtasn1 libseccomp
@@ -47,17 +47,20 @@ stdenv.mkDerivation rec {
   ];
 
   postPatch = ''
+    patchShebangs tests/*
+
     # Makefile tries to create the directory /var/lib/swtpm-localca, which fails
     substituteInPlace samples/Makefile.am \
         --replace 'install-data-local:' 'do-not-execute:'
 
     # Use the correct path to the certtool binary
     # instead of relying on it being in the environment
-    substituteInPlace samples/swtpm_localca.c --replace \
+    substituteInPlace src/swtpm_localca/swtpm_localca.c --replace \
         '# define CERTTOOL_NAME "certtool"' \
         '# define CERTTOOL_NAME "${gnutls}/bin/certtool"'
   '';
 
+  doCheck = true;
   enableParallelBuilding = true;
 
   outputs = [ "out" "man" ];