nixpkgs/pkgs/tools/misc/logstash/7.x.nix

65 lines
1.6 KiB
Nix
Raw Normal View History

{ elk7Version
2018-08-03 10:23:56 +00:00
, enableUnfree ? true
, 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;
2021-03-22 13:53:05 +00:00
let this = stdenv.mkDerivation rec {
version = elk7Version;
2018-08-03 10:23:56 +00:00
name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}";
2014-07-11 16:50:02 +00:00
src = fetchurl {
2018-08-03 10:23:56 +00:00
url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz";
sha256 =
if enableUnfree
2020-01-06 13:22:28 +00:00
then "01l6alwgsq6yf0z9d08i0hi8g708nph1vm78nl4xbpg8h964bybj"
else "0nlwgaw6rmhp5b68zpp1pzsjs30b0bjzdg8f7xy6rarpk338s8yb";
2014-07-11 16:50:02 +00:00
};
2015-08-19 21:09:03 +00:00
dontBuild = true;
dontPatchELF = true;
dontStrip = true;
dontPatchShebangs = true;
buildInputs = [
makeWrapper jre
];
2016-10-01 21:11:30 +00:00
2014-07-11 16:50:02 +00:00
installPhase = ''
runHook preInstall
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 \
--set JAVA_HOME "${jre}"
wrapProgram $out/bin/logstash-plugin \
--set JAVA_HOME "${jre}"
runHook postInstall
2014-07-11 16:50:02 +00:00
'';
meta = with lib; {
description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
homepage = "https://www.elastic.co/products/logstash";
2018-08-03 10:23:56 +00:00
license = if enableUnfree then licenses.elastic else licenses.asl20;
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-7.elkPackages.logstash.drvPath;
{
elk = nixosTests.elk.ELK-7;
}
);
};
in this