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