about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2019-01-11 12:22:53 +0000
committerGitHub <noreply@github.com>2019-01-11 12:22:53 +0000
commit566cc6bf20825a57cd870a9467183cde1dc99c52 (patch)
tree3992f2c2319d9f2086afd68732832481747084dd /pkgs/applications/networking/cluster
parent831ffbdc96ebc7ed202e608831001a372ac1397e (diff)
parente4bc05f46044f36ab10e10e269e5609f1274b67f (diff)
downloadnixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.tar
nixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.tar.gz
nixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.tar.bz2
nixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.tar.lz
nixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.tar.xz
nixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.tar.zst
nixlib-566cc6bf20825a57cd870a9467183cde1dc99c52.zip
Merge pull request #52572 from vdemeester/52469-openshift-to-buildgopackage
openshift: migrate to using buildGoPackage
Diffstat (limited to 'pkgs/applications/networking/cluster')
-rw-r--r--pkgs/applications/networking/cluster/openshift/default.nix25
1 files changed, 11 insertions, 14 deletions
diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix
index a34c728da168..f730329d0725 100644
--- a/pkgs/applications/networking/cluster/openshift/default.nix
+++ b/pkgs/applications/networking/cluster/openshift/default.nix
@@ -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
 , components ? [
   "cmd/oc"
@@ -20,7 +20,7 @@ let
   k8sgitcommit = "b1b2997";
   k8sgitMajor = "0";
   k8sgitMinor = "1";
-in stdenv.mkDerivation rec {
+in buildGoPackage rec {
   name = "openshift-origin-${version}";
   inherit version;
 
@@ -29,13 +29,13 @@ in stdenv.mkDerivation rec {
     repo = "origin";
     rev = "v${version}";
     sha256 = "06q4v2a1mm6c659ab0rzkqz6b66vx4avqfg0s9xckwhq420lzgka";
-};
+  };
+
+  goPackagePath = "github.com/openshift/origin";
 
   # go > 1.10
   # [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 ];
-
-  outputs = [ "out" ];
+  buildInputs = [ which rsync go-bindata kerberos clang ];
 
   patchPhase = ''
     patchShebangs ./hack
@@ -54,6 +54,7 @@ in stdenv.mkDerivation rec {
   '';
 
   buildPhase = ''
+    cd go/src/${goPackagePath}
     # 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
@@ -71,14 +72,10 @@ in stdenv.mkDerivation rec {
   '';
 
   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} '{}' +
+    mkdir -p $bin/bin
+    cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/"
+    install -D -t "$bin/etc/bash_completion.d" contrib/completions/bash/*
+    install -D -t "$bin/share/zsh/site-functions" contrib/completions/zsh/*
   '';
 
   meta = with stdenv.lib; {