blob: 714cab494f70a550de0f7724dc8506eca4bcb12c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{ buildGoModule, fetchFromGitHub, lib, testers, flyctl }:
buildGoModule rec {
pname = "flyctl";
version = "0.0.323";
src = fetchFromGitHub {
owner = "superfly";
repo = "flyctl";
rev = "v${version}";
sha256 = "sha256-7mPZ4p7fb49Lc+sx7/jEw+oFdFaYtEJcSzFS5haC6NM=";
};
vendorSha256 = "sha256-dTeFeDdT44k1HxIEuvTU/A8xAa1VhVv4ZFbvg1PagPw=";
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 ];
};
}
|