@ -1,32 +1,24 @@
{ stdenv , lib , fetchFromGitHub , rustPlatform
, openssl , pkg-config , protobuf
, Security , libiconv , rdkafka
, tzdata
{ stdenv , lib , fetchFromGitHub , rustPlatform , openssl , pkg-config , protobuf
, Security , libiconv , rdkafka , tzdata , coreutils , CoreServices
, features ?
( ( if stdenv . isAarch64
then [ " j e m a l l o c a t o r " " r d k a f k a " " r d k a f k a / d y n a m i c _ l i n k i n g " ]
else [ " l e v e l d b " " l e v e l d b / l e v e l d b - s y s - 2 " " j e m a l l o c a t o r " " r d k a f k a " " r d k a f k a / d y n a m i c _ l i n k i n g " ] )
++
( lib . optional stdenv . targetPlatform . isUnix " u n i x " )
++
[ " s i n k s " " s o u r c e s " " t r a n s f o r m s " ] )
, coreutils
, CoreServices
( [ " j e m a l l o c a t o r " " r d k a f k a " " r d k a f k a / d y n a m i c _ l i n k i n g " ]
++ ( lib . optional stdenv . targetPlatform . isUnix " u n i x " )
++ [ " s i n k s " " s o u r c e s " " t r a n s f o r m s " ] )
} :
rustPlatform . buildRustPackage rec {
pname = " v e c t o r " ;
version = " 0 . 1 0 . 0 " ;
version = " 0 . 1 2 . 0 " ;
src = fetchFromGitHub {
owner = " t i m b e r i o " ;
repo = pname ;
rev = " v ${ version } " ;
sha256 = " 0 q 6 x 3 f v w w h 1 8 i y z n q l r 0 9 n 3 z p p z g w 9 j a z 9 7 3 s 8 h a z 5 4 h n x j 1 6 w x 0 " ;
sha256 = " 0 2 q b n 9 w 9 2 8 6 r a n 8 v j r y 9 0 9 0 r 9 y m 9 b j 9 x x v y z a v w 7 g k 5 3 s g 5 6 m 8 g l " ;
} ;
cargoSha256 = " Y / v D Y X W Q 6 5 z Z 8 6 v T w P 4 a C Z Y C M Z u q b z 6 t p f v 4 u R k F A z c = " ;
cargoSha256 = " 0 z y n y c 7 v k d f 5 p z z 4 s v y m s n 3 w 8 r 8 3 4 h c 5 g q x m 1 j k 6 m y i d v n y h 2 x s p " ;
nativeBuildInputs = [ pkg-config ] ;
buildInputs = [ openssl protobuf rdkafka ]
++ lib . optional stdenv . isDarwin [ Security libiconv coreutils CoreServices ] ;
@ -35,7 +27,7 @@ rustPlatform.buildRustPackage rec {
PROTOC = " ${ protobuf } / b i n / p r o t o c " ;
PROTOC_INCLUDE = " ${ protobuf } / i n c l u d e " ;
cargoBuildFlags = [ " - - n o - d e f a u l t - f e a t u r e s " " - - f e a t u r e s " " ${ lib . concatStringsSep " , " features } " ] ;
cargoBuildFlags = [ " - - n o - d e f a u l t - f e a t u r e s " " - - f e a t u r e s " ( lib . concatStringsSep " , " features ) ] ;
checkPhase = " T Z D I R = ${ tzdata } / s h a r e / z o n e i n f o c a r g o t e s t - - n o - d e f a u l t - f e a t u r e s - - f e a t u r e s ${ lib . concatStringsSep " , " features } - - - - t e s t - t h r e a d s 1 " ;
# 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.
# 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.
patchPhase = ''
postP atch = ''
substituteInPlace ./src/dns.rs \
- - replace " # [ t e s t ] " " "
- - replace " # [ t o k i o : : t es t ] " " "
$ { lib . optionalString ( ! builtins . elem " t r a n s f o r m s - g e o i p " features ) ''
substituteInPlace ./Cargo.toml - - replace ' " t r a n s f o r m s - g e o i p " , ' " "
'' }
'' ;
passthru = { inherit features ; } ;
meta = with lib ; {
description = " A h i g h - p e r f o r m a n c e l o g s , m e t r i c s , a n d e v e n t s r o u t e r " ;
homepage = " h t t p s : / / g i t h u b . c o m / t i m b e r i o / v e c t o r " ;