From e55fda1ae7f9127a44a4d7c7a5151e286601cde7 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Mon, 10 Mar 2025 01:14:00 +0100 Subject: [PATCH 1/2] tboot: fix build for gcc 14 --- pkgs/by-name/tb/tboot/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/tb/tboot/package.nix b/pkgs/by-name/tb/tboot/package.nix index a553c9d7ca7d..c7425eaaa18a 100644 --- a/pkgs/by-name/tb/tboot/package.nix +++ b/pkgs/by-name/tb/tboot/package.nix @@ -34,6 +34,13 @@ stdenv.mkDerivation rec { substituteInPlace docs/Makefile --replace /usr/share /share ''; + postPatch = '' + # compute the allocated size from the pointed type, to avoid the warning + substituteInPlace lcptools-v2/pconf_legacy.c \ + --replace-fail "digest = malloc(SHA1_DIGEST_SIZE);" \ + "digest = malloc(sizeof *digest);" + ''; + installFlags = [ "DESTDIR=$(out)" ]; meta = with lib; { From ce42dd32695a2e7b59d2a3a2368f4660939f04f2 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Mon, 10 Mar 2025 01:15:00 +0100 Subject: [PATCH 2/2] tboot: refactor --- pkgs/by-name/tb/tboot/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/tb/tboot/package.nix b/pkgs/by-name/tb/tboot/package.nix index c7425eaaa18a..f26ab8c154a0 100644 --- a/pkgs/by-name/tb/tboot/package.nix +++ b/pkgs/by-name/tb/tboot/package.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://sourceforge/tboot/${pname}-${version}.tar.gz"; - sha256 = "sha256-TIs/xLxLBkKBN0a0CRB2KMmCq8QgICH1++i485WDU3A="; + hash = "sha256-TIs/xLxLBkKBN0a0CRB2KMmCq8QgICH1++i485WDU3A="; }; buildInputs = [ @@ -43,12 +43,12 @@ stdenv.mkDerivation rec { installFlags = [ "DESTDIR=$(out)" ]; - meta = with lib; { + meta = { description = "Pre-kernel/VMM module that uses Intel(R) TXT to perform a measured and verified launch of an OS kernel/VMM"; homepage = "https://sourceforge.net/projects/tboot/"; changelog = "https://sourceforge.net/p/tboot/code/ci/v${version}/tree/CHANGELOG"; - license = licenses.bsd3; - maintainers = with maintainers; [ ak ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ ak ]; platforms = [ "x86_64-linux" "i686-linux"