From 7b01dd0370f6ad1b35d2197baad8ba99a33567b0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 8 Feb 2024 15:08:52 +0000 Subject: [PATCH] OVMF: fix buils against `openssl-3.0.13` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change the build fails on `staging-next` as https://hydra.nixos.org/build/248863953/nixlog/2/tail: /build/edk2-unvendored-src/CryptoPkg/Library/OpensslLib/openssl/crypto/property/property_parse.c:107:19: error: ‘INT64_MAX’ undeclared (first use in this function) 107 | if (v > ((INT64_MAX - (*s - '0')) / 10)) { | ^~~~~~~~~ The unbundled version of `openssl` `nixpkgs` injects into `edk2` started using `INT64_MAX` that `edk2`'s `` does not provide and relies on `openssl` to define as a fallback. Let's pull in `openssl`'s own definition of those. --- pkgs/development/compilers/edk2/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix index 70afb8ba714b..4cfe823e59d9 100644 --- a/pkgs/development/compilers/edk2/default.nix +++ b/pkgs/development/compilers/edk2/default.nix @@ -59,6 +59,11 @@ edk2 = stdenv.mkDerivation rec { mkdir -p $out/CryptoPkg/Library/OpensslLib/openssl tar --strip-components=1 -xf ${buildPackages.openssl.src} -C $out/CryptoPkg/Library/OpensslLib/openssl chmod -R +w $out/ + + # Fix missing INT64_MAX include that edk2 explicitly does not provide + # via it's own . Let's pull in openssl's definition instead: + sed -i $out/CryptoPkg/Library/OpensslLib/openssl/crypto/property/property_parse.c \ + -e '1i #include "internal/numbers.h"' ''; nativeBuildInputs = [ pythonEnv ];