From 46e82353a1d74183d55a3097f1e18f47f24d0fc4 Mon Sep 17 00:00:00 2001 From: jz Date: Tue, 28 Apr 2015 17:45:32 -0600 Subject: [PATCH] add goimports --- pkgs/development/tools/goimports/default.nix | 34 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/goimports/default.nix diff --git a/pkgs/development/tools/goimports/default.nix b/pkgs/development/tools/goimports/default.nix new file mode 100644 index 000000000000..91bd207581da --- /dev/null +++ b/pkgs/development/tools/goimports/default.nix @@ -0,0 +1,34 @@ +{ stdenv, lib, go, fetchurl, fetchgit, fetchFromGitHub }: + +stdenv.mkDerivation rec { + rev = "7534f4943d94a318edde90212439e538ed54cdde"; + version = "git-2015-04-26"; + name = "goimports-${version}"; + + buildInputs = [ go ]; + + src = fetchFromGitHub { + inherit rev; + owner = "golang"; + repo = "tools"; + sha256 = "12ybykrn92l7awav0wkx9yqpc5z0pdwwi29qs9mdr2xspx61rb50"; + }; + + buildPhase = '' + export GOPATH=$src + go build -v -o goimports golang.org/x/tools/cmd/goimports + ''; + + installPhase = '' + mkdir -p $out/bin + mv goimports $out/bin + ''; + + meta = with lib; { + description = "Import management tool for go"; + homepage = https://godoc.org/golang.org/x/tools/cmd/goimports; + license = licenses.bsd3; + maintainers = with maintainers; [ jzellner ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2bdf26fea90d..dfbbe417c772 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4842,7 +4842,7 @@ let jdtsdk = callPackage ../development/eclipse/jdt-sdk { }; jruby165 = callPackage ../development/interpreters/jruby { }; - + jython = callPackage ../development/interpreters/jython {}; guileCairo = callPackage ../development/guile-modules/guile-cairo { }; @@ -9496,6 +9496,8 @@ let godep = callPackage ../development/tools/godep { }; + goimports = callPackage ../development/tools/goimports { }; + gogoclient = callPackage ../os-specific/linux/gogoclient { }; nss_ldap = callPackage ../os-specific/linux/nss_ldap { };