2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit }:
|
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";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "1.10.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-DRlIiO3iXUsQnmOf5T9uk3560tVbS+Hrs8QtVkmllAI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
runVend = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
vendorSha256 = "sha256-a/vY9iyqSM9QPs7lGFF6E7e2cMjIerVkNf5KwiWdyr0=";
|
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"
|
|
|
|
];
|
|
|
|
|
|
|
|
# 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
|
|
|
|
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 ];
|
2020-09-25 04:45:31 +00:00
|
|
|
maintainers = with maintainers; [ adisbladis lionello xrelkd RaghavSood ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|