@@ -0,0 +1,41 @@
1+{ stdenv, lib, fetchFromGitHub, rustPlatform
2+, openssl, pkgconfig, protobuf
3+, Security, libiconv
4+
5+, features ?
6+ (if stdenv.isAarch64
7+ then [ "jemallocator" ]
8+ else [ "leveldb" "jemallocator" ])
9+}:
10+
11+rustPlatform.buildRustPackage rec {
12+ pname = "vector";
13+ version = "0.5.0";
14+
15+ src = fetchFromGitHub {
16+ owner = "timberio";
17+ repo = pname;
18+ rev = "refs/tags/v${version}";
19+ sha256 = "0niyxlvphn3awrpfh1hbqy767cckgjzyjrkqjxj844czxhh1hhff";
20+ };
21+
22+ cargoSha256 = "0bdgan891hrah54g6aaysqizkxrfsbidnxihai0i7h7knzq9gsk5";
23+ buildInputs = [ openssl pkgconfig protobuf ]
24+ ++ stdenv.lib.optional stdenv.isDarwin [ Security libiconv ];
25+
26+ # needed for internal protobuf c wrapper library
27+ PROTOC="${protobuf}/bin/protoc";
28+ PROTOC_INCLUDE="${protobuf}/include";
29+
30+ # rdkafka fails to build, for some reason...
31+ cargoBuildFlags = [ "--no-default-features" "--features" "${lib.concatStringsSep "," features}" ];
32+ checkPhase = ":"; # skip tests, too -- they don't respect the rdkafka flag...
33+
34+ meta = with stdenv.lib; {
35+ description = "A high-performance logs, metrics, and events router";
36+ homepage = "https://github.com/timberio/vector";
37+ license = with licenses; [ asl20 ];
38+ maintainers = with maintainers; [ thoughtpolice ];
39+ platforms = platforms.all;
40+ };
41+}