depot/third_party/nixpkgs/pkgs/applications/networking/avalanchego/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

45 lines
1 KiB
Nix

{ IOKit
, buildGoModule
, fetchFromGitHub
, lib
, stdenv
}:
buildGoModule rec {
pname = "avalanchego";
version = "1.11.6";
src = fetchFromGitHub {
owner = "ava-labs";
repo = pname;
rev = "v${version}";
hash = "sha256-XEFmcdkuCA8a6rCwh9G01gs1uAkNbv0CxHbXWTzrrKg=";
};
vendorHash = "sha256-odqP5FtQ5F7EMrDN9tL0M8sJR6WdzAJZZcOky8IRuOE=";
# 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";
};
}