Port etcd to buildGoPackage
This commit is contained in:
parent
1c98fc7a9a
commit
a20460462d
@ -1,26 +1,21 @@
|
|||||||
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
{ lib, goPackages, fetchFromGitHub }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
with goPackages;
|
||||||
version = "2.0.0-rc.1";
|
|
||||||
|
buildGoPackage rec {
|
||||||
|
version = "2.0.0";
|
||||||
name = "etcd-${version}";
|
name = "etcd-${version}";
|
||||||
|
goPackagePath = "github.com/coreos/etcd";
|
||||||
src = import ./deps.nix {
|
src = fetchFromGitHub {
|
||||||
inherit stdenv lib fetchFromGitHub;
|
owner = "coreos";
|
||||||
|
repo = "etcd";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "1s3jilzlqyh2i81pv79cgap6dfj7qrfrwcv4w9lic5ivznz413vc";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ go ];
|
subPackages = [ "./" ];
|
||||||
|
|
||||||
buildPhase = ''
|
meta = with lib; {
|
||||||
export GOPATH=$src
|
|
||||||
go build -v -o etcd github.com/coreos/etcd
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mv etcd $out/bin/etcd
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
|
||||||
description = "A highly-available key value store for shared configuration and service discovery";
|
description = "A highly-available key value store for shared configuration and service discovery";
|
||||||
homepage = http://coreos.com/using-coreos/etcd/;
|
homepage = http://coreos.com/using-coreos/etcd/;
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
# This file was generated by go2nix.
|
|
||||||
{ stdenv, lib, fetchFromGitHub }:
|
|
||||||
|
|
||||||
let
|
|
||||||
goDeps = [
|
|
||||||
{
|
|
||||||
root = "github.com/coreos/etcd";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "coreos";
|
|
||||||
repo = "etcd";
|
|
||||||
rev = "221abdcb3b755b36d1e7d70149f6de3450351619";
|
|
||||||
sha256 = "1wkd238ap9gp5irrb3f6nnh83rzizwfrfac76j0dvqdka35l247k";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "go-deps";
|
|
||||||
|
|
||||||
buildCommand =
|
|
||||||
lib.concatStrings
|
|
||||||
(map (dep: ''
|
|
||||||
mkdir -p $out/src/`dirname ${dep.root}`
|
|
||||||
ln -s ${dep.src} $out/src/${dep.root}
|
|
||||||
'') goDeps);
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user