Add godep, dependency tool for go

This commit is contained in:
Jaka Hudoklin 2015-01-28 16:02:46 +01:00
parent 6e7d708bcc
commit 44df0a8eaf
3 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,30 @@
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
stdenv.mkDerivation rec {
version = "ddd7fbf";
name = "godep-${version}";
src = import ./deps.nix {
inherit stdenv lib fetchgit fetchFromGitHub;
};
buildInputs = [ go ];
buildPhase = ''
export GOPATH=$src
go build -v -o godep github.com/tools/godep
'';
installPhase = ''
mkdir -p $out/bin
mv godep $out/bin
'';
meta = with stdenv.lib; {
description = "Ddependency tool for go";
homepage = https://github.com/tools/godep;
license = licenses.bsd3;
maintainers = with maintainers; [ offline ];
platforms = platforms.unix;
};
}

View File

@ -0,0 +1,59 @@
# This file was generated by go2nix.
{ stdenv, lib, fetchFromGitHub, fetchgit }:
let
goDeps = [
{
root = "github.com/kr/fs";
src = fetchgit {
url = "https://github.com/kr/fs.git";
rev = "2788f0dbd16903de03cb8186e5c7d97b69ad387b";
sha256 = "1c0fipl4rsh0v5liq1ska1dl83v3llab4k6lm8mvrx9c4dyp71ly";
};
}
{
root = "github.com/tools/godep";
src = fetchgit {
url = "https://github.com/tools/godep.git";
rev = "0baa7ea464025b2cb8e84b13c5ac4da99237a1bf";
sha256 = "10hr10fj6ymmfzwjg5drf7j0f4mrpb4p97a01rqp7xvfv5j0zisj";
};
}
{
root = "golang.org/x/net";
src = fetchgit {
url = "https://go.googlesource.com/net";
rev = "8b2d0ae1f4c3b83c10ff17e89a89ff04cc0903c3";
sha256 = "0nxawxhq7yysbrrd88hkqzfr5hvsqpd452yzi53cp1afzma3zjay";
};
}
{
root = "golang.org/x/text";
src = fetchgit {
url = "https://go.googlesource.com/text";
rev = "bfad311ce93436dc888b40d76c78f99dc3104473";
sha256 = "1mbhp5q24drz2l2x6ib3180i42f9015ry80bn7jhr7rwizvyp6lh";
};
}
{
root = "golang.org/x/tools";
src = fetchgit {
url = "https://go.googlesource.com/tools";
rev = "3ecc311976cc3f7c7b7a50314929bdc1b07c4c9d";
sha256 = "0ic3lrg6ykxrlnzcway4ka280n052qysjawf4lvj8gl3r1vlmwfg";
};
}
];
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);
}

View File

@ -8804,6 +8804,8 @@ let
golint = callPackage ../development/tools/golint { };
godep = callPackage ../development/tools/godep { };
gogoclient = callPackage ../os-specific/linux/gogoclient { };
nss_ldap = callPackage ../os-specific/linux/nss_ldap { };