nixpkgs/pkgs/applications/networking/cluster/openshift/default.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

2017-05-01 13:07:41 -07:00
{ stdenv, fetchFromGitHub, which, buildGoPackage }:
2015-07-07 02:54:45 -07:00
2016-09-24 16:57:35 -07:00
let
2017-04-30 14:16:33 -07:00
version = "1.5.0";
2016-12-16 14:33:23 -08:00
ver = stdenv.lib.elemAt (stdenv.lib.splitString "." version);
versionMajor = ver 0;
versionMinor = ver 1;
versionPatch = ver 2;
2017-05-01 13:07:41 -07:00
in buildGoPackage rec {
2015-07-07 02:54:45 -07:00
name = "openshift-origin-${version}";
2016-09-24 16:57:35 -07:00
inherit version;
2015-07-07 02:54:45 -07:00
2016-09-24 16:57:35 -07:00
src = fetchFromGitHub {
owner = "openshift";
repo = "origin";
rev = "v${version}";
2017-04-30 14:16:33 -07:00
sha256 = "0qvyxcyca3888nkgvyvqcmybm95ncwxb3zvrzbg2gz8kx6g6350v";
2015-07-07 02:54:45 -07:00
};
2017-05-01 13:07:41 -07:00
buildInputs = [ which ];
2015-07-07 02:54:45 -07:00
2017-05-01 13:07:41 -07:00
goPackagePath = null;
2016-09-24 16:57:35 -07:00
patchPhase = ''
patchShebangs ./hack
'';
buildPhase = ''
2017-05-01 13:07:41 -07:00
cd go/src/origin-v${version}-src
2016-09-24 16:57:35 -07:00
# 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 02:54:45 -07:00
installPhase = ''
2017-05-01 13:07:41 -07:00
mkdir -p "$bin/bin"
2017-05-04 13:31:18 -07:00
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
2017-04-30 14:16:33 -07:00
'';
2015-07-07 02:54:45 -07: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 14:33:23 -08:00
maintainers = with maintainers; [offline bachp];
2016-11-09 10:54:09 -08:00
platforms = platforms.linux;
2015-07-07 02:54:45 -07:00
};
}