2022-05-11 01:05:27 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, testers, flyctl }:
|
2020-03-08 22:30:29 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "flyctl";
|
2022-06-25 21:05:11 +00:00
|
|
|
version = "0.0.335";
|
2020-03-08 22:30:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "superfly";
|
|
|
|
repo = "flyctl";
|
|
|
|
rev = "v${version}";
|
2022-06-25 21:05:11 +00:00
|
|
|
sha256 = "sha256-da7fKtByg3zwtRmsObs5SV6E9bVBe9KyVzn1eE3PcV8=";
|
2020-03-08 22:30:29 +00:00
|
|
|
};
|
|
|
|
|
2022-06-25 21:05:11 +00:00
|
|
|
vendorSha256 = "sha256-Hn4uB9HYHVS3p9zBpOzOiyTHMmjN8YmVxHZAj1V7y2I=";
|
2020-03-08 22:30:29 +00:00
|
|
|
|
2020-05-19 09:20:00 +00:00
|
|
|
subPackages = [ "." ];
|
2020-03-08 22:30:29 +00:00
|
|
|
|
2022-04-17 15:37:19 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
2022-05-06 15:18:41 +00:00
|
|
|
"-X github.com/superfly/flyctl/internal/buildinfo.commit=${src.rev}"
|
2022-05-09 21:02:34 +00:00
|
|
|
"-X github.com/superfly/flyctl/internal/buildinfo.buildDate=1970-01-01T00:00:00Z"
|
2022-05-06 15:18:41 +00:00
|
|
|
"-X github.com/superfly/flyctl/internal/buildinfo.environment=production"
|
|
|
|
"-X github.com/superfly/flyctl/internal/buildinfo.version=${version}"
|
2022-04-17 15:37:19 +00:00
|
|
|
];
|
2020-03-08 22:30:29 +00:00
|
|
|
|
2022-04-17 15:37:19 +00:00
|
|
|
preBuild = ''
|
|
|
|
go generate ./...
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$(mktemp -d)
|
|
|
|
'';
|
2020-08-04 00:26:27 +00:00
|
|
|
|
2022-04-17 15:37:19 +00:00
|
|
|
postCheck = ''
|
2022-05-11 01:05:27 +00:00
|
|
|
go test ./... -ldflags="-X 'github.com/superfly/flyctl/internal/buildinfo.buildDate=1970-01-01T00:00:00Z'"
|
2022-04-17 15:37:19 +00:00
|
|
|
'';
|
2020-05-19 09:20:00 +00:00
|
|
|
|
2022-05-11 01:05:27 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = flyctl;
|
|
|
|
command = "HOME=$(mktemp -d) flyctl version";
|
|
|
|
version = "v${flyctl.version}";
|
|
|
|
};
|
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = with lib; {
|
2020-03-08 22:30:29 +00:00
|
|
|
description = "Command line tools for fly.io services";
|
2022-04-17 15:37:19 +00:00
|
|
|
downloadPage = "https://github.com/superfly/flyctl";
|
2020-03-08 22:30:29 +00:00
|
|
|
homepage = "https://fly.io/";
|
|
|
|
license = licenses.asl20;
|
2022-05-09 21:02:34 +00:00
|
|
|
maintainers = with maintainers; [ aaronjanse jsierles techknowlogick ];
|
2020-03-08 22:30:29 +00:00
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|