git.iko.soy/typeable/nixpkgs
on master help sign in
vault: 1.0.2 -> 1.2.2

This upgrades Vault to version 1.2.2. To accomplish this, we migrate to using the `buildGoModule` helper, as since 1.0.2 the Vault build process migrated to modules, and does not vendor its dependencies. We also stop using the vault build script, and gox, as it only really provides value for local development, where it configures GOOS/GOARCH and installs into some convenient dev locations.

commitd95dca26ab7c7a0031df89e555515afa94e1d137 authorDanielle Lancashire <dani@builds.terrible.systems> dateWed 28 Aug 2019, 09:47 (7 years ago) parentf7387ad
1 file changed+11−22
pkgs/tools/security/vault/default.nix+11−22
pkgs/tools/security/vault/default.nix+11−22
@@ -1,36 +1,25 @@
1−{ stdenv, fetchFromGitHub, go, gox, removeReferencesTo }:
1+{ stdenv, fetchFromGitHub, buildGoModule }:
22
3−stdenv.mkDerivation rec {
3+buildGoModule rec {
44 name = "vault-${version}";
5− version = "1.1.3";
5+ version = "1.2.2";
66
77 src = fetchFromGitHub {
88 owner = "hashicorp";
99 repo = "vault";
1010 rev = "v${version}";
11− sha256 = "0dylwvs95crvn1p7pbyzib979rxzp4ivzvi5k4f5ivp4ygnp597s";
11+ sha256 = "1xljm7xmb4ldg3wx8s9kw1spffg4ywk4r1jqfa743czd2xxmqavl";
1212 };
1313
14− nativeBuildInputs = [ go gox removeReferencesTo ];
14+ modSha256 = "13pr3piv6hrsc562qagpn1h5wckiziyfqraj13172hdglz3n2i7q";
1515
16− preBuild = ''
17− patchShebangs ./
18− substituteInPlace scripts/build.sh --replace 'git rev-parse HEAD' 'echo ${src.rev}'
19− sed -i s/'^GIT_DIRTY=.*'/'GIT_DIRTY="+NixOS"'/ scripts/build.sh
20−
21− mkdir -p .git/hooks src/github.com/hashicorp
22− ln -s $(pwd) src/github.com/hashicorp/vault
23−
24− export GOPATH=$(pwd)
25− export GOCACHE="$TMPDIR/go-cache"
26− '';
27−
28− installPhase = ''
29− mkdir -p $out/bin $out/share/bash-completion/completions
30−
31− cp pkg/*/* $out/bin/
32− find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
16+ buildFlagsArray = [
17+ "-tags='vault'"
18+ "-ldflags=\"-X github.com/hashicorp/vault/sdk/version.GitCommit='v${version}'\""
19+ ];
3320
21+ postInstall = ''
22+ mkdir -p $out/share/bash-completion/completions
3423 echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault
3524 '';
3625