mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Merge pull request #4458 from offlinehacker/pkgs/gotools
golang: add golint and gotags
This commit is contained in:
commit
61ea009f3b
29
pkgs/development/tools/golint/default.nix
Normal file
29
pkgs/development/tools/golint/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
27
pkgs/development/tools/golint/deps.nix
Normal file
27
pkgs/development/tools/golint/deps.nix
Normal 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);
|
||||||
|
}
|
29
pkgs/development/tools/gotags/default.nix
Normal file
29
pkgs/development/tools/gotags/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
27
pkgs/development/tools/gotags/deps.nix
Normal file
27
pkgs/development/tools/gotags/deps.nix
Normal 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);
|
||||||
|
}
|
@ -8131,6 +8131,10 @@ let
|
|||||||
|
|
||||||
gocode = callPackage ../development/tools/gocode { };
|
gocode = callPackage ../development/tools/gocode { };
|
||||||
|
|
||||||
|
gotags = callPackage ../development/tools/gotags { };
|
||||||
|
|
||||||
|
golint = callPackage ../development/tools/golint { };
|
||||||
|
|
||||||
gogoclient = callPackage ../os-specific/linux/gogoclient { };
|
gogoclient = callPackage ../os-specific/linux/gogoclient { };
|
||||||
|
|
||||||
nss_ldap = callPackage ../os-specific/linux/nss_ldap { };
|
nss_ldap = callPackage ../os-specific/linux/nss_ldap { };
|
||||||
|
Loading…
Reference in New Issue
Block a user