home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2ceb046ee5379e7d1dfd8159842dc300c4953f3b
parent 2678b03a7adf5538879d1763f121747af8bf8751
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Fri,  5 Oct 2018 16:52:34 +0200

pkgs: add openshift 3.11-dev…

… and add it to shikoku

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Moverlays/sbr.nix | 3+++
Mpkgs/default.nix | 3+++
Apkgs/openshift/default.nix | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/overlays/sbr.nix b/overlays/sbr.nix @@ -27,6 +27,9 @@ self: super: krew = import ../pkgs/krew { inherit (self) stdenv lib buildGoPackage fetchFromGitHub; }; + openshift = import ../pkgs/openshift { + inherit (self) stdenv lib fetchFromGitHub removeReferencesTo which go_1_10 go-bindata makeWrapper rsync utillinux coreutils kerberos clang; + }; scripts = import ../pkgs/scripts { inherit (self) stdenv; }; diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -21,6 +21,9 @@ in rec { gogo-protobuf = import ./gogo-protobuf { inherit (pkgs) stdenv lib buildGoPackage fetchgit; }; + openshift = import ./openshift { + inherit (pkgs) stdenv lib fetchFromGitHub removeReferencesTo which go_1_10 go-bindata makeWrapper rsync utillinux coreutils kerberos clang; + }; kubespy = import ./kubespy { inherit (pkgs) stdenv lib buildGoPackage fetchgit; }; diff --git a/pkgs/openshift/default.nix b/pkgs/openshift/default.nix @@ -0,0 +1,92 @@ +{ stdenv, lib, fetchFromGitHub, removeReferencesTo, which, go_1_10, go-bindata, makeWrapper, rsync, utillinux +, coreutils, kerberos, clang +, components ? [ + "cmd/oc" + "cmd/openshift" + ] +}: + +with lib; + +let + version = "3.11.0"; + ver = stdenv.lib.elemAt (stdenv.lib.splitString "." version); + versionMajor = ver 0; + versionMinor = ver 1; + versionPatch = ver 2; + gitCommit = "f7602dd6ca3fc07883a03418c4e96bba2b8be653"; + # version is in vendor/k8s.io/kubernetes/pkg/version/base.go + k8sversion = "v1.11.1"; + k8sgitcommit = "b81c8f8"; + k8sgitMajor = "0"; + k8sgitMinor = "1"; +in stdenv.mkDerivation rec { + name = "openshift-origin-${version}"; + inherit version; + + src = fetchFromGitHub { + owner = "openshift"; + repo = "origin"; + # rev = "v${version}"; + rev = "${gitCommit}"; + sha256 = "18i49mydikwlpbl7mh3a0arvm5447wcdf4ckv2kbiyqv8kpna36z"; +}; + + # go > 1.10 + # [FATAL] [14:44:02+0000] Please install Go version go1.10 or use PERMISSIVE_GO=y to bypass this check. + buildInputs = [ removeReferencesTo makeWrapper which go_1_10 rsync go-bindata kerberos clang ]; + + outputs = [ "out" ]; + + patchPhase = '' + patchShebangs ./hack + + substituteInPlace pkg/oc/clusterup/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/oc/clusterup/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/oc/clusterup/docker/host/host.go \ + --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mkdir' \ + 'nsenter --mount=/rootfs/proc/1/ns/mnt ${coreutils}/bin/mkdir' + ''; + + buildPhase = '' + # Openshift build require this variables to be set + # unless there is a .git folder which is not the case with fetchFromGitHub + echo "OS_GIT_VERSION=v${version}" >> os-version-defs + 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 + echo "KUBE_GIT_MAJOR=${k8sgitMajor}" >> os-version-defs + echo "KUBE_GIT_MINOR=${k8sgitMinor}" >> os-version-defs + export OS_VERSION_FILE="os-version-defs" + export CC=clang + make all WHAT='${concatStringsSep " " components}' + ''; + + installPhase = '' + mkdir -p "$out/bin" + cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$out/bin/" + install -D -t "$out/etc/bash_completion.d" contrib/completions/bash/* + install -D -t "$out/share/zsh/site-functions" contrib/completions/zsh/* + ''; + + preFixup = '' + find $out/bin -type f -exec remove-references-to -t ${go_1_10} '{}' + + ''; + + 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]; + platforms = platforms.linux; + }; +}