depot/third_party/nixpkgs/pkgs/applications/networking/avalanchego/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

45 lines
1 KiB
Nix

{ IOKit
, buildGoModule
, fetchFromGitHub
, lib
, stdenv
}:
buildGoModule rec {
pname = "avalanchego";
version = "1.11.7";
src = fetchFromGitHub {
owner = "ava-labs";
repo = pname;
rev = "v${version}";
hash = "sha256-pdfZMKsNKmQVUfYobaOdUqGgP99fatEpgn0AHt0bIBQ=";
};
vendorHash = "sha256-CN+2+aOOPF7gouvp7lCfRIKA1quNCcrvzHg8lF6J4f8=";
# 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 qjoly ];
mainProgram = "avalanchego";
};
}