Port gocode to buildGoPackage
This commit is contained in:
parent
9dfa4b487f
commit
9896829c49
|
@ -1,23 +1,19 @@
|
|||
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
||||
{ lib, goPackages, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gocode";
|
||||
with goPackages;
|
||||
|
||||
src = import ./deps.nix {
|
||||
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
||||
buildGoPackage rec {
|
||||
rev = "9b760fdb16f18eafbe0cd274527efd2bd89dfa78";
|
||||
name = "gocode-${lib.strings.substring 0 7 rev}";
|
||||
goPackagePath = "github.com/nsf/gocode";
|
||||
src = fetchFromGitHub {
|
||||
inherit rev;
|
||||
owner = "nsf";
|
||||
repo = "gocode";
|
||||
sha256 = "0d1wl0x8jkaav6lcfzs70cr6gy0p88cbk5n3p19l6d0h9xz464ax";
|
||||
};
|
||||
|
||||
buildInputs = [ go ];
|
||||
|
||||
buildPhase = ''
|
||||
export GOPATH=$src
|
||||
go build -v -o gocode github.com/nsf/gocode
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv gocode $out/bin
|
||||
'';
|
||||
subPackages = [ "./" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "An autocompletion daemon for the Go programming language";
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
{ 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);
|
||||
}
|
Loading…
Reference in New Issue