2022-03-30 21:10:11 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libkrb5
|
|
|
|
, git
|
|
|
|
, installShellFiles
|
2022-04-20 14:40:48 +00:00
|
|
|
, testers
|
2022-03-30 21:10:11 +00:00
|
|
|
, openshift
|
2018-03-31 15:22:27 +00:00
|
|
|
}:
|
|
|
|
|
2022-03-30 21:10:11 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "openshift";
|
2022-05-02 12:17:44 +00:00
|
|
|
version = "4.11.0";
|
|
|
|
gitCommit = "20dd77d5";
|
2015-07-07 09:54:45 +00:00
|
|
|
|
2016-09-24 23:57:35 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openshift";
|
2022-03-30 21:10:11 +00:00
|
|
|
repo = "oc";
|
2022-05-02 12:17:44 +00:00
|
|
|
rev = "20dd77d5c889f86b05e2bdd182853ae702852c63";
|
|
|
|
sha256 = "wqLo/CKGzeMDJUoI9PUEjJER5hSPu+FmUCJLPZ9PJuw=";
|
2018-12-20 17:45:54 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 21:10:11 +00:00
|
|
|
vendorSha256 = null;
|
2015-07-07 09:54:45 +00:00
|
|
|
|
2022-02-22 19:57:53 +00:00
|
|
|
buildInputs = [ libkrb5 ];
|
|
|
|
|
2022-03-30 21:10:11 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2015-07-07 09:54:45 +00:00
|
|
|
|
2016-09-24 23:57:35 +00:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs ./hack
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# Openshift build require this variables to be set
|
|
|
|
# unless there is a .git folder which is not the case with fetchFromGitHub
|
2022-03-30 21:10:11 +00:00
|
|
|
export SOURCE_GIT_COMMIT=${gitCommit}
|
|
|
|
export SOURCE_GIT_TAG=v${version}
|
|
|
|
export SOURCE_GIT_TREE_STATE=clean
|
|
|
|
|
|
|
|
make all
|
2016-09-24 23:57:35 +00:00
|
|
|
'';
|
2015-07-07 09:54:45 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-04-28 01:50:57 +00:00
|
|
|
mkdir -p $out/bin
|
2022-03-30 21:10:11 +00:00
|
|
|
cp oc $out/bin
|
|
|
|
|
|
|
|
mkdir -p man
|
|
|
|
./genman man oc
|
|
|
|
installManPage man/*.1
|
|
|
|
|
2020-04-27 00:10:25 +00:00
|
|
|
installShellCompletion --bash contrib/completions/bash/*
|
|
|
|
installShellCompletion --zsh contrib/completions/zsh/*
|
2017-04-30 21:16:33 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-20 14:40:48 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-03-30 21:10:11 +00:00
|
|
|
package = openshift;
|
|
|
|
command = "oc version";
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-07-07 09:54:45 +00:00
|
|
|
description = "Build, deploy, and manage your applications with Docker and Kubernetes";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.openshift.org";
|
2022-05-05 00:46:39 +00:00
|
|
|
license = licenses.asl20;
|
2022-03-30 21:10:11 +00:00
|
|
|
maintainers = with maintainers; [ offline bachp moretea stehessel ];
|
2022-05-05 00:46:39 +00:00
|
|
|
mainProgram = "oc";
|
2019-02-17 13:00:33 +00:00
|
|
|
platforms = platforms.unix;
|
2015-07-07 09:54:45 +00:00
|
|
|
};
|
|
|
|
}
|