Port flannel to buildGoPackage

This commit is contained in:
Luca Bruno 2015-02-04 15:56:40 +01:00
parent 8fd42c55a9
commit 040d475103
2 changed files with 11 additions and 46 deletions

View file

@ -1,26 +1,19 @@
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
{ lib, goPackages, fetchFromGitHub }:
stdenv.mkDerivation rec {
with goPackages;
buildGoPackage rec {
version = "0.1.0";
name = "flannel-${version}";
src = import ./deps.nix {
inherit stdenv lib fetchFromGitHub;
goPackagePath = "github.com/coreos/flannel";
src = fetchFromGitHub {
owner = "coreos";
repo = "flannel";
rev = "v${version}";
sha256 = "1f7x6a2c8ix6j5y1r0dq56b58bl2rs2ycbdqb9fz5zv1zk2w20rd";
};
buildInputs = [ go ];
buildPhase = ''
export GOPATH=$src
go build -v -o flannel github.com/coreos/flannel
'';
installPhase = ''
mkdir -p $out/bin
mv flannel $out/bin/flannel
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Flannel is an etcd backed network fabric for containers";
homepage = https://github.com/coreos/flannel;
license = licenses.asl20;

View file

@ -1,28 +0,0 @@
# This file was generated by go2nix.
{ stdenv, lib, fetchFromGitHub }:
let
goDeps = [
{
root = "github.com/coreos/flannel";
src = fetchFromGitHub {
owner = "coreos";
repo = "flannel";
rev = "cd584fa5e1545ae86c965588e81ceb24455e980d";
sha256 = "1f7x6a2c8ix6j5y1r0dq56b58bl2rs2ycbdqb9fz5zv1zk2w20rd";
};
}
];
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);
}