3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/logstash/6.x.nix

65 lines
1.6 KiB
Nix
Raw Normal View History

2018-08-03 11:23:56 +01:00
{ elk6Version
, enableUnfree ? true
, lib, stdenv
2018-08-03 11:23:56 +01:00
, fetchurl
, makeWrapper
2021-03-22 13:53:05 +00:00
, nixosTests
2018-08-03 11:23:56 +01: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 {
2018-08-03 11:23:56 +01:00
version = elk6Version;
pname = "logstash${optionalString (!enableUnfree) "-oss"}";
2014-07-11 17:50:02 +01:00
src = fetchurl {
url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}.tar.gz";
2018-08-03 11:23:56 +01:00
sha256 =
if enableUnfree
2019-09-06 14:52:20 +01:00
then "00pwi7clgdflzzg15bh3y30gzikvvy7p5fl88fww7xhhy47q8053"
else "0spxgqsyh72n0l0xh6rljp0lbqz46xmr02sqz25ybycr4qkxdhgk";
2014-07-11 17:50:02 +01:00
};
2015-08-19 22:09:03 +01:00
dontBuild = true;
dontPatchELF = true;
dontStrip = true;
dontPatchShebangs = true;
buildInputs = [
makeWrapper jre
];
2016-10-01 22:11:30 +01:00
2014-07-11 17:50:02 +01:00
installPhase = ''
runHook preInstall
mkdir -p $out
2018-08-03 11:23:56 +01:00
cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
2016-10-01 22:11:30 +01:00
2018-08-03 11:23:56 +01:00
patchShebangs $out/bin/logstash
patchShebangs $out/bin/logstash-plugin
2016-10-01 22:11:30 +01:00
2018-08-03 11:23:56 +01:00
wrapProgram $out/bin/logstash \
--set JAVA_HOME "${jre}"
wrapProgram $out/bin/logstash-plugin \
--set JAVA_HOME "${jre}"
runHook postInstall
2014-07-11 17:50:02 +01:00
'';
meta = with lib; {
description = "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 11:23:56 +01:00
license = if enableUnfree then licenses.elastic else licenses.asl20;
platforms = platforms.unix;
2018-08-03 11:23:56 +01:00
maintainers = with maintainers; [ wjlroe offline basvandijk ];
2014-07-11 17:50:02 +01: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