blob: e25092409c6f1e36445adb8a95d965251d7ea35e (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
{ lib, fetchFromGitHub, buildGoModule, installShellFiles, symlinkJoin, stdenv }:
let
metaCommon = with lib; {
description = "Command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal";
homepage = "https://docs.temporal.io/cli";
license = licenses.mit;
maintainers = with maintainers; [ aaronjheng ];
};
overrideModAttrs = old: {
# https://gitlab.com/cznic/libc/-/merge_requests/10
postBuild = ''
patch -p0 < ${./darwin-sandbox-fix.patch}
'';
};
tctl-next = buildGoModule rec {
pname = "tctl-next";
version = "0.13.1";
src = fetchFromGitHub {
owner = "temporalio";
repo = "cli";
rev = "v${version}";
hash = "sha256-bh0UsXA5yHtvP9femOwEzVzmu1VLz2uZwoIHL/kI7kM=";
};
vendorHash = "sha256-ziCJG722c32QAh9QmoC2E7TcLiC2InKwfdC9mkanTsU=";
inherit overrideModAttrs;
nativeBuildInputs = [ installShellFiles ];
excludedPackages = [ "./cmd/docgen" "./tests" ];
ldflags = [
"-s"
"-w"
"-X github.com/temporalio/cli/headers.Version=${version}"
];
# Tests fail with x86 on macOS Rosetta 2
doCheck = !(stdenv.isDarwin && stdenv.hostPlatform.isx86_64);
preCheck = ''
export HOME="$(mktemp -d)"
'';
postInstall = ''
installShellCompletion --cmd temporal \
--bash <($out/bin/temporal completion bash) \
--fish <($out/bin/temporal completion fish) \
--zsh <($out/bin/temporal completion zsh)
'';
__darwinAllowLocalNetworking = true;
meta = metaCommon // {
mainProgram = "temporal";
};
};
tctl = buildGoModule rec {
pname = "tctl";
version = "1.18.1";
src = fetchFromGitHub {
owner = "temporalio";
repo = "tctl";
rev = "v${version}";
hash = "sha256-LX4hyPme+mkNmPvrTHIT5Ow3QM8BTAB7MXSY1fa8tSk=";
};
vendorHash = "sha256-294lnUKnXNrN6fJ+98ub7LwsJ9aT+FzWCB3nryfAlCI=";
inherit overrideModAttrs;
nativeBuildInputs = [ installShellFiles ];
excludedPackages = [ "./cmd/copyright" ];
ldflags = [ "-s" "-w" ];
preCheck = ''
export HOME="$(mktemp -d)"
'';
postInstall = ''
installShellCompletion --cmd tctl \
--bash <($out/bin/tctl completion bash) \
--zsh <($out/bin/tctl completion zsh)
'';
__darwinAllowLocalNetworking = true;
meta = metaCommon // {
mainProgram = "tctl";
};
};
in
symlinkJoin rec {
pname = "temporal-cli";
inherit (tctl) version;
name = "${pname}-${version}";
paths = [
tctl-next
tctl
];
passthru = { inherit tctl tctl-next; };
meta = metaCommon // {
mainProgram = "temporal";
platforms = lib.unique (lib.concatMap (drv: drv.meta.platforms) paths);
};
}
|