diff --git a/pkgs/development/tools/golint/default.nix b/pkgs/development/tools/golint/default.nix new file mode 100644 index 000000000000..9e82580018fc --- /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 000000000000..47b8ade22982 --- /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); +} diff --git a/pkgs/development/tools/gotags/default.nix b/pkgs/development/tools/gotags/default.nix new file mode 100644 index 000000000000..5fec8c181a89 --- /dev/null +++ b/pkgs/development/tools/gotags/default.nix @@ -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; + }; +} diff --git a/pkgs/development/tools/gotags/deps.nix b/pkgs/development/tools/gotags/deps.nix new file mode 100644 index 000000000000..97e77bdd977e --- /dev/null +++ b/pkgs/development/tools/gotags/deps.nix @@ -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); +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 040527676e23..a399ab993c04 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8131,6 +8131,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 { };