2018-08-03 10:23:56 +00:00
|
|
|
{ elk6Version
|
|
|
|
, enableUnfree ? true
|
2021-01-11 07:54:33 +00:00
|
|
|
, lib, stdenv
|
2018-08-03 10:23:56 +00:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2021-03-22 13:53:05 +00:00
|
|
|
, nixosTests
|
2018-08-03 10:23:56 +00:00
|
|
|
, jre
|
|
|
|
}:
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
with lib;
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2021-03-22 13:53:05 +00:00
|
|
|
let this = stdenv.mkDerivation rec {
|
2018-08-03 10:23:56 +00:00
|
|
|
version = elk6Version;
|
2021-11-29 18:24:13 +00:00
|
|
|
pname = "logstash${optionalString (!enableUnfree) "-oss"}";
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2014-07-11 16:50:02 +00:00
|
|
|
src = fetchurl {
|
2021-11-29 18:24:13 +00:00
|
|
|
url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}.tar.gz";
|
2018-08-03 10:23:56 +00:00
|
|
|
sha256 =
|
|
|
|
if enableUnfree
|
2021-12-16 15:20:52 +00:00
|
|
|
then "0hij1byw5b3xmk3vshr9p7gxwbjrywr7ylps05ydc2dmnz8q2a79"
|
|
|
|
else "1fa236pvhj7spys54nqi3k64rwzf6zi6gaccmqg4p4sh92jzsybv";
|
2014-07-11 16:50:02 +00:00
|
|
|
};
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2015-08-19 21:09:03 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
2014-07-14 16:54:20 +00:00
|
|
|
dontPatchShebangs = true;
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2016-09-30 01:55:25 +00:00
|
|
|
buildInputs = [
|
|
|
|
makeWrapper jre
|
|
|
|
];
|
2016-10-01 21:11:30 +00:00
|
|
|
|
2014-07-11 16:50:02 +00:00
|
|
|
installPhase = ''
|
2020-11-26 16:10:07 +00:00
|
|
|
runHook preInstall
|
2015-09-06 12:46:31 +00:00
|
|
|
mkdir -p $out
|
2018-08-03 10:23:56 +00:00
|
|
|
cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
|
2016-10-01 21:11:30 +00:00
|
|
|
|
2018-08-03 10:23:56 +00:00
|
|
|
patchShebangs $out/bin/logstash
|
|
|
|
patchShebangs $out/bin/logstash-plugin
|
2016-10-01 21:11:30 +00:00
|
|
|
|
2018-08-03 10:23:56 +00:00
|
|
|
wrapProgram $out/bin/logstash \
|
2016-09-30 01:55:25 +00:00
|
|
|
--set JAVA_HOME "${jre}"
|
2016-10-02 07:31:59 +00:00
|
|
|
|
|
|
|
wrapProgram $out/bin/logstash-plugin \
|
|
|
|
--set JAVA_HOME "${jre}"
|
2020-11-26 16:10:07 +00:00
|
|
|
runHook postInstall
|
2014-07-11 16:50:02 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-26 04:08:40 +00:00
|
|
|
description = "A data pipeline that helps you process logs and other event data from a variety of systems";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.elastic.co/products/logstash";
|
2018-08-03 10:23:56 +00:00
|
|
|
license = if enableUnfree then licenses.elastic else licenses.asl20;
|
2015-09-06 12:46:31 +00:00
|
|
|
platforms = platforms.unix;
|
2018-08-03 10:23:56 +00:00
|
|
|
maintainers = with maintainers; [ wjlroe offline basvandijk ];
|
2014-07-11 16:50:02 +00:00
|
|
|
};
|
2021-03-22 13:53:05 +00:00
|
|
|
passthru.tests =
|
|
|
|
optionalAttrs (!enableUnfree) (
|
|
|
|
assert this.drvPath == nixosTests.elk.ELK-6.elkPackages.logstash.drvPath;
|
|
|
|
{
|
|
|
|
elk = nixosTests.elk.ELK-6;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
in this
|