2022-11-09 13:45:05 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, openssl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
|
|
|
, Security
|
|
|
|
, libiconv
|
|
|
|
, protobuf
|
|
|
|
}:
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "tremor";
|
2022-11-09 13:45:05 +00:00
|
|
|
version = "0.12.4";
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tremor-rs";
|
|
|
|
repo = "tremor-runtime";
|
|
|
|
rev = "v${version}";
|
2022-11-09 13:45:05 +00:00
|
|
|
sha256 = "sha256-+cN+nMDMX4rxjs1VQnSgjBvCsjxxAd13otp9qd21SYo=";
|
2021-02-05 02:49:49 +00:00
|
|
|
};
|
|
|
|
|
2022-11-09 13:45:05 +00:00
|
|
|
cargoSha256 = "sha256-MthdQXZPIOOd5A2bJO4p49e74s76M1HruLxLWbvog4I=";
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config installShellFiles ];
|
|
|
|
|
2021-05-09 18:55:51 +01:00
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ Security libiconv ];
|
2021-02-05 02:49:49 +00:00
|
|
|
|
2021-04-08 15:34:11 +01:00
|
|
|
# TODO export TREMOR_PATH($out/lib) variable
|
2021-02-05 02:49:49 +00:00
|
|
|
postInstall = ''
|
2021-04-08 15:34:11 +01:00
|
|
|
# Copy the standard library to $out/lib
|
|
|
|
cp -r ${src}/tremor-script/lib/ $out
|
|
|
|
|
2021-02-05 02:49:49 +00:00
|
|
|
installShellCompletion --cmd tremor \
|
|
|
|
--bash <($out/bin/tremor completions bash) \
|
|
|
|
--fish <($out/bin/tremor completions fish) \
|
|
|
|
--zsh <($out/bin/tremor completions zsh)
|
|
|
|
'';
|
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 09:23:57 +01:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
# OPENSSL_NO_VENDOR - If set, always find OpenSSL in the system, even if the vendored feature is enabled.
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
2022-11-09 13:45:05 +00:00
|
|
|
# needed for internal protobuf c wrapper library
|
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# all try to make a network access
|
|
|
|
"--skip=connectors::tests::http::server::https_server_test"
|
|
|
|
"--skip=connectors::tests::tcp::client::tls_client"
|
|
|
|
"--skip=connectors::tests::udp::udp_no_bind"
|
|
|
|
"--skip=connectors::tests::ws::ws_client_bad_config"
|
|
|
|
"--skip=connectors::tests::ws::wss_server_binary_routing"
|
|
|
|
"--skip=connectors::tests::ws::wss_server_text_routing"
|
|
|
|
"--skip=connectors::utils::tls::tests::client_config"
|
|
|
|
];
|
|
|
|
|
2021-04-08 15:34:11 +01:00
|
|
|
cargoBuildFlags = [ "-p tremor-cli" ];
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-05-28 14:22:26 +01:00
|
|
|
broken = stdenv.isDarwin;
|
2022-11-09 13:45:05 +00:00
|
|
|
description = ''
|
|
|
|
Early stage event processing system for unstructured data with rich
|
|
|
|
support for structural pattern matching, filtering and transformation
|
|
|
|
'';
|
2021-02-05 02:49:49 +00:00
|
|
|
homepage = "https://www.tremor.rs/";
|
|
|
|
license = licenses.asl20;
|
2021-05-09 18:55:51 +01:00
|
|
|
platforms = platforms.x86_64;
|
2022-11-09 14:40:22 +00:00
|
|
|
maintainers = with maintainers; [ humancalico happysalada ];
|
2021-02-05 02:49:49 +00:00
|
|
|
};
|
|
|
|
}
|