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";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.11.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-mZ11xan3MGgaUORbiQczKrXSrxzjvQMhZbpHnEal11Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
vendorHash = "sha256-rjSGR2ie5sFK2OOo4HUZ6+hrDlQuUDtyTKn0sh8jFBY=";
|
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/rlpdump"
|
|
|
|
"cmd/utils"
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# Following upstream: https://github.com/ethereum/go-ethereum/blob/v1.11.6/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
|
|
|
};
|
|
|
|
}
|