git.iko.soy/typeable/nixpkgs
on master help sign in
solc: add darwin binary for now
commitfb60c5e7b3273d165ff682be81265b3ef301dee2 authorhappysalada <raphael@megzari.com> dateMon 2 May 2022, 22:24 (5 years ago) parent67f6146
1 file changed+28−8
pkgs/development/compilers/solc/default.nix+28−8
pkgs/development/compilers/solc/default.nix+28−8
@@ -1,4 +1,5 @@
11{ lib, gccStdenv, fetchzip
2+, pkgs
23, boost
34, cmake
45, coreutils
@@ -41,9 +42,17 @@ let
4142 sha256 = "1mnvxqsan034d2jiqnw2yvkljl7lwvhakmj5bscwp1fpkn655bbw";
4243 };
4344
44− solc = gccStdenv.mkDerivation rec {
45− pname = "solc";
46− version = "0.8.13";
45+ pname = "solc";
46+ version = "0.8.13";
47+ meta = with lib; {
48+ description = "Compiler for Ethereum smart contract language Solidity";
49+ homepage = "https://github.com/ethereum/solidity";
50+ license = licenses.gpl3;
51+ maintainers = with maintainers; [ dbrock akru lionello sifmelcara ];
52+ };
53+
54+ solc = if gccStdenv.isLinux then gccStdenv.mkDerivation rec {
55+ inherit pname version meta;
4756
4857 # upstream suggests avoid using archive generated by github
4958 src = fetchzip {
@@ -105,13 +114,24 @@ let
105114 passthru.tests = {
106115 solcWithTests = solc.overrideAttrs (attrs: { doCheck = true; });
107116 };
117+ } else gccStdenv.mkDerivation rec {
118+ inherit pname version meta;
108119
109− meta = with lib; {
110− description = "Compiler for Ethereum smart contract language Solidity";
111− homepage = "https://github.com/ethereum/solidity";
112− license = licenses.gpl3;
113− maintainers = with maintainers; [ dbrock akru lionello sifmelcara ];
120+ src = pkgs.fetchurl {
121+ url = "https://github.com/ethereum/solidity/releases/download/v${version}/solc-macos";
122+ sha256 = "sha256-FNTvAT6oKtlekf2Um3+nt4JxpIP/GnnEPWzFi4JvW+o=";
114123 };
124+ dontUnpack = true;
125+
126+ installPhase = ''
127+ runHook preInstall
128+
129+ mkdir -p $out/bin
130+ cp ${src} $out/bin/solc
131+ chmod +x $out/bin/solc
132+
133+ runHook postInstall
134+ '';
115135 };
116136in
117137 solc