Port nsq to buildGoPackage
This commit is contained in:
@@ -1,33 +1,26 @@
|
||||
{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
||||
{ lib, goPackages, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
with goPackages;
|
||||
|
||||
buildGoPackage rec {
|
||||
version = "0.2.28";
|
||||
name = "nsq-${version}";
|
||||
|
||||
src = import ./deps.nix {
|
||||
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
||||
goPackagePath = "github.com/bitly/nsq";
|
||||
src = fetchFromGitHub {
|
||||
owner = "bitly";
|
||||
repo = "nsq";
|
||||
rev = "v${version}";
|
||||
sha256 = "0drmf1j5w3q4l6f7xjy3y7d7cl50gcx0qwci6mahxsyaaclx60yx";
|
||||
};
|
||||
|
||||
buildInputs = [ go ];
|
||||
subPackages = [ "nsqadmin" ] ++
|
||||
map (x: "apps/"+x) [ "nsq_pubsub" "nsq_stat" "nsq_tail"
|
||||
"nsq_to_file" "nsq_to_http" "nsq_to_nsq"
|
||||
"nsqd" "nsqlookupd" ];
|
||||
|
||||
buildPhase = ''
|
||||
export GOPATH=$src
|
||||
apps=(nsq_pubsub nsq_stat nsq_tail nsq_to_file nsq_to_http nsq_to_nsq nsqd nsqlookupd)
|
||||
buildInputs = [ go-nsq go-options toml perks go-hostpool ];
|
||||
|
||||
mkdir build
|
||||
|
||||
go build -v -o build/nsqadmin github.com/bitly/nsq/nsqadmin
|
||||
for app in "''${apps[@]}"; do
|
||||
go build -v -o build/$app github.com/bitly/nsq/apps/$app
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv build/* $out/bin
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "A realtime distributed messaging platform";
|
||||
homepage = http://nsq.io/;
|
||||
license = licenses.mit;
|
||||
|
||||
Reference in New Issue
Block a user