2019-10-28 06:35:02 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform
|
|
|
|
, openssl, pkgconfig, protobuf
|
2019-12-17 11:40:51 +01:00
|
|
|
, Security, libiconv, rdkafka
|
2019-10-28 06:35:02 +01:00
|
|
|
|
|
|
|
, features ?
|
|
|
|
(if stdenv.isAarch64
|
2019-12-17 11:40:51 +01: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 06:35:02 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "vector";
|
2020-01-25 22:35:03 +01:00
|
|
|
version = "0.7.1";
|
2019-12-15 03:26:48 +01:00
|
|
|
|
2019-10-28 06:35:02 +01:00
|
|
|
src = fetchFromGitHub {
|
2019-12-15 03:26:48 +01:00
|
|
|
owner = "timberio";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2020-01-25 22:35:03 +01:00
|
|
|
sha256 = "1bqp1ms8y91mpcmxlc8kyncigxq7spxq1ygy6gviz35zq1cqkwnr";
|
2019-10-28 06:35:02 +01:00
|
|
|
};
|
|
|
|
|
2020-01-25 22:35:03 +01:00
|
|
|
cargoSha256 = "01hynn8ccpwqrirr1bczqc7q7pqkzfjks2v6q4f32xbm50b31fky";
|
2019-12-17 11:40:51 +01:00
|
|
|
buildInputs = [ openssl pkgconfig protobuf rdkafka ]
|
2019-10-28 06:35:02 +01: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}" ];
|
|
|
|
checkPhase = ":"; # skip tests, too -- they don't respect the rdkafka flag...
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|