Port etcd to buildGoPackage

This commit is contained in:
Luca Bruno 2015-02-04 14:55:40 +01:00
parent 1c98fc7a9a
commit a20460462d
2 changed files with 13 additions and 46 deletions

View File

@ -1,26 +1,21 @@
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
{ lib, goPackages, fetchFromGitHub }:
stdenv.mkDerivation rec {
version = "2.0.0-rc.1";
with goPackages;
buildGoPackage rec {
version = "2.0.0";
name = "etcd-${version}";
src = import ./deps.nix {
inherit stdenv lib fetchFromGitHub;
goPackagePath = "github.com/coreos/etcd";
src = fetchFromGitHub {
owner = "coreos";
repo = "etcd";
rev = "v${version}";
sha256 = "1s3jilzlqyh2i81pv79cgap6dfj7qrfrwcv4w9lic5ivznz413vc";
};
buildInputs = [ go ];
subPackages = [ "./" ];
buildPhase = ''
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; {
meta = with lib; {
description = "A highly-available key value store for shared configuration and service discovery";
homepage = http://coreos.com/using-coreos/etcd/;
license = licenses.asl20;

View File

@ -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);
}