Merge pull request #116017 from thoughtpolice/nixpkgs/staging/vector-0.12

vector: 0.10.0 -> 0.12.1
This commit is contained in:
Austin Seipp 2021-03-16 20:20:13 -05:00 committed by GitHub
commit 00aa8d3995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 19 deletions

View File

@ -1,32 +1,24 @@
{ stdenv, lib, fetchFromGitHub, rustPlatform { stdenv, lib, fetchFromGitHub, rustPlatform, openssl, pkg-config, protobuf
, openssl, pkg-config, protobuf , Security, libiconv, rdkafka, tzdata, coreutils, CoreServices
, Security, libiconv, rdkafka
, tzdata
, features ? , features ?
((if stdenv.isAarch64 ([ "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ]
then [ "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ] ++ (lib.optional stdenv.targetPlatform.isUnix "unix")
else [ "leveldb" "leveldb/leveldb-sys-2" "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ]) ++ [ "sinks" "sources" "transforms" ])
++
(lib.optional stdenv.targetPlatform.isUnix "unix")
++
[ "sinks" "sources" "transforms" ])
, coreutils
, CoreServices
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "vector"; pname = "vector";
version = "0.10.0"; version = "0.12.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "timberio"; owner = "timberio";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "0q6x3fvwwh18iyznqlr09n3zppzgw9jaz973s8haz54hnxj16wx0"; sha256 = "0sw05472znxmggckxjbrl3b8ky8nsw42xmrsb41p8z4q0aw115fd";
}; };
cargoSha256 = "Y/vDYXWQ65zZ86vTwP4aCZYCMZuqbz6tpfv4uRkFAzc="; cargoSha256 = "0mfhrdqry6qrzfx5px1zqgfv5iqa186vl2yh290ibinkxy0x5fa9";
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl protobuf rdkafka ] buildInputs = [ openssl protobuf rdkafka ]
++ lib.optional stdenv.isDarwin [ Security libiconv coreutils CoreServices ]; ++ lib.optional stdenv.isDarwin [ Security libiconv coreutils CoreServices ];
@ -35,7 +27,7 @@ rustPlatform.buildRustPackage rec {
PROTOC="${protobuf}/bin/protoc"; PROTOC="${protobuf}/bin/protoc";
PROTOC_INCLUDE="${protobuf}/include"; PROTOC_INCLUDE="${protobuf}/include";
cargoBuildFlags = [ "--no-default-features" "--features" "${lib.concatStringsSep "," features}" ]; cargoBuildFlags = [ "--no-default-features" "--features" (lib.concatStringsSep "," features) ];
checkPhase = "TZDIR=${tzdata}/share/zoneinfo cargo test --no-default-features --features ${lib.concatStringsSep "," features} -- --test-threads 1"; checkPhase = "TZDIR=${tzdata}/share/zoneinfo cargo test --no-default-features --features ${lib.concatStringsSep "," features} -- --test-threads 1";
# recent overhauls of DNS support in 0.9 mean that we try to resolve # recent overhauls of DNS support in 0.9 mean that we try to resolve
@ -49,15 +41,17 @@ rustPlatform.buildRustPackage rec {
# nor do I know why it depends on rustc. # nor do I know why it depends on rustc.
# However, in order for the closure size to stay at a reasonable level, # However, in order for the closure size to stay at a reasonable level,
# transforms-geoip is patched out of Cargo.toml for now - unless explicitly asked for. # transforms-geoip is patched out of Cargo.toml for now - unless explicitly asked for.
patchPhase = '' postPatch = ''
substituteInPlace ./src/dns.rs \ substituteInPlace ./src/dns.rs \
--replace "#[test]" "" --replace "#[tokio::test]" ""
${lib.optionalString (!builtins.elem "transforms-geoip" features) '' ${lib.optionalString (!builtins.elem "transforms-geoip" features) ''
substituteInPlace ./Cargo.toml --replace '"transforms-geoip",' "" substituteInPlace ./Cargo.toml --replace '"transforms-geoip",' ""
''} ''}
''; '';
passthru = { inherit features; };
meta = with lib; { meta = with lib; {
description = "A high-performance logs, metrics, and events router"; description = "A high-performance logs, metrics, and events router";
homepage = "https://github.com/timberio/vector"; homepage = "https://github.com/timberio/vector";