2016-09-25 01:57:35 +02:00
|
|
|
{ stdenv, fetchFromGitHub, go, which }:
|
2015-07-07 11:54:45 +02:00
|
|
|
|
2016-09-25 01:57:35 +02:00
|
|
|
let
|
2016-12-16 23:33:23 +01:00
|
|
|
version = "1.3.2";
|
|
|
|
ver = stdenv.lib.elemAt (stdenv.lib.splitString "." version);
|
|
|
|
versionMajor = ver 0;
|
|
|
|
versionMinor = ver 1;
|
|
|
|
versionPatch = ver 2;
|
2016-09-25 01:57:35 +02:00
|
|
|
in
|
2015-07-07 11:54:45 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "openshift-origin-${version}";
|
2016-09-25 01:57:35 +02:00
|
|
|
inherit version;
|
2015-07-07 11:54:45 +02:00
|
|
|
|
2016-09-25 01:57:35 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openshift";
|
|
|
|
repo = "origin";
|
|
|
|
rev = "v${version}";
|
2016-12-16 23:33:23 +01:00
|
|
|
sha256 = "0zw8zb9c6icigcq6y47ppnjnqyghk2kril07bapbddvgnvbbfp6m";
|
2015-07-07 11:54:45 +02:00
|
|
|
};
|
|
|
|
|
2016-09-25 01:57:35 +02:00
|
|
|
buildInputs = [ go which ];
|
2015-07-07 11:54:45 +02:00
|
|
|
|
2016-09-25 01:57:35 +02:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs ./hack
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export GOPATH=$(pwd)
|
|
|
|
# Openshift build require this variables to be set
|
|
|
|
# unless there is a .git folder which is not the case with fetchFromGitHub
|
|
|
|
export OS_GIT_VERSION=${version}
|
|
|
|
export OS_GIT_MAJOR=${versionMajor}
|
|
|
|
export OS_GIT_MINOR=${versionMinor}
|
|
|
|
make build
|
|
|
|
'';
|
2015-07-07 11:54:45 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2016-09-25 01:57:35 +02:00
|
|
|
export GOOS=$(go env GOOS)
|
|
|
|
export GOARCH=$(go env GOARCH)
|
2015-07-07 11:54:45 +02:00
|
|
|
mkdir -p "$out/bin"
|
2016-09-25 01:57:35 +02:00
|
|
|
mv _output/local/bin/$GOOS/$GOARCH/* "$out/bin/"
|
2015-07-07 11:54:45 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Build, deploy, and manage your applications with Docker and Kubernetes";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = http://www.openshift.org;
|
2016-12-16 23:33:23 +01:00
|
|
|
maintainers = with maintainers; [offline bachp];
|
2016-11-09 19:54:09 +01:00
|
|
|
platforms = platforms.linux;
|
2015-07-07 11:54:45 +02:00
|
|
|
};
|
|
|
|
}
|