2023-02-02 18:25:31 +00:00
|
|
|
{ IOKit
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "avalanchego";
|
2023-03-30 22:05:00 +00:00
|
|
|
version = "1.9.16";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ava-labs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-30 22:05:00 +00:00
|
|
|
hash = "sha256-xskLRQLjLSXXHK39h7e8knP5OtIbcllF7OvefPpIQCU=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
vendorHash = "sha256-lyXP1mkJmHpHHMtH0rXa0orf5u+AbZ4H/MJXt8o49ng=";
|
2023-02-02 18:25:31 +00:00
|
|
|
# go mod vendor has a bug, see: https://github.com/golang/go/issues/57529
|
|
|
|
proxyVendor = true;
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ IOKit ];
|
|
|
|
|
|
|
|
subPackages = [ "main" ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/ava-labs/avalanchego/version.GitCommit=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/{main,${pname}}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Go implementation of an Avalanche node";
|
|
|
|
homepage = "https://github.com/ava-labs/avalanchego";
|
|
|
|
changelog = "https://github.com/ava-labs/avalanchego/releases/tag/v${version}";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ urandom ];
|
|
|
|
};
|
|
|
|
}
|