3
0
Fork 0
forked from mirrors/nixpkgs

openshift: use buildGoPackage

This commit is contained in:
Jörg Thalheim 2017-05-01 22:07:41 +02:00
parent 239d352080
commit 878a1662d7
No known key found for this signature in database
GPG key ID: CA4106B8D7CC79FA

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, go, which, removeReferencesTo, makeWrapper }: { stdenv, fetchFromGitHub, which, buildGoPackage }:
let let
version = "1.5.0"; version = "1.5.0";
@ -6,8 +6,7 @@ let
versionMajor = ver 0; versionMajor = ver 0;
versionMinor = ver 1; versionMinor = ver 1;
versionPatch = ver 2; versionPatch = ver 2;
in in buildGoPackage rec {
stdenv.mkDerivation rec {
name = "openshift-origin-${version}"; name = "openshift-origin-${version}";
inherit version; inherit version;
@ -18,14 +17,15 @@ stdenv.mkDerivation rec {
sha256 = "0qvyxcyca3888nkgvyvqcmybm95ncwxb3zvrzbg2gz8kx6g6350v"; sha256 = "0qvyxcyca3888nkgvyvqcmybm95ncwxb3zvrzbg2gz8kx6g6350v";
}; };
buildInputs = [ go which removeReferencesTo makeWrapper ]; buildInputs = [ which ];
goPackagePath = null;
patchPhase = '' patchPhase = ''
patchShebangs ./hack patchShebangs ./hack
''; '';
buildPhase = '' buildPhase = ''
export GOPATH=$(pwd) cd go/src/origin-v${version}-src
# 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
export OS_GIT_VERSION=${version} export OS_GIT_VERSION=${version}
@ -35,14 +35,8 @@ stdenv.mkDerivation rec {
''; '';
installPhase = '' installPhase = ''
export GOOS=$(go env GOOS) mkdir -p "$bin/bin"
export GOARCH=$(go env GOARCH) cp "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
mkdir -p "$out/bin"
mv _output/local/bin/$GOOS/$GOARCH/* "$out/bin/"
'';
preFixup = ''
find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {