summary refs log tree commit diff
path: root/pkgs/tools/misc/vector
diff options
context:
space:
mode:
authorJohan Thomsen <jth@dbc.dk>2020-10-23 14:09:39 +0200
committerJohan Thomsen <jth@dbc.dk>2020-10-26 17:21:11 +0100
commita03c8a8f35613b4ca501d09c788545d1fd7376ec (patch)
treea0d70186e3eabc75f5aa53da7271a416a5a9be28 /pkgs/tools/misc/vector
parentb36db49ae73db879fe00f73f2777077f33a68745 (diff)
downloadnixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.tar
nixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.tar.gz
nixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.tar.bz2
nixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.tar.lz
nixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.tar.xz
nixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.tar.zst
nixpkgs-a03c8a8f35613b4ca501d09c788545d1fd7376ec.zip
vector: add sinks, sources and transforms as nixpkgs default features
Don't include transform-geoip unless this feature is explicitly selected
Diffstat (limited to 'pkgs/tools/misc/vector')
-rw-r--r--pkgs/tools/misc/vector/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/tools/misc/vector/default.nix b/pkgs/tools/misc/vector/default.nix
index 37595702b68..701e86dbf90 100644
--- a/pkgs/tools/misc/vector/default.nix
+++ b/pkgs/tools/misc/vector/default.nix
@@ -4,9 +4,11 @@
 , tzdata
 
 , features ?
-    (if stdenv.isAarch64
+    ((if stdenv.isAarch64
      then [ "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ]
      else [ "leveldb" "leveldb/leveldb-sys-2" "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ])
+     ++
+     [ "sinks" "sources" "transforms" ])
 , coreutils
 , CoreServices
 }:
@@ -38,9 +40,20 @@ rustPlatform.buildRustPackage rec {
   # vector.dev during the checkPhase, which obviously isn't going to work.
   # these tests in the DNS module are trivial though, so stubbing them out is
   # fine IMO.
+  #
+  # the geoip transform yields maxmindb.so which contains references to rustc.
+  # neither figured out why the shared object is included in the output
+  # (it doesn't seem to be a runtime dependencies of the geoip transform),
+  # 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 = ''
     substituteInPlace ./src/dns.rs \
       --replace "#[test]" ""
+
+    ${lib.optionalString (!builtins.elem "transforms-geoip" features) ''
+        substituteInPlace ./Cargo.toml --replace '"transforms-geoip",' ""
+    ''}
   '';
 
   meta = with stdenv.lib; {