2019-10-28 06:35:02 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform
|
2020-02-16 01:47:46 +01:00
|
|
|
, openssl, pkg-config, protobuf
|
2019-12-17 11:40:51 +01:00
|
|
|
, Security, libiconv, rdkafka
|
2020-02-25 18:39:50 +01:00
|
|
|
, tzdata
|
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-03-06 03:04:56 +01:00
|
|
|
version = "0.8.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;
|
2020-02-16 01:47:46 +01:00
|
|
|
rev = "v${version}";
|
2020-03-06 03:04:56 +01:00
|
|
|
sha256 = "0k15scvjcg2v4z80vq27yrn2wm50fp8xj8lga2czzs0zxhlv21nl";
|
2019-10-28 06:35:02 +01:00
|
|
|
};
|
|
|
|
|
2020-03-06 03:04:56 +01:00
|
|
|
cargoSha256 = "1al8jzjxjhxwb5n1d52pvl59d11g0bdg2dcw8ir2nclya1w68f2w";
|
2020-02-16 01:47:46 +01:00
|
|
|
buildInputs = [ openssl pkg-config 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}" ];
|
2020-02-25 18:39:50 +01:00
|
|
|
checkPhase = "TZDIR=${tzdata}/share/zoneinfo cargo test --no-default-features --features ${lib.concatStringsSep "," features},disable-resolv-conf -- --test-threads 1";
|
2019-10-28 06:35:02 +01: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;
|
|
|
|
};
|
|
|
|
}
|