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

61 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, which, buildGoPackage, utillinux, coreutils }:
2015-07-07 11:54:45 +02:00
2016-09-25 01:57:35 +02:00
let
version = "3.6.0";
2016-12-16 23:33:23 +01:00
ver = stdenv.lib.elemAt (stdenv.lib.splitString "." version);
versionMajor = ver 0;
versionMinor = ver 1;
versionPatch = ver 2;
2017-05-01 22:07:41 +02:00
in buildGoPackage rec {
2015-07-07 11:54:45 +02:00
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}";
sha256 = "08bdqvsjl6c7dmllyz8n4akb7gyn91znvbph5cgmmk1bhskycy1r";
2015-07-07 11:54:45 +02:00
};
2017-05-01 22:07:41 +02:00
buildInputs = [ which ];
2015-07-07 11:54:45 +02:00
2017-05-01 22:07:41 +02:00
goPackagePath = null;
2016-09-25 01:57:35 +02:00
patchPhase = ''
patchShebangs ./hack
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 16:07:50 +02:00
'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/mount'
2016-09-25 01:57:35 +02:00
'';
buildPhase = ''
2017-05-01 22:07:41 +02:00
cd go/src/origin-v${version}-src
2016-09-25 01:57:35 +02: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=v${version}
2016-09-25 01:57:35 +02:00
export OS_GIT_MAJOR=${versionMajor}
export OS_GIT_MINOR=${versionMinor}
make build
'';
2015-07-07 11:54:45 +02:00
installPhase = ''
2017-05-01 22:07:41 +02:00
mkdir -p "$bin/bin"
2017-05-04 22:31:18 +02:00
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
2017-04-30 23:16:33 +02:00
'';
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;
maintainers = with maintainers; [offline bachp moretea];
2016-11-09 19:54:09 +01:00
platforms = platforms.linux;
2015-07-07 11:54:45 +02:00
};
}