2022-05-18 14:49:53 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, testers, flyctl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "flyctl";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.0.330";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "superfly";
|
|
|
|
repo = "flyctl";
|
|
|
|
rev = "v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-lgyr2NgurOZPqJv8ZUD8ut7ELxMZqLZ+rXYTjZauv8Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
vendorSha256 = "sha256-T1E2VJiaGKhk/rDVKYEju3AyDPEUMGFNvj/KrMjLKEc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
subPackages = [ "." ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
2022-05-18 14:49:53 +00:00
|
|
|
"-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}"
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
preBuild = ''
|
|
|
|
go generate ./...
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$(mktemp -d)
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postCheck = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
go test ./... -ldflags="-X 'github.com/superfly/flyctl/internal/buildinfo.buildDate=1970-01-01T00:00:00Z'"
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = flyctl;
|
|
|
|
command = "HOME=$(mktemp -d) flyctl version";
|
|
|
|
version = "v${flyctl.version}";
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line tools for fly.io services";
|
2022-04-27 09:35:20 +00:00
|
|
|
downloadPage = "https://github.com/superfly/flyctl";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://fly.io/";
|
|
|
|
license = licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ aaronjanse jsierles techknowlogick ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|