2022-01-25 03:21:06 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
let
|
|
|
|
# A list of binaries to put into separate outputs
|
|
|
|
bins = [
|
|
|
|
"geth"
|
2021-06-28 23:13:55 +00:00
|
|
|
"clef"
|
2021-02-24 18:30:23 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
in buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "go-ethereum";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "1.10.26";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-eefQEOeKb6gZIJdK9cq20WnhwZE1qbyd8Cl0Hqh2+u8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
vendorSha256 = "sha256-Dj+xN8lr98LJyYr2FwJ7yUIJkUeUrr1fkcbj4hShJI0=";
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
outputs = [ "out" ] ++ bins;
|
|
|
|
|
|
|
|
# Move binaries to separate outputs and symlink them back to $out
|
|
|
|
postInstall = lib.concatStringsSep "\n" (
|
|
|
|
builtins.map (bin: "mkdir -p \$${bin}/bin && mv $out/bin/${bin} \$${bin}/bin/ && ln -s \$${bin}/bin/${bin} $out/bin/") bins
|
|
|
|
);
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [
|
|
|
|
"cmd/abidump"
|
|
|
|
"cmd/abigen"
|
|
|
|
"cmd/bootnode"
|
|
|
|
"cmd/checkpoint-admin"
|
|
|
|
"cmd/clef"
|
|
|
|
"cmd/devp2p"
|
|
|
|
"cmd/ethkey"
|
|
|
|
"cmd/evm"
|
|
|
|
"cmd/faucet"
|
|
|
|
"cmd/geth"
|
|
|
|
"cmd/p2psim"
|
|
|
|
"cmd/puppeth"
|
|
|
|
"cmd/rlpdump"
|
|
|
|
"cmd/utils"
|
|
|
|
];
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
# Following upstream: https://github.com/ethereum/go-ethereum/blob/v1.10.26/build/ci.go#L218
|
2022-09-09 14:08:57 +00:00
|
|
|
tags = [ "urfave_cli_no_docs" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Fix for usb-related segmentation faults on darwin
|
|
|
|
propagatedBuildInputs =
|
2021-01-17 00:15:33 +00:00
|
|
|
lib.optionals stdenv.isDarwin [ libobjc IOKit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) geth; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://geth.ethereum.org/";
|
|
|
|
description = "Official golang implementation of the Ethereum protocol";
|
2021-02-24 18:30:23 +00:00
|
|
|
license = with licenses; [ lgpl3Plus gpl3Plus ];
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ adisbladis RaghavSood ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|