From d7a2b461131aa04e94d17acdbe8ccdb1115442c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20He=C3=9Felmann?= Date: Thu, 26 Jan 2023 21:01:52 +0100 Subject: [PATCH] openshift: 4.11 -> 4.12 --- .../networking/cluster/openshift/default.nix | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index 9933e8056670..705b10753ca4 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -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 {