tpm2-tss: fix cross-compilation, enable strictDeps

It appears some dependencies were listed in checkInputs, they're moved
to the proper place in buildInputs & nativeBuildInputs.

Since this library was added as dependency of systemd, it's needed for
lots of packages to get cross-compilation working properly.

Also fixes pkgsStatic build, which fails due to cmocka not building.
Since we don't need it anyway when tests are disabled, gate it behind a
test for stdenv.buildPlatform == stdenv.hostPlatform.
This commit is contained in:
Rick van Schijndel 2021-09-17 18:09:15 +02:00
parent f83b6edaa6
commit 68b5339f09

View file

@ -26,11 +26,21 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
autoreconfHook autoconf-archive pkg-config doxygen perl
];
buildInputs = [ openssl json_c curl libgcrypt ];
checkInputs = [
cmocka uthash ibm-sw-tpm2 iproute2 procps_pkg which
# cmocka is checked / used(?) in the configure script
# when unit and/or integration testing is enabled
buildInputs = [ openssl json_c curl libgcrypt uthash ]
# cmocka doesn't build with pkgsStatic, and we don't need it anyway
# when tests are not run
++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
cmocka
];
checkInputs = [
cmocka which openssl procps_pkg iproute2 ibm-sw-tpm2
];
strictDeps = true;
preAutoreconf = "./bootstrap";
enableParallelBuilding = true;
@ -49,7 +59,7 @@ stdenv.mkDerivation rec {
--replace '@PREFIX@' $out/lib
'';
configureFlags = [
configureFlags = lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
"--enable-unit"
"--enable-integration"
];