diff options
Diffstat (limited to 'pkgs/development/tools/golint')
-rw-r--r-- | pkgs/development/tools/golint/default.nix | 29 | ||||
-rw-r--r-- | pkgs/development/tools/golint/deps.nix | 27 |
2 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/tools/golint/default.nix b/pkgs/development/tools/golint/default.nix new file mode 100644 index 00000000000..9e82580018f --- /dev/null +++ b/pkgs/development/tools/golint/default.nix @@ -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; + }; +} diff --git a/pkgs/development/tools/golint/deps.nix b/pkgs/development/tools/golint/deps.nix new file mode 100644 index 00000000000..47b8ade2298 --- /dev/null +++ b/pkgs/development/tools/golint/deps.nix @@ -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); +} |