biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / misc / tremor-rs / default.nix
blobf346db518047c8eefd79b6c00aabf9fc0e956966
1 { lib
2 , rustPlatform
3 , pkg-config
4 , cmake
5 , openssl
6 , fetchFromGitHub
7 , installShellFiles
8 , stdenv
9 , Security
10 , libiconv
11 , protobuf
14 rustPlatform.buildRustPackage rec {
15   pname = "tremor";
16   version = "0.12.4";
18   src = fetchFromGitHub {
19     owner = "tremor-rs";
20     repo = "tremor-runtime";
21     rev = "v${version}";
22     sha256 = "sha256-+cN+nMDMX4rxjs1VQnSgjBvCsjxxAd13otp9qd21SYo=";
23   };
25   cargoLock = {
26     lockFile = ./Cargo.lock;
27     outputHashes = {
28       "http-client-6.5.1" = "sha256-IfFZSiNqN4kiro8qSR5HV7e0U3nadS2vaYtBF+7UPVs=";
29       "qwal-0.1.0" = "sha256-PFdqRTNht77+/7GWzJm7/wESEaO3QjTTY+aRwpK9Ddo=";
30       "rdkafka-0.28.0" = "sha256-6dUGf5TRtiGz9OCxcrPmLdhtZoOd/aJR9VgNFQC2tnQ=";
31       "window-0.1.1" = "sha256-H6w1Y8ClhXISNYmALSRSwfREOaMzccNafygc6E44NYs=";
32     };
33   };
35   nativeBuildInputs = [ cmake pkg-config installShellFiles rustPlatform.bindgenHook ];
37   buildInputs = [ openssl ]
38     ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security libiconv ];
40   # relax lints to fix an error caused by invalid macro_export
41   # error: `log_error` isn't a valid `#[macro_export]` argument
42   # note: `#[deny(invalid_macro_export_arguments)]` implied by `#[deny(warnings)]`
43   postPatch = ''
44     substituteInPlace src/lib.rs \
45       --replace '#![deny(' '#![warn('
46   '';
48   # TODO export TREMOR_PATH($out/lib) variable
49   postInstall = ''
50     # Copy the standard library to $out/lib
51     cp -r ${src}/tremor-script/lib/ $out
53   '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
54     installShellCompletion --cmd tremor \
55       --bash <($out/bin/tremor completions bash) \
56       --fish <($out/bin/tremor completions fish) \
57       --zsh <($out/bin/tremor completions zsh)
58   '';
60   # OPENSSL_NO_VENDOR - If set, always find OpenSSL in the system, even if the vendored feature is enabled.
61   OPENSSL_NO_VENDOR = 1;
63   # needed for internal protobuf c wrapper library
64   PROTOC = "${protobuf}/bin/protoc";
65   PROTOC_INCLUDE = "${protobuf}/include";
67   env = lib.optionalAttrs (stdenv.system == "x86_64-darwin") {
68     RUSTFLAGS = "-C target-feature=+avx,+avx2,+sse4.2";
69   };
71   # tests failed on x86_64-darwin with SIGILL: illegal instruction
72   doCheck = stdenv.system != "x86_64-darwin";
74   checkFlags = [
75     # all try to make a network access
76     "--skip=connectors::tests::http::server::https_server_test"
77     "--skip=connectors::tests::tcp::client::tls_client"
78     "--skip=connectors::tests::udp::udp_no_bind"
79     "--skip=connectors::tests::ws::ws_client_bad_config"
80     "--skip=connectors::tests::ws::wss_server_binary_routing"
81     "--skip=connectors::tests::ws::wss_server_text_routing"
82     "--skip=connectors::utils::tls::tests::client_config"
83   ];
85   cargoBuildFlags = [ "-p tremor-cli" ];
87   meta = with lib; {
88     description = ''
89       Early stage event processing system for unstructured data with rich
90       support for structural pattern matching, filtering and transformation
91     '';
92     homepage = "https://www.tremor.rs/";
93     license = licenses.asl20;
94     maintainers = with maintainers; [ humancalico happysalada ];
95   };