diff options
author | happysalada <raphael@megzari.com> | 2022-05-02 22:24:02 -0400 |
---|---|---|
committer | Yt <raphael@megzari.com> | 2022-05-03 07:58:58 -0400 |
commit | fb60c5e7b3273d165ff682be81265b3ef301dee2 (patch) | |
tree | e50491ea0e23cfabd4812ca2c72205d686adffcc /pkgs/development/compilers/solc | |
parent | 67f614650047eae778594fa83535b274c8ca8e09 (diff) |
solc: add darwin binary for now
Diffstat (limited to 'pkgs/development/compilers/solc')
-rw-r--r-- | pkgs/development/compilers/solc/default.nix | 36 |
1 files changed, 28 insertions, 8 deletions
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 |