Fix consul version being "unknown-unknown". Fixes #24606.

See https://github.com/hashicorp/consul/blob/v0.7.5/scripts/build.sh#L44
for how consul's build script does it.
This commit is contained in:
Niklas Hambüchen 2017-04-04 00:13:15 +02:00
parent b65dc619f0
commit b03013cb32

View File

@ -17,6 +17,10 @@ buildGoPackage rec {
# Keep consul.ui for backward compatability
passthru.ui = consul-ui;
preBuild = ''
buildFlagsArray+=("-ldflags" "-X github.com/hashicorp/consul/version.GitDescribe=v${version} -X github.com/hashicorp/consul/version.Version=${version} -X github.com/hashicorp/consul/version.VersionPrerelease=")
'';
meta = with stdenv.lib; {
description = "Tool for service discovery, monitoring and configuration";
homepage = "https://www.consul.io/";