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"
|
|
|
|
];
|
|
|
|
|
|
|
|
in buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "go-ethereum";
|
2021-03-12 07:09:13 +00:00
|
|
|
version = "1.10.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-03-12 07:09:13 +00:00
|
|
|
sha256 = "sha256-4lHT0P8Euau0AJNtg1YstJJRQ58WTUlIH+HCKEjCq/s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
runVend = true;
|
2021-03-09 03:18:52 +00:00
|
|
|
vendorSha256 = "sha256-DgyOvplk1JWn6D/z4zbXHLNLuAVQ5beEHi0NuSv236A=";
|
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
|
|
|
};
|
|
|
|
}
|