Merge pull request #288000 from trofi/timeloop-gcc-13-fix

timeloop: unstable-2022-11-29 -> 3.0.3, fix `gcc-13` build failure
This commit is contained in:
Mario Rodas 2024-02-17 07:19:06 -05:00 committed by GitHub
commit 99b92cf3e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,13 +15,13 @@
stdenv.mkDerivation rec {
pname = "timeloop";
version = "unstable-2022-11-29";
version = "3.0.3";
src = fetchFromGitHub {
owner = "NVlabs";
repo = "timeloop";
rev = "905ba953432c812772de935d57fd0a674a89d3c1";
hash = "sha256-EXiWXf8hdX4vFRNk9wbFSOsix/zVkwrafGUtFrsoAN0=";
rev = "v${version}";
hash = "sha256-CGPhrBNzFdERAA/Eym2v0+FvFUe+VkBLnwYEqEMHE9k=";
};
nativeBuildInputs = [ scons ];
@ -46,10 +46,14 @@ stdenv.mkDerivation rec {
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto";
postPatch = ''
# Fix gcc-13 build failure due to missing includes:
sed -e '1i #include <cstdint>' -i \
include/compound-config/compound-config.hpp
# use nix ar/ranlib
substituteInPlace ./SConstruct \
--replace "env.Replace(AR = \"gcc-ar\")" "" \
--replace "env.Replace(RANLIB = \"gcc-ranlib\")" ""
--replace-fail "env.Replace(AR = \"gcc-ar\")" "pass" \
--replace-fail "env.Replace(RANLIB = \"gcc-ranlib\")" "pass"
'' + lib.optionalString stdenv.isDarwin ''
# prevent clang from dying on errors that gcc is fine with
substituteInPlace ./src/SConscript --replace "-Werror" "-Wno-inconsistent-missing-override"