golang: add golint and gotags

This commit is contained in:
Jaka Hudoklin 2014-10-10 15:27:44 +02:00
parent f719f0b230
commit 47e8ee287f
5 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,29 @@
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "golint";
src = import ./deps.nix {
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
};
buildInputs = [ go ];
buildPhase = ''
export GOPATH=$src
go build -v -o lint github.com/golang/lint/golint
'';
installPhase = ''
mkdir -p $out/bin
mv lint $out/bin/golint
'';
meta = with lib; {
description = "Linter for Go source code.";
homepage = https://github.com/golang/lint;
license = licenses.mit;
maintainers = with maintainers; [ offline ];
platforms = platforms.unix;
};
}

View File

@ -0,0 +1,27 @@
{ stdenv, lib, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
let
goDeps = [
{
root = "github.com/golang/lint";
src = fetchFromGitHub {
owner = "golang";
repo = "lint";
rev = "8ca23475bcb43213a55dd8210b69363f6b0e09c1";
sha256 = "16wbykik6dw3x9s7iqi4ln8kvzsh3g621wb8mk4nfldw7lyqp3cs";
};
}
];
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

@ -0,0 +1,29 @@
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "gotags";
src = import ./deps.nix {
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
};
buildInputs = [ go ];
buildPhase = ''
export GOPATH=$src
go build -v -o gotags github.com/jstemmer/gotags
'';
installPhase = ''
mkdir -p $out/bin
mv gotags $out/bin
'';
meta = with lib; {
description = "Ctags-compatible tag generator for Go";
homepage = https://github.com/nsf/gotags;
license = licenses.mit;
maintainers = with maintainers; [ offline ];
platforms = platforms.unix;
};
}

View File

@ -0,0 +1,27 @@
{ stdenv, lib, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
let
goDeps = [
{
root = "github.com/jstemmer/gotags";
src = fetchFromGitHub {
owner = "jstemmer";
repo = "gotags";
rev = "a60c6a1b171faedc44354bd437d965e5e3bdc220";
sha256 = "1drbypby0isdmkq44jmlv59k3jrwvq2jciaccxx2qc2nnx444fkq";
};
}
];
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

@ -8066,6 +8066,10 @@ let
gocode = callPackage ../development/tools/gocode { };
gotags = callPackage ../development/tools/gotags { };
golint = callPackage ../development/tools/golint { };
gogoclient = callPackage ../os-specific/linux/gogoclient { };
nss_ldap = callPackage ../os-specific/linux/nss_ldap { };