depot/third_party/nixpkgs/pkgs/development/web/flyctl/default.nix
Default email 889482aab3 Project import generated by Copybara.
GitOrigin-RevId: f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5
2022-06-26 12:26:21 +02:00

51 lines
1.4 KiB
Nix

{ buildGoModule, fetchFromGitHub, lib, testers, flyctl }:
buildGoModule rec {
pname = "flyctl";
version = "0.0.335";
src = fetchFromGitHub {
owner = "superfly";
repo = "flyctl";
rev = "v${version}";
sha256 = "sha256-da7fKtByg3zwtRmsObs5SV6E9bVBe9KyVzn1eE3PcV8=";
};
vendorSha256 = "sha256-Hn4uB9HYHVS3p9zBpOzOiyTHMmjN8YmVxHZAj1V7y2I=";
subPackages = [ "." ];
ldflags = [
"-s" "-w"
"-X github.com/superfly/flyctl/internal/buildinfo.commit=${src.rev}"
"-X github.com/superfly/flyctl/internal/buildinfo.buildDate=1970-01-01T00:00:00Z"
"-X github.com/superfly/flyctl/internal/buildinfo.environment=production"
"-X github.com/superfly/flyctl/internal/buildinfo.version=${version}"
];
preBuild = ''
go generate ./...
'';
preCheck = ''
HOME=$(mktemp -d)
'';
postCheck = ''
go test ./... -ldflags="-X 'github.com/superfly/flyctl/internal/buildinfo.buildDate=1970-01-01T00:00:00Z'"
'';
passthru.tests.version = testers.testVersion {
package = flyctl;
command = "HOME=$(mktemp -d) flyctl version";
version = "v${flyctl.version}";
};
meta = with lib; {
description = "Command line tools for fly.io services";
downloadPage = "https://github.com/superfly/flyctl";
homepage = "https://fly.io/";
license = licenses.asl20;
maintainers = with maintainers; [ aaronjanse jsierles techknowlogick ];
};
}