From f76fbe03e0e6b17f27120adf1f496e332eb680d7 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Mon, 23 Jun 2014 05:49:58 -0400 Subject: add gocode package --- pkgs/development/tools/gocode/default.nix | 29 +++++++++++++++++++++++++++++ pkgs/development/tools/gocode/deps.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/tools/gocode/default.nix create mode 100644 pkgs/development/tools/gocode/deps.nix (limited to 'pkgs/development/tools/gocode') diff --git a/pkgs/development/tools/gocode/default.nix b/pkgs/development/tools/gocode/default.nix new file mode 100644 index 00000000000..6057c288cf6 --- /dev/null +++ b/pkgs/development/tools/gocode/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "gocode"; + + src = import ./deps.nix { + inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub; + }; + + buildInputs = [ go ]; + + buildPhase = '' + export GOPATH=$src + go build -v -o gocode github.com/nsf/gocode + ''; + + installPhase = '' + ensureDir $out/bin + mv gocode $out/bin + ''; + + meta = with lib; { + description = "An autocompletion daemon for the Go programming language"; + homepage = https://github.com/nsf/gocode; + license = licenses.mit; + maintainers = with maintainers; [ cstrahan ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/tools/gocode/deps.nix b/pkgs/development/tools/gocode/deps.nix new file mode 100644 index 00000000000..4fd0578496d --- /dev/null +++ b/pkgs/development/tools/gocode/deps.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }: + +let + goDeps = [ + { + root = "github.com/nsf/gocode"; + src = fetchFromGitHub { + owner = "nsf"; + repo = "gocode"; + rev = "9b760fdb16f18eafbe0cd274527efd2bd89dfa78"; + sha256 = "0d1wl0x8jkaav6lcfzs70cr6gy0p88cbk5n3p19l6d0h9xz464ax"; + }; + } + ]; + +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); +} -- cgit 1.4.1