2020-04-24 23:36:52 +00:00
|
|
|
{ elk6Version
|
|
|
|
, enableUnfree ? true
|
2021-01-15 22:18:51 +00:00
|
|
|
, lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2021-04-05 15:23:46 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
, jre
|
|
|
|
}:
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
let this = stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
version = elk6Version;
|
2023-02-02 18:25:31 +00:00
|
|
|
pname = "logstash${lib.optionalString (!enableUnfree) "-oss"}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 =
|
|
|
|
if enableUnfree
|
2021-12-19 01:06:50 +00:00
|
|
|
then "0hij1byw5b3xmk3vshr9p7gxwbjrywr7ylps05ydc2dmnz8q2a79"
|
|
|
|
else "1fa236pvhj7spys54nqi3k64rwzf6zi6gaccmqg4p4sh92jzsybv";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
jre
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-11-30 08:33:03 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
|
|
|
|
|
|
|
|
patchShebangs $out/bin/logstash
|
|
|
|
patchShebangs $out/bin/logstash-plugin
|
|
|
|
|
|
|
|
wrapProgram $out/bin/logstash \
|
|
|
|
--set JAVA_HOME "${jre}"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/logstash-plugin \
|
|
|
|
--set JAVA_HOME "${jre}"
|
2020-11-30 08:33:03 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "A data pipeline that helps you process logs and other event data from a variety of systems";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.elastic.co/products/logstash";
|
2022-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # source bundles dependencies as jars
|
|
|
|
binaryNativeCode # bundled jruby includes native code
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = if enableUnfree then licenses.elastic else licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ wjlroe offline basvandijk ];
|
|
|
|
};
|
2021-04-05 15:23:46 +00:00
|
|
|
passthru.tests =
|
2023-02-02 18:25:31 +00:00
|
|
|
lib.optionalAttrs (!enableUnfree) (
|
2021-04-05 15:23:46 +00:00
|
|
|
assert this.drvPath == nixosTests.elk.ELK-6.elkPackages.logstash.drvPath;
|
|
|
|
{
|
|
|
|
elk = nixosTests.elk.ELK-6;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
in this
|