2021-02-05 02:49:49 +00:00
|
|
|
{ lib, rustPlatform, pkg-config, cmake, llvmPackages, openssl, fetchFromGitHub
|
2021-05-09 18:55:51 +01:00
|
|
|
, installShellFiles, stdenv, Security, libiconv }:
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "tremor";
|
2021-05-19 17:12:24 +01:00
|
|
|
version = "0.11.2";
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tremor-rs";
|
|
|
|
repo = "tremor-runtime";
|
|
|
|
rev = "v${version}";
|
2021-05-19 17:12:24 +01:00
|
|
|
sha256 = "sha256-FedRwFVc+m25+Elj1Vp/fInbK6DVsUpniw29/dtecWo=";
|
2021-02-05 02:49:49 +00:00
|
|
|
};
|
|
|
|
|
2021-05-19 17:12:24 +01:00
|
|
|
cargoSha256 = "sha256-jxXoFOwoBSkn7pv10ctLpD7ko8bokc1ADkB7NQFRC7c=";
|
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;
|
|
|
|
|
2021-04-08 15:34:11 +01:00
|
|
|
cargoBuildFlags = [ "-p tremor-cli" ];
|
2021-02-05 02:49:49 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-03-08 11:22:41 +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;
|
2021-02-05 02:49:49 +00:00
|
|
|
maintainers = with maintainers; [ humancalico ];
|
|
|
|
};
|
|
|
|
}
|