commit 0f57a338dcf619ffb5c6a6ebcdd7817c07b13840
parent 33e865032ef7ab5fcc6b88db3645e866b0ddef57
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 18 Feb 2022 15:15:58 +0100
nix/packages: init tkn-pac at 0.5.2
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/nix/packages/default.nix b/nix/packages/default.nix
@@ -106,6 +106,10 @@ rec {
tkn_0_22
tkn
;
+ inherit (pkgs.callPackage ./tkn/tkn-pac.nix { })
+ tkn-pac_0_5
+ tkn-pac
+ ;
manifest-tool = pkgs.callPackage ./manifest-tool { };
# Upstream
diff --git a/nix/packages/tkn/tkn-pac.nix b/nix/packages/tkn/tkn-pac.nix
@@ -0,0 +1,52 @@
+{ stdenv, lib, buildGoModule, fetchFromGitHub }:
+
+with lib;
+rec {
+ tknPacGen = { version, sha256 }:
+ buildGoModule rec {
+ pname = "tkn";
+ name = "${pname}-${version}";
+
+ subPackages = [ "cmd/tkn-pac" ];
+ ldflags = [
+ "-s"
+ "-w"
+ "-X github.com/openshift-pipelines/pipelines-as-code/pkg/params/version.Version=${version}"
+ ];
+ src = fetchFromGitHub {
+ owner = "openshift-pipelines";
+ repo = "pipelines-as-code";
+ rev = "${version}";
+ sha256 = "${sha256}";
+ };
+ vendorSha256 = null;
+ doCheck = false;
+
+ postInstall = ''
+ # manpages
+ manRoot="$out/share/man"
+ mkdir -p "$manRoot/man1"
+ for manFile in docs/man/man1/*; do
+ manName="$(basename "$manFile")" # "docker-build.1"
+ gzip -c "$manFile" > "$manRoot/man1/$manName.gz"
+ done
+ # completions
+ mkdir -p $out/share/bash-completion/completions/
+ $out/bin/tkn-pac completion bash > $out/share/bash-completion/completions/tkn
+ mkdir -p $out/share/zsh/site-functions
+ $out/bin/tkn-pac completion zsh > $out/share/zsh/site-functions/_tkn
+ '';
+ meta = with lib; {
+ homepage = https://github.com/tektoncd/cli;
+ description = "A CLI for interacting with Tekton!";
+ license = licenses.asl20;
+ maintainers = with maintainers; [ vdemeester ];
+ };
+ };
+
+ tkn-pac = tkn-pac_0_5;
+ tkn-pac_0_5 = makeOverridable tknPacGen {
+ version = "0.5.2";
+ sha256 = "sha256-/FeKujkzpgxxNvlW9issfi/dLrSFH/JQcjaEVYAagIc=";
+ };
+}