solc: 0.8.21 -> 0.8.28; fix build (#369643)

This commit is contained in:
Pol Dellaiera
2024-12-31 16:09:51 +01:00
committed by GitHub
+44 -36
View File
@@ -9,6 +9,7 @@
jq,
ncurses,
python3,
versionCheckHook,
z3Support ? true,
z3_4_11 ? null,
cvc4Support ? gccStdenv.hostPlatform.isLinux,
@@ -27,34 +28,24 @@ assert z3Support -> z3 != null && lib.versionAtLeast z3.version "4.11.0";
assert cvc4Support -> cvc4 != null && cln != null && gmp != null;
let
jsoncppVersion = "1.9.3";
jsoncppUrl = "https://github.com/open-source-parsers/jsoncpp/archive/${jsoncppVersion}.tar.gz";
jsoncpp = fetchzip {
url = jsoncppUrl;
sha256 = "1vbhi503rgwarf275ajfdb8vpdcbn1f7917wjkf8jghqwb1c24lq";
};
range3Version = "0.12.0";
range3Url = "https://github.com/ericniebler/range-v3/archive/${range3Version}.tar.gz";
range3 = fetchzip {
url = range3Url;
sha256 = "sha256-bRSX91+ROqG1C3nB9HSQaKgLzOHEFy9mrD2WW3PRBWU=";
};
fmtlibVersion = "8.0.1";
fmtlibUrl = "https://github.com/fmtlib/fmt/archive/${fmtlibVersion}.tar.gz";
fmtlib = fetchzip {
url = fmtlibUrl;
sha256 = "1mnvxqsan034d2jiqnw2yvkljl7lwvhakmj5bscwp1fpkn655bbw";
};
pname = "solc";
version = "0.8.21";
meta = with lib; {
version = "0.8.28";
linuxHash = "sha256-kosJ10stylGK5NUtsnMM7I+OfhR40TXPQDvnggOFLLc=";
darwinHash = "sha256-gVFbDlPeqiZtVJVFzKrApalubU6CAcd/ZzsscQl22eo=";
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;
meta = {
description = "Compiler for Ethereum smart contract language Solidity";
homepage = "https://github.com/ethereum/solidity";
license = licenses.gpl3;
maintainers = with maintainers; [
changelog = "https://github.com/ethereum/solidity/releases/tag/v${version}";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [
dbrock
akru
lionello
@@ -65,21 +56,28 @@ let
solc =
if gccStdenv.hostPlatform.isLinux then
gccStdenv.mkDerivation rec {
inherit pname version meta;
inherit
pname
version
nativeInstallCheckInputs
versionCheckProgramArg
doInstallCheck
meta
;
# upstream suggests avoid using archive generated by github
src = fetchzip {
url = "https://github.com/ethereum/solidity/releases/download/v${version}/solidity_${version}.tar.gz";
sha256 = "sha256-6EeRmxAmb1nCQ2FTNtWfQ7HCH0g9nJXC3jnhV0KEOwk=";
hash = linuxHash;
};
# Fix build with GCC 14
# Submitted upstream: https://github.com/ethereum/solidity/pull/15685
postPatch = ''
substituteInPlace cmake/jsoncpp.cmake \
--replace "${jsoncppUrl}" ${jsoncpp}
substituteInPlace cmake/range-v3.cmake \
--replace "${range3Url}" ${range3}
substituteInPlace cmake/fmtlib.cmake \
--replace "${fmtlibUrl}" ${fmtlib}
substituteInPlace test/yulPhaser/Chromosome.cpp \
--replace-fail \
"BOOST_TEST(abs" \
"BOOST_TEST(fabs"
'';
cmakeFlags =
@@ -143,9 +141,12 @@ let
popd
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/solc --version > /dev/null
runHook postInstallCheck
'';
passthru.tests = {
@@ -156,11 +157,18 @@ let
}
else
gccStdenv.mkDerivation rec {
inherit pname version meta;
inherit
pname
version
nativeInstallCheckInputs
versionCheckProgramArg
doInstallCheck
meta
;
src = pkgs.fetchurl {
url = "https://github.com/ethereum/solidity/releases/download/v${version}/solc-macos";
sha256 = "sha256-GdBldJ+wjL/097RShKxVhTBjhl9q6GIeTe+l2Ti5pQI=";
hash = darwinHash;
};
dontUnpack = true;