Unverified Commit 03fd9a32 authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

tboot: fix build with gcc 14, refactor (#388574)

parents 3601ee9c ce42dd32
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -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 = [
@@ -34,14 +34,21 @@ 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; {
  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"