Port golint to buildGoPackage
This commit is contained in:
parent
3e20e4c5e6
commit
9c6420580a
@ -1,23 +1,20 @@
|
||||
{ stdenv, lib, go_1_3, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
||||
{ lib, goPackages, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "golint";
|
||||
with goPackages;
|
||||
|
||||
src = import ./deps.nix {
|
||||
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
||||
buildGoPackage rec {
|
||||
rev = "8ca23475bcb43213a55dd8210b69363f6b0e09c1";
|
||||
name = "golint-${lib.strings.substring 0 7 rev}";
|
||||
goPackagePath = "github.com/golang/lint";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "golang";
|
||||
repo = "lint";
|
||||
sha256 = "16wbykik6dw3x9s7iqi4ln8kvzsh3g621wb8mk4nfldw7lyqp3cs";
|
||||
};
|
||||
|
||||
buildInputs = [ go_1_3 ];
|
||||
|
||||
buildPhase = ''
|
||||
export GOPATH=$src
|
||||
go build -v -o lint github.com/golang/lint/golint
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv lint $out/bin/golint
|
||||
'';
|
||||
subPackages = [ "golint" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Linter for Go source code";
|
||||
|
@ -1,27 +0,0 @@
|
||||
{ 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);
|
||||
}
|
@ -8882,7 +8882,7 @@ let
|
||||
|
||||
gotags = callPackage ../development/tools/gotags { };
|
||||
|
||||
golint = callPackage ../development/tools/golint { };
|
||||
golint = callPackage ../development/tools/golint { goPackages = go13Packages; };
|
||||
|
||||
gogoclient = callPackage ../os-specific/linux/gogoclient { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user