From 88d61883b6710684efbc544e7be2de282ea3a07d Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Wed, 15 Sep 2021 17:36:31 +0000 Subject: [PATCH 1/2] swtpm: ensure tests run Signed-off-by: Arthur Gautier --- pkgs/tools/security/swtpm/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/security/swtpm/default.nix b/pkgs/tools/security/swtpm/default.nix index 7f2352c7282c..b9cd322a2071 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,6 +8,9 @@ , unixtools, expect, socat , gnutls , perl + +# Tests +, python3, which }: stdenv.mkDerivation rec { @@ -21,19 +24,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-iy8xjKnPLq1ntZa9x+KtLDznzu6m+1db3NPeGQESUVo="; }; - 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,6 +47,8 @@ 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:' @@ -58,6 +60,7 @@ stdenv.mkDerivation rec { '# define CERTTOOL_NAME "${gnutls}/bin/certtool"' ''; + doCheck = true; enableParallelBuilding = true; outputs = [ "out" "man" ]; From 5e12d84c5c8f58494801eee666b0eb5ebab0196b Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 15 Nov 2021 11:57:22 +0100 Subject: [PATCH 2/2] swtpm: 0.6.1 -> 0.7.0 https://github.com/stefanberger/swtpm/releases/tag/v0.7.0 --- pkgs/tools/security/swtpm/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/swtpm/default.nix b/pkgs/tools/security/swtpm/default.nix index b9cd322a2071..f05658f8a98e 100644 --- a/pkgs/tools/security/swtpm/default.nix +++ b/pkgs/tools/security/swtpm/default.nix @@ -15,13 +15,13 @@ 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="; }; nativeBuildInputs = [ @@ -55,7 +55,7 @@ stdenv.mkDerivation rec { # 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"' '';