2017-08-18 16:06:26 +01:00
|
|
|
{ stdenv, fetchFromGitHub, which, buildGoPackage, utillinux, coreutils }:
|
2015-07-07 10:54:45 +01:00
|
|
|
|
2016-09-25 00:57:35 +01:00
|
|
|
let
|
2017-08-17 15:57:43 +01:00
|
|
|
version = "3.6.0";
|
2016-12-16 22:33:23 +00:00
|
|
|
ver = stdenv.lib.elemAt (stdenv.lib.splitString "." version);
|
|
|
|
versionMajor = ver 0;
|
|
|
|
versionMinor = ver 1;
|
|
|
|
versionPatch = ver 2;
|
2017-05-01 21:07:41 +01:00
|
|
|
in buildGoPackage rec {
|
2015-07-07 10:54:45 +01:00
|
|
|
name = "openshift-origin-${version}";
|
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}";
|
2017-08-17 15:57:43 +01:00
|
|
|
sha256 = "08bdqvsjl6c7dmllyz8n4akb7gyn91znvbph5cgmmk1bhskycy1r";
|
2015-07-07 10:54:45 +01:00
|
|
|
};
|
|
|
|
|
2017-05-01 21:07:41 +01:00
|
|
|
buildInputs = [ which ];
|
2015-07-07 10:54:45 +01:00
|
|
|
|
2017-05-01 21:07:41 +01:00
|
|
|
goPackagePath = null;
|
2016-09-25 00:57:35 +01:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs ./hack
|
2017-08-18 16:06:26 +01:00
|
|
|
substituteInPlace pkg/bootstrap/docker/host/host.go \
|
|
|
|
--replace 'nsenter --mount=/rootfs/proc/1/ns/mnt findmnt' \
|
|
|
|
'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/findmnt'
|
|
|
|
|
|
|
|
substituteInPlace pkg/bootstrap/docker/host/host.go \
|
|
|
|
--replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mount' \
|
|
|
|
'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/mount'
|
|
|
|
|
|
|
|
substituteInPlace pkg/bootstrap/docker/host/host.go \
|
|
|
|
--replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mkdir' \
|
2017-09-10 15:07:50 +01:00
|
|
|
'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/mount'
|
2016-09-25 00:57:35 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2017-05-01 21:07:41 +01:00
|
|
|
cd go/src/origin-v${version}-src
|
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
|
2017-08-17 15:57:43 +01:00
|
|
|
export OS_GIT_VERSION=v${version}
|
2016-09-25 00:57:35 +01:00
|
|
|
export OS_GIT_MAJOR=${versionMajor}
|
|
|
|
export OS_GIT_MINOR=${versionMinor}
|
|
|
|
make build
|
|
|
|
'';
|
2015-07-07 10:54:45 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2017-05-01 21:07:41 +01:00
|
|
|
mkdir -p "$bin/bin"
|
2017-05-04 21:31:18 +01:00
|
|
|
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
|
2017-04-30 22:16:33 +01:00
|
|
|
'';
|
|
|
|
|
2015-07-07 10:54:45 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Build, deploy, and manage your applications with Docker and Kubernetes";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = http://www.openshift.org;
|
2017-08-17 15:57:43 +01:00
|
|
|
maintainers = with maintainers; [offline bachp moretea];
|
2016-11-09 18:54:09 +00:00
|
|
|
platforms = platforms.linux;
|
2015-07-07 10:54:45 +01:00
|
|
|
};
|
|
|
|
}
|