2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, buildGoPackage, which, go-bindata, rsync, util-linux
|
2020-04-29 01:16:20 +01:00
|
|
|
, coreutils, kerberos, ncurses, clang, installShellFiles
|
2018-03-31 16:22:27 +01:00
|
|
|
, components ? [
|
|
|
|
"cmd/oc"
|
|
|
|
"cmd/openshift"
|
|
|
|
]
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
2015-07-07 10:54:45 +01:00
|
|
|
|
2016-09-25 00:57:35 +01:00
|
|
|
let
|
2020-04-29 01:16:20 +01:00
|
|
|
version = "4.1.0";
|
2021-01-15 05:42:41 +00:00
|
|
|
ver = lib.elemAt (lib.splitVersion version);
|
2016-12-16 22:33:23 +00:00
|
|
|
versionMajor = ver 0;
|
|
|
|
versionMinor = ver 1;
|
|
|
|
versionPatch = ver 2;
|
2020-04-29 01:16:20 +01:00
|
|
|
gitCommit = "b4261e0";
|
2018-03-31 16:22:27 +01:00
|
|
|
# version is in vendor/k8s.io/kubernetes/pkg/version/base.go
|
2018-11-01 19:51:22 +00:00
|
|
|
k8sversion = "v1.11.1";
|
|
|
|
k8sgitcommit = "b1b2997";
|
2018-08-05 15:28:45 +01:00
|
|
|
k8sgitMajor = "0";
|
|
|
|
k8sgitMinor = "1";
|
2018-12-20 17:45:54 +00:00
|
|
|
in buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "openshift-origin";
|
2016-09-25 00:57:35 +01:00
|
|
|
inherit version;
|
2015-07-07 10:54:45 +01:00
|
|
|
|
2016-09-25 00:57:35 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openshift";
|
|
|
|
repo = "origin";
|
|
|
|
rev = "v${version}";
|
2020-04-29 01:16:20 +01:00
|
|
|
sha256 = "16bc6ljm418kxz92gz8ldm82491mvlqamrvigyr6ff72rf7ml7ba";
|
2018-12-20 17:45:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
goPackagePath = "github.com/openshift/origin";
|
2015-07-07 10:54:45 +01:00
|
|
|
|
2020-04-29 01:16:20 +01:00
|
|
|
buildInputs = [ kerberos ncurses ];
|
2020-03-18 10:43:51 +00:00
|
|
|
|
2020-04-27 01:10:25 +01:00
|
|
|
nativeBuildInputs = [ which rsync go-bindata clang installShellFiles ];
|
2015-07-07 10:54:45 +01:00
|
|
|
|
2016-09-25 00:57:35 +01:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs ./hack
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2018-12-20 17:45:54 +00:00
|
|
|
cd go/src/${goPackagePath}
|
2016-09-25 00:57:35 +01:00
|
|
|
# Openshift build require this variables to be set
|
|
|
|
# unless there is a .git folder which is not the case with fetchFromGitHub
|
2018-03-31 16:22:27 +01:00
|
|
|
echo "OS_GIT_VERSION=v${version}" >> os-version-defs
|
2020-04-29 01:16:20 +01:00
|
|
|
echo "OS_GIT_TREE_STATE=clean" >> os-version-defs
|
2018-03-31 16:22:27 +01:00
|
|
|
echo "OS_GIT_MAJOR=${versionMajor}" >> os-version-defs
|
|
|
|
echo "OS_GIT_MINOR=${versionMinor}" >> os-version-defs
|
|
|
|
echo "OS_GIT_PATCH=${versionPatch}" >> os-version-defs
|
|
|
|
echo "OS_GIT_COMMIT=${gitCommit}" >> os-version-defs
|
|
|
|
echo "KUBE_GIT_VERSION=${k8sversion}" >> os-version-defs
|
|
|
|
echo "KUBE_GIT_COMMIT=${k8sgitcommit}" >> os-version-defs
|
2018-08-05 15:28:45 +01:00
|
|
|
echo "KUBE_GIT_MAJOR=${k8sgitMajor}" >> os-version-defs
|
|
|
|
echo "KUBE_GIT_MINOR=${k8sgitMinor}" >> os-version-defs
|
2018-03-31 16:22:27 +01:00
|
|
|
export OS_VERSION_FILE="os-version-defs"
|
|
|
|
export CC=clang
|
|
|
|
make all WHAT='${concatStringsSep " " components}'
|
2016-09-25 00:57:35 +01:00
|
|
|
'';
|
2015-07-07 10:54:45 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-04-28 02:50:57 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$out/bin/"
|
2020-04-27 01:10:25 +01:00
|
|
|
installShellCompletion --bash contrib/completions/bash/*
|
|
|
|
installShellCompletion --zsh contrib/completions/zsh/*
|
2017-04-30 22:16:33 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-07-07 10:54:45 +01:00
|
|
|
description = "Build, deploy, and manage your applications with Docker and Kubernetes";
|
|
|
|
license = licenses.asl20;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.openshift.org";
|
2017-08-17 15:57:43 +01:00
|
|
|
maintainers = with maintainers; [offline bachp moretea];
|
2019-02-17 13:00:33 +00:00
|
|
|
platforms = platforms.unix;
|
2015-07-07 10:54:45 +01:00
|
|
|
};
|
|
|
|
}
|