Merge pull request #52572 from vdemeester/52469-openshift-to-buildgopackage
openshift: migrate to using buildGoPackage
This commit is contained in:
commit
566cc6bf20
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, removeReferencesTo, which, go, go-bindata, makeWrapper, rsync, utillinux
|
{ stdenv, lib, fetchFromGitHub, buildGoPackage, which, go-bindata, rsync, utillinux
|
||||||
, coreutils, kerberos, clang
|
, coreutils, kerberos, clang
|
||||||
, components ? [
|
, components ? [
|
||||||
"cmd/oc"
|
"cmd/oc"
|
||||||
|
@ -20,7 +20,7 @@ let
|
||||||
k8sgitcommit = "b1b2997";
|
k8sgitcommit = "b1b2997";
|
||||||
k8sgitMajor = "0";
|
k8sgitMajor = "0";
|
||||||
k8sgitMinor = "1";
|
k8sgitMinor = "1";
|
||||||
in stdenv.mkDerivation rec {
|
in buildGoPackage rec {
|
||||||
name = "openshift-origin-${version}";
|
name = "openshift-origin-${version}";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
|
@ -29,13 +29,13 @@ in stdenv.mkDerivation rec {
|
||||||
repo = "origin";
|
repo = "origin";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "06q4v2a1mm6c659ab0rzkqz6b66vx4avqfg0s9xckwhq420lzgka";
|
sha256 = "06q4v2a1mm6c659ab0rzkqz6b66vx4avqfg0s9xckwhq420lzgka";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
goPackagePath = "github.com/openshift/origin";
|
||||||
|
|
||||||
# go > 1.10
|
# go > 1.10
|
||||||
# [FATAL] [14:44:02+0000] Please install Go version go or use PERMISSIVE_GO=y to bypass this check.
|
# [FATAL] [14:44:02+0000] Please install Go version go or use PERMISSIVE_GO=y to bypass this check.
|
||||||
buildInputs = [ removeReferencesTo makeWrapper which go rsync go-bindata kerberos clang ];
|
buildInputs = [ which rsync go-bindata kerberos clang ];
|
||||||
|
|
||||||
outputs = [ "out" ];
|
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
patchShebangs ./hack
|
patchShebangs ./hack
|
||||||
|
@ -54,6 +54,7 @@ in stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
cd go/src/${goPackagePath}
|
||||||
# Openshift build require this variables to be set
|
# Openshift build require this variables to be set
|
||||||
# unless there is a .git folder which is not the case with fetchFromGitHub
|
# 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_VERSION=v${version}" >> os-version-defs
|
||||||
|
@ -71,14 +72,10 @@ in stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/bin"
|
mkdir -p $bin/bin
|
||||||
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$out/bin/"
|
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
|
||||||
install -D -t "$out/etc/bash_completion.d" contrib/completions/bash/*
|
install -D -t "$bin/etc/bash_completion.d" contrib/completions/bash/*
|
||||||
install -D -t "$out/share/zsh/site-functions" contrib/completions/zsh/*
|
install -D -t "$bin/share/zsh/site-functions" contrib/completions/zsh/*
|
||||||
'';
|
|
||||||
|
|
||||||
preFixup = ''
|
|
||||||
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
Loading…
Reference in New Issue