@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, go, which, removeReferencesTo, makeWrapper }:
1+{ stdenv, fetchFromGitHub, which, buildGoPackage }:
22
33let
44 version = "1.5.0";
@@ -6,8 +6,7 @@ let
66 versionMajor = ver 0;
77 versionMinor = ver 1;
88 versionPatch = ver 2;
9−in
10−stdenv.mkDerivation rec {
9+in buildGoPackage rec {
1110 name = "openshift-origin-${version}";
1211 inherit version;
1312
@@ -18,14 +17,15 @@ stdenv.mkDerivation rec {
1817 sha256 = "0qvyxcyca3888nkgvyvqcmybm95ncwxb3zvrzbg2gz8kx6g6350v";
1918 };
2019
21− buildInputs = [ go which removeReferencesTo makeWrapper ];
20+ buildInputs = [ which ];
2221
22+ goPackagePath = null;
2323 patchPhase = ''
2424 patchShebangs ./hack
2525 '';
2626
2727 buildPhase = ''
28− export GOPATH=$(pwd)
28+ cd go/src/origin-v${version}-src
2929 # Openshift build require this variables to be set
3030 # unless there is a .git folder which is not the case with fetchFromGitHub
3131 export OS_GIT_VERSION=${version}
@@ -35,14 +35,8 @@ stdenv.mkDerivation rec {
3535 '';
3636
3737 installPhase = ''
38− export GOOS=$(go env GOOS)
39− export GOARCH=$(go env GOARCH)
40− mkdir -p "$out/bin"
41− mv _output/local/bin/$GOOS/$GOARCH/* "$out/bin/"
42− '';
43−
44− preFixup = ''
45− find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
38+ mkdir -p "$bin/bin"
39+ cp "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
4640 '';
4741
4842 meta = with stdenv.lib; {