From fb60c5e7b3273d165ff682be81265b3ef301dee2 Mon Sep 17 00:00:00 2001 From: happysalada Date: Mon, 2 May 2022 22:24:02 -0400 Subject: solc: add darwin binary for now --- pkgs/development/compilers/solc/default.nix | 36 ++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/solc/default.nix b/pkgs/development/compilers/solc/default.nix index 9ad3cf77dc4d3..6594872a258f7 100644 --- a/pkgs/development/compilers/solc/default.nix +++ b/pkgs/development/compilers/solc/default.nix @@ -1,4 +1,5 @@ { lib, gccStdenv, fetchzip +, pkgs , boost , cmake , coreutils @@ -41,9 +42,17 @@ let sha256 = "1mnvxqsan034d2jiqnw2yvkljl7lwvhakmj5bscwp1fpkn655bbw"; }; - solc = gccStdenv.mkDerivation rec { - pname = "solc"; - version = "0.8.13"; + pname = "solc"; + version = "0.8.13"; + meta = with lib; { + description = "Compiler for Ethereum smart contract language Solidity"; + homepage = "https://github.com/ethereum/solidity"; + license = licenses.gpl3; + maintainers = with maintainers; [ dbrock akru lionello sifmelcara ]; + }; + + solc = if gccStdenv.isLinux then gccStdenv.mkDerivation rec { + inherit pname version meta; # upstream suggests avoid using archive generated by github src = fetchzip { @@ -105,13 +114,24 @@ let passthru.tests = { solcWithTests = solc.overrideAttrs (attrs: { doCheck = true; }); }; + } else gccStdenv.mkDerivation rec { + inherit pname version meta; - meta = with lib; { - description = "Compiler for Ethereum smart contract language Solidity"; - homepage = "https://github.com/ethereum/solidity"; - license = licenses.gpl3; - maintainers = with maintainers; [ dbrock akru lionello sifmelcara ]; + src = pkgs.fetchurl { + url = "https://github.com/ethereum/solidity/releases/download/v${version}/solc-macos"; + sha256 = "sha256-FNTvAT6oKtlekf2Um3+nt4JxpIP/GnnEPWzFi4JvW+o="; }; + dontUnpack = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp ${src} $out/bin/solc + chmod +x $out/bin/solc + + runHook postInstall + ''; }; in solc -- cgit 1.4.1