2021-06-06 18:31:20 +00:00
|
|
|
{ lib
|
2022-02-04 12:16:47 +00:00
|
|
|
, buildGoModule
|
2021-06-06 18:31:20 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, git
|
2022-02-04 12:16:47 +00:00
|
|
|
, go
|
2021-11-03 07:55:11 +00:00
|
|
|
, gnumake
|
2021-06-06 18:31:20 +00:00
|
|
|
}:
|
|
|
|
|
2022-02-04 12:16:47 +00:00
|
|
|
buildGoModule rec {
|
2021-06-06 18:31:20 +00:00
|
|
|
pname = "kubebuilder";
|
2022-02-04 10:31:08 +00:00
|
|
|
version = "3.3.0";
|
2021-06-06 18:31:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kubernetes-sigs";
|
|
|
|
repo = "kubebuilder";
|
|
|
|
rev = "v${version}";
|
2022-02-04 10:31:08 +00:00
|
|
|
sha256 = "sha256-xLeS0vfYuLEdzuou67ViduaBf62+Yqk+scaCCK+Xetk=";
|
2021-06-06 18:31:20 +00:00
|
|
|
};
|
2022-02-04 10:31:08 +00:00
|
|
|
vendorSha256 = "sha256-zE/y9FAoUZBmWiUMWbc66CwkK0h7SEXzfZY3KkjtQ0A=";
|
2021-06-06 18:31:20 +00:00
|
|
|
|
2021-08-06 14:17:00 +00:00
|
|
|
subPackages = ["cmd"];
|
2021-06-06 18:31:20 +00:00
|
|
|
|
2021-08-20 07:12:13 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X main.kubeBuilderVersion=v${version}"
|
2022-02-04 12:16:47 +00:00
|
|
|
"-X main.goos=${go.GOOS}"
|
|
|
|
"-X main.goarch=${go.GOARCH}"
|
2021-08-20 07:12:13 +00:00
|
|
|
"-X main.gitCommit=v${version}"
|
|
|
|
"-X main.buildDate=v${version}"
|
|
|
|
];
|
2021-06-06 18:31:20 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/cmd $out/bin/kubebuilder
|
|
|
|
wrapProgram $out/bin/kubebuilder \
|
2022-02-04 12:16:47 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ go gnumake ]}
|
2021-06-06 18:31:20 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
allowGoReference = true;
|
|
|
|
nativeBuildInputs = [ makeWrapper git ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/kubernetes-sigs/kubebuilder";
|
|
|
|
description = "SDK for building Kubernetes APIs using CRDs";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ cmars ];
|
|
|
|
};
|
|
|
|
}
|