Unverified Commit 429c26ac authored by nikstur's avatar nikstur Committed by GitHub
Browse files

tpm2-tss: use finalAttrs for overriding doInstallCheck (#430884)

parents 3f63b0cf 5930fdcb
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -29,14 +29,14 @@ let
  procps_pkg = if stdenv.hostPlatform.isLinux then procpsWithoutSystemd else procps;
in

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "tpm2-tss";
  version = "4.1.3";

  src = fetchFromGitHub {
    owner = "tpm2-software";
    repo = pname;
    rev = version;
    repo = finalAttrs.pname;
    rev = finalAttrs.version;
    hash = "sha256-BP28utEUI9g1VNv3lCXuiKrDtEImFQxxZfIjLiE3Wr8=";
  };

@@ -67,9 +67,9 @@ stdenv.mkDerivation rec {
  # when unit and/or integration testing is enabled
  # cmocka doesn't build with pkgsStatic, and we don't need it anyway
  # when tests are not run
  ++ lib.optional doInstallCheck cmocka;
  ++ lib.optional finalAttrs.doInstallCheck cmocka;

  nativeInstallCheckInputs = lib.optionals doInstallCheck [
  nativeInstallCheckInputs = lib.optionals finalAttrs.doInstallCheck [
    cmocka
    which
    openssl
@@ -107,7 +107,7 @@ stdenv.mkDerivation rec {
    substituteInPlace ./test/unit/tctildr-dl.c \
      --replace-fail '@PREFIX@' $out/lib/
    substituteInPlace ./bootstrap \
      --replace-fail 'git describe --tags --always --dirty' 'echo "${version}"'
      --replace-fail 'git describe --tags --always --dirty' 'echo "${finalAttrs.version}"'
    for src in src/tss2-tcti/tcti-libtpms.c test/unit/tcti-libtpms.c; do
      substituteInPlace "$src" \
        --replace-fail '"libtpms.so"' '"${libtpms.out}/lib/libtpms.so"' \
@@ -125,7 +125,7 @@ stdenv.mkDerivation rec {
  '';

  configureFlags =
    lib.optionals doInstallCheck [
    lib.optionals finalAttrs.doInstallCheck [
      "--enable-unit"
      "--enable-integration"
    ]
@@ -163,4 +163,4 @@ stdenv.mkDerivation rec {
    platforms = platforms.unix;
    maintainers = with maintainers; [ baloo ];
  };
}
})