summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorCharles Strahan <charles@cstrahan.com>2017-07-11 15:02:29 -0400
committerGitHub <noreply@github.com>2017-07-11 15:02:29 -0400
commitc79e0b2ba03250aa2dd3977db40a4dcbf3493cbe (patch)
treea95d1718e756e40c73464466e88aca0f64b2975e /pkgs/tools
parent451b23beb2db4e0a3c39469537dea4c481984585 (diff)
parent334e85e75abdfd87dd948ac226ed6c00d1143023 (diff)
downloadnixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.tar
nixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.tar.gz
nixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.tar.bz2
nixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.tar.lz
nixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.tar.xz
nixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.tar.zst
nixlib-c79e0b2ba03250aa2dd3977db40a4dcbf3493cbe.zip
Merge pull request #26907 from volth/vault
vault: 0.6.5 -> 0.7.3 with service
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/security/vault/default.nix32
1 files changed, 20 insertions, 12 deletions
diff --git a/pkgs/tools/security/vault/default.nix b/pkgs/tools/security/vault/default.nix
index 0344fc0a74ee..9de6216ea594 100644
--- a/pkgs/tools/security/vault/default.nix
+++ b/pkgs/tools/security/vault/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, go, gox, removeReferencesTo }:
 
 let
   vaultBashCompletions = fetchFromGitHub {
@@ -7,27 +7,35 @@ let
     rev = "e2f59b64be1fa5430fa05c91b6274284de4ea77c";
     sha256 = "10m75rp3hy71wlmnd88grmpjhqy0pwb9m8wm19l0f463xla54frd";
   };
-in buildGoPackage rec {
+in stdenv.mkDerivation rec {
   name = "vault-${version}";
-  version = "0.6.5";
-
-  goPackagePath = "github.com/hashicorp/vault";
+  version = "0.7.3";
 
   src = fetchFromGitHub {
     owner = "hashicorp";
     repo = "vault";
     rev = "v${version}";
-    sha256 = "0ci46zn9d9h26flgjf4inmvk4mb1hlixvx5g7vg02raw0cqvknnb";
+    sha256 = "15wj1pfgzwzjfrqy7b5bx4y9f0hbpqlfif58l5xamwm88229qk4m";
   };
 
-  buildFlagsArray = ''
-    -ldflags=
-      -X github.com/hashicorp/vault/version.GitCommit=${version}
+  nativeBuildInputs = [ go gox removeReferencesTo ];
+
+  buildPhase = ''
+    substituteInPlace scripts/build.sh --replace 'git rev-parse HEAD' 'echo ${src.rev}'
+
+    mkdir -p src/github.com/hashicorp
+    ln -s $(pwd) src/github.com/hashicorp/vault
+
+    GOPATH=$(pwd) make
   '';
 
-  postInstall = ''
-    mkdir -p $bin/share/bash-completion/completions/
-    cp ${vaultBashCompletions}/vault-bash-completion.sh $bin/share/bash-completion/completions/vault
+  installPhase = ''
+    mkdir -p $out/bin $out/share/bash-completion/completions
+
+    cp pkg/*/* $out/bin/
+    find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
+
+    cp ${vaultBashCompletions}/vault-bash-completion.sh $out/share/bash-completion/completions/vault
   '';
 
   meta = with stdenv.lib; {