consul-template: Move to go-packages

This commit is contained in:
William A. Kennington III 2015-05-18 15:55:55 -07:00
parent 414b3f2909
commit f0d324c23a
3 changed files with 22 additions and 35 deletions

View File

@ -1,34 +0,0 @@
{ stdenv, lib, go, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "consul-template-${version}";
version = "0.7.0";
src = import ./deps.nix {
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
};
buildInputs = [ go ];
buildPhase = ''
GOPATH=$src go build -v -o consul-template github.com/hashicorp/consul-template
'';
installPhase = ''
# Fix references to go-deps in the binary
hash=$(echo $src | sed 's,.*/\([^/-]*\).*,\1,g')
xs=$(printf 'x%.0s' $(seq 2 $(echo $hash | wc -c)))
sed -i "s,$hash,$xs,g" consul-template
mkdir -p $out/bin
cp consul-template $out/bin
'';
meta = with lib; {
description = "Generic template rendering and notifications with Consul";
homepage = https://github.com/hashicorp/consul-template;
license = licenses.mpl20;
maintainers = with maintainers; [ puffnfresh wkennington ];
platforms = platforms.unix;
};
}

View File

@ -764,7 +764,7 @@ let
consul-alerts = callPackage ../servers/consul/alerts.nix { };
consul-template = callPackage ../servers/consul/template.nix { };
consul-template = goPackages.consul-template;
corosync = callPackage ../servers/corosync { };

View File

@ -359,6 +359,27 @@ let
buildInputs = [ raft raft-boltdb raft-mdb ];
};
consul-template = buildGoPackage rec {
rev = "v0.9.0";
name = "consul-template-${rev}";
goPackagePath = "github.com/hashicorp/consul-template";
src = fetchFromGitHub {
inherit rev;
owner = "hashicorp";
repo = "consul-template";
sha256 = "1k64rjskzn7cxn7rxab978847jq8gr4zj4cnzgznhn44nzasgymj";
};
# We just want the consul api not all of consul and vault
extraSrcs = [
{ inherit (consul) src goPackagePath; }
{ inherit (vault) src goPackagePath; }
];
buildInputs = [ go-multierror go-syslog hcl logutils mapstructure ];
};
dbus = buildGoPackage rec {
rev = "88765d85c0fdadcd98a54e30694fa4e4f5b51133";
name = "dbus-${stdenv.lib.strings.substring 0 7 rev}";