blob: dceb843ac72b7e5290d6e8819d9abd6e5d8780d2 (
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
|
{ lib
, buildGoModule
, fetchFromGitHub
, makeWrapper
, git
, go
, gnumake
, installShellFiles
, testers
, kubebuilder
}:
buildGoModule rec {
pname = "kubebuilder";
version = "4.1.0";
src = fetchFromGitHub {
owner = "kubernetes-sigs";
repo = "kubebuilder";
rev = "v${version}";
hash = "sha256-CaDGl8+gIbcUH+bxqye+XEFO7ZwFE7NGZmyrqn7vzTk=";
};
vendorHash = "sha256-8f37IPO9PsYA/oHCtIjVrUgOTkXzkHv4cGTy5bUQP8s=";
subPackages = ["cmd"];
allowGoReference = true;
ldflags = [
"-X main.kubeBuilderVersion=v${version}"
"-X main.goos=${go.GOOS}"
"-X main.goarch=${go.GOARCH}"
"-X main.gitCommit=unknown"
"-X main.buildDate=unknown"
];
nativeBuildInputs = [
makeWrapper
git
installShellFiles
];
postInstall = ''
mv $out/bin/cmd $out/bin/kubebuilder
wrapProgram $out/bin/kubebuilder \
--prefix PATH : ${lib.makeBinPath [ go gnumake ]}
installShellCompletion --cmd kubebuilder \
--bash <($out/bin/kubebuilder completion bash) \
--fish <($out/bin/kubebuilder completion fish) \
--zsh <($out/bin/kubebuilder completion zsh)
'';
passthru.tests.version = testers.testVersion {
command = "${kubebuilder}/bin/kubebuilder version";
package = kubebuilder;
version = "v${version}";
};
meta = {
description = "SDK for building Kubernetes APIs using CRDs";
mainProgram = "kubebuilder";
homepage = "https://github.com/kubernetes-sigs/kubebuilder";
changelog = "https://github.com/kubernetes-sigs/kubebuilder/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ cmars ];
};
}
|