2019-10-28 05:35:02 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform
|
2020-02-16 00:47:46 +00:00
|
|
|
, openssl, pkg-config, protobuf
|
2019-12-17 10:40:51 +00:00
|
|
|
, Security, libiconv, rdkafka
|
2019-10-28 05:35:02 +00:00
|
|
|
|
|
|
|
, features ?
|
|
|
|
(if stdenv.isAarch64
|
2019-12-17 10:40:51 +00:00
|
|
|
then [ "shiplift/unix-socket" "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ]
|
|
|
|
else [ "leveldb" "leveldb/leveldb-sys-2" "shiplift/unix-socket" "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ])
|
2019-10-28 05:35:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "vector";
|
2020-02-16 00:47:46 +00:00
|
|
|
version = "0.7.2";
|
2019-12-15 02:26:48 +00:00
|
|
|
|
2019-10-28 05:35:02 +00:00
|
|
|
src = fetchFromGitHub {
|
2019-12-15 02:26:48 +00:00
|
|
|
owner = "timberio";
|
|
|
|
repo = pname;
|
2020-02-16 00:47:46 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1r6pqljrl0cqz5x09p6bmf4h52h8m02pg05a09idj86v0c0q6bw3";
|
2019-10-28 05:35:02 +00:00
|
|
|
};
|
|
|
|
|
2020-02-16 00:47:46 +00:00
|
|
|
cargoSha256 = "1c742g7a4z5lhr991hxdhwk8h0d43r4vv5bxj80sf3lynyx60yzf";
|
|
|
|
buildInputs = [ openssl pkg-config protobuf rdkafka ]
|
2019-10-28 05:35:02 +00:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin [ Security libiconv ];
|
|
|
|
|
|
|
|
# needed for internal protobuf c wrapper library
|
|
|
|
PROTOC="${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE="${protobuf}/include";
|
|
|
|
|
|
|
|
cargoBuildFlags = [ "--no-default-features" "--features" "${lib.concatStringsSep "," features}" ];
|
2020-02-16 00:47:46 +00:00
|
|
|
# skip tests, too -- they don't respect the rdkafka flag...
|
|
|
|
doCheck = false;
|
2019-10-28 05:35:02 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A high-performance logs, metrics, and events router";
|
|
|
|
homepage = "https://github.com/timberio/vector";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|