Port gotags to buildGoPackage

This commit is contained in:
Luca Bruno 2015-02-04 11:41:45 +01:00
parent 9c6420580a
commit 67f34cbd0d
2 changed files with 13 additions and 44 deletions

View File

@ -1,24 +1,20 @@
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
{ lib, goPackages, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "gotags";
with goPackages;
src = import ./deps.nix {
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
buildGoPackage rec {
rev = "a60c6a1b171faedc44354bd437d965e5e3bdc220";
name = "gotags-${lib.strings.substring 0 7 rev}";
goPackagePath = "github.com/jstemmer/gotags";
src = fetchFromGitHub {
inherit rev;
owner = "jstemmer";
repo = "gotags";
sha256 = "1drbypby0isdmkq44jmlv59k3jrwvq2jciaccxx2qc2nnx444fkq";
};
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;

View File

@ -1,27 +0,0 @@
{ 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);
}