From 16e2a5dcc59676b3220b9071bea65d9add9cda9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 25 Jul 2023 11:11:01 +0100 Subject: [PATCH] add tpm2-tss test patch --- nixpkgs/245332.patch | 33 +++++++++++++++++++++++++++++++++ nixpkgs/default.nix | 5 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 nixpkgs/245332.patch diff --git a/nixpkgs/245332.patch b/nixpkgs/245332.patch new file mode 100644 index 0000000..6a88ab6 --- /dev/null +++ b/nixpkgs/245332.patch @@ -0,0 +1,33 @@ +From 15c139a200051c6b3ef5b82bbc862b4e79dfb826 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= +Date: Tue, 25 Jul 2023 07:54:29 +0100 +Subject: [PATCH] tpm-tss2: allow disabling tests + +Currently, if you disable the check phase, tpm-tss2 will not build, as +it will still require test dependencies due to the configure flags. + +This commit only adds the test configureFlags if testing is enabled. +--- + pkgs/development/libraries/tpm2-tss/default.nix | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/pkgs/development/libraries/tpm2-tss/default.nix b/pkgs/development/libraries/tpm2-tss/default.nix +index 9d7cb73cc539c..4c9c8ec9676fa 100644 +--- a/pkgs/development/libraries/tpm2-tss/default.nix ++++ b/pkgs/development/libraries/tpm2-tss/default.nix +@@ -70,10 +70,11 @@ stdenv.mkDerivation rec { + --replace 'git describe --tags --always --dirty' 'echo "${version}"' + ''; + +- configureFlags = lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ +- "--enable-unit" +- "--enable-integration" +- ]; ++ preConfigure = lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) '' ++ if [ ! -z $doCheck ]; then ++ configureFlagsArray+=('--enable-unit' '--enable-integration') ++ fi ++ ''; + + doCheck = true; + preCheck = '' diff --git a/nixpkgs/default.nix b/nixpkgs/default.nix index eca644e..7cce07d 100644 --- a/nixpkgs/default.nix +++ b/nixpkgs/default.nix @@ -5,5 +5,8 @@ applyPatches { name = "nixpkgs-patched"; src = nixpkgs; - patches = [./nixpkgs.patch]; + patches = [ + ./nixpkgs.patch + ./245332.patch + ]; }