2021-11-04 12:16:32 +00:00
|
|
|
{ config
|
|
|
|
, elk7Version
|
2018-08-03 10:23:56 +00:00
|
|
|
, enableUnfree ? true
|
2021-08-30 03:25:15 +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-08-30 13:50:10 +00:00
|
|
|
let
|
2023-01-24 16:35:54 +00:00
|
|
|
info = lib.splitString "-" stdenv.hostPlatform.system;
|
|
|
|
arch = lib.elemAt info 0;
|
|
|
|
plat = lib.elemAt info 1;
|
2021-08-30 13:50:10 +00:00
|
|
|
shas =
|
|
|
|
if enableUnfree
|
|
|
|
then {
|
2022-06-14 08:59:24 +00:00
|
|
|
x86_64-linux = "35e50e05fba0240aa5b138bc1c81f67addaf557701f8df41c682b5bc708f7455";
|
|
|
|
x86_64-darwin = "698b6000788e123b647c988993f710c6d9bc44eb8c8e6f97d6b18a695a61f0a6";
|
2022-06-01 22:15:43 +00:00
|
|
|
aarch64-linux = "69694856fde11836eb1613bf3a2ba31fbdc933f58c8527b6180f6122c8bb528b";
|
2021-08-30 13:50:10 +00:00
|
|
|
}
|
|
|
|
else {
|
2022-06-01 22:15:43 +00:00
|
|
|
x86_64-linux = "3a2da2e63bc08ee1886db29c80103c669d3ed6960290b8b97d771232769f282e";
|
|
|
|
x86_64-darwin = "655ab873e16257827f884f67b66d62c4da40a895d06206faa435615ad0a56796";
|
|
|
|
aarch64-linux = "235cf57afb619801808d5fe1bff7e01a4a9b29f77723566e5371b5f3b2bf8fad";
|
2021-08-30 13:50:10 +00:00
|
|
|
};
|
2021-08-31 08:45:44 +00:00
|
|
|
this = stdenv.mkDerivation rec {
|
|
|
|
version = elk7Version;
|
2023-01-24 16:35:54 +00:00
|
|
|
pname = "logstash${lib.optionalString (!enableUnfree) "-oss"}";
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2021-02-26 10:31:39 +00:00
|
|
|
|
2021-08-31 08:45:44 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}-${plat}-${arch}.tar.gz";
|
|
|
|
sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
|
|
|
|
};
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2021-08-31 08:45:44 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchShebangs = true;
|
2012-07-11 11:23:14 +00:00
|
|
|
|
2022-04-05 07:34:48 +00:00
|
|
|
nativeBuildInputs = [
|
2021-08-31 08:45:44 +00:00
|
|
|
makeWrapper
|
2022-04-05 07:34:48 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-08-31 08:45:44 +00:00
|
|
|
jre
|
|
|
|
];
|
2016-10-01 21:11:30 +00:00
|
|
|
|
2021-08-31 08:45:44 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
|
2016-10-01 21:11:30 +00:00
|
|
|
|
2021-08-31 08:45:44 +00:00
|
|
|
patchShebangs $out/bin/logstash
|
|
|
|
patchShebangs $out/bin/logstash-plugin
|
2016-10-01 21:11:30 +00:00
|
|
|
|
2021-08-31 08:45:44 +00:00
|
|
|
wrapProgram $out/bin/logstash \
|
|
|
|
--set JAVA_HOME "${jre}"
|
2016-10-02 07:31:59 +00:00
|
|
|
|
2021-08-31 08:45:44 +00:00
|
|
|
wrapProgram $out/bin/logstash-plugin \
|
|
|
|
--set JAVA_HOME "${jre}"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2014-07-11 16:50:02 +00:00
|
|
|
|
2021-08-31 08:45:44 +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";
|
2022-06-16 23:40:08 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # source bundles dependencies as jars
|
|
|
|
binaryNativeCode # bundled jruby includes native code
|
|
|
|
];
|
2021-08-31 08:45:44 +00:00
|
|
|
license = if enableUnfree then licenses.elastic else licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ wjlroe offline basvandijk ];
|
|
|
|
};
|
|
|
|
passthru.tests =
|
2023-01-24 16:35:54 +00:00
|
|
|
lib.optionalAttrs (config.allowUnfree && enableUnfree) (
|
2021-11-04 12:16:32 +00:00
|
|
|
assert this.drvPath == nixosTests.elk.unfree.ELK-7.elkPackages.logstash.drvPath;
|
2021-08-31 08:45:44 +00:00
|
|
|
{
|
2021-11-04 12:16:32 +00:00
|
|
|
elk = nixosTests.elk.unfree.ELK-7;
|
2021-08-31 08:45:44 +00:00
|
|
|
}
|
|
|
|
);
|
2014-07-11 16:50:02 +00:00
|
|
|
};
|
2021-08-31 08:45:44 +00:00
|
|
|
in
|
|
|
|
this
|