openshift: 4.11 -> 4.12

This commit is contained in:
Stephan Heßelmann 2023-01-26 21:01:52 +01:00
parent f95a56cc16
commit d7a2b46113

View file

@ -1,55 +1,52 @@
{ lib
, buildGoModule
, fetchFromGitHub
, libkrb5
, git
, gpgme
, installShellFiles
, testers
, openshift
}:
buildGoModule rec {
pname = "openshift";
version = "4.11.0";
gitCommit = "20dd77d5";
version = "4.12.0";
gitCommit = "854f807";
src = fetchFromGitHub {
owner = "openshift";
repo = "oc";
rev = "20dd77d5c889f86b05e2bdd182853ae702852c63";
sha256 = "wqLo/CKGzeMDJUoI9PUEjJER5hSPu+FmUCJLPZ9PJuw=";
rev = "854f807d8a84dde710c062a5281bca5bc07cb562";
hash = "sha256-GH3LjAeMIHmFbJoKGoeeNteP4Ma2+kIC5rAxObdziKg=";
};
vendorSha256 = null;
vendorHash = null;
buildInputs = [ libkrb5 ];
buildInputs = [ gpgme ];
nativeBuildInputs = [ installShellFiles ];
patchPhase = ''
patchShebangs ./hack
'';
ldflags = [
"-s"
"-w"
"-X github.com/openshift/oc/pkg/version.commitFromGit=${gitCommit}"
"-X github.com/openshift/oc/pkg/version.versionFromGit=v${version}"
];
buildPhase = ''
# Openshift build require this variables to be set
# unless there is a .git folder which is not the case with fetchFromGitHub
export SOURCE_GIT_COMMIT=${gitCommit}
export SOURCE_GIT_TAG=v${version}
export SOURCE_GIT_TREE_STATE=clean
make all
'';
installPhase = ''
mkdir -p $out/bin
cp oc $out/bin
doCheck = false;
postInstall = ''
# Install man pages.
mkdir -p man
./genman man oc
$out/bin/genman man oc
installManPage man/*.1
installShellCompletion --bash contrib/completions/bash/*
installShellCompletion --zsh contrib/completions/zsh/*
# Remove unwanted tooling.
rm $out/bin/clicheck $out/bin/gendocs $out/bin/genman
# Install shell completions.
installShellCompletion --cmd oc \
--bash <($out/bin/oc completion bash) \
--fish <($out/bin/oc completion fish) \
--zsh <($out/bin/oc completion zsh)
'';
passthru.tests.version = testers.testVersion {