···1+diff -Naur a/bin/elasticsearch-env b/bin/elasticsearch-env
2+--- a/bin/elasticsearch-env 2017-12-12 13:31:51.000000000 +0100
3++++ b/bin/elasticsearch-env 2017-12-18 19:51:12.282809695 +0100
4+@@ -19,18 +19,10 @@
5+ fi
6+ done
7+8+-# determine Elasticsearch home; to do this, we strip from the path until we find
9+-# bin, and then strip bin (there is an assumption here that there is no nested
10+-# directory under bin also named bin)
11+-ES_HOME=`dirname "$SCRIPT"`
12+-
13+-# now make ES_HOME absolute
14+-ES_HOME=`cd "$ES_HOME"; pwd`
15+-
16+-while [ "`basename "$ES_HOME"`" != "bin" ]; do
17+- ES_HOME=`dirname "$ES_HOME"`
18+-done
19+-ES_HOME=`dirname "$ES_HOME"`
20++if [ -z "$ES_HOME" ]; then
21++ echo "You must set the ES_HOME var" >&2
22++ exit 1
23++fi
24+25+ # now set the classpath
26+ ES_CLASSPATH="$ES_HOME/lib/*"
+39
pkgs/tools/misc/logstash/6.x.nix
···000000000000000000000000000000000000000
···1+{ stdenv, fetchurl, elk6Version, makeWrapper, jre }:
2+3+stdenv.mkDerivation rec {
4+ version = elk6Version;
5+ name = "logstash-${version}";
6+7+ src = fetchurl {
8+ url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz";
9+ sha256 = "1s2w8d2siryg2wy8i9lwqbp4mjf1sv80lf3sllxwa2vqwsv6l64p";
10+ };
11+12+ dontBuild = true;
13+ dontPatchELF = true;
14+ dontStrip = true;
15+ dontPatchShebangs = true;
16+17+ buildInputs = [
18+ makeWrapper jre
19+ ];
20+21+ installPhase = ''
22+ mkdir -p $out
23+ cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
24+25+ wrapProgram $out/bin/logstash \
26+ --set JAVA_HOME "${jre}"
27+28+ wrapProgram $out/bin/logstash-plugin \
29+ --set JAVA_HOME "${jre}"
30+ '';
31+32+ meta = with stdenv.lib; {
33+ description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
34+ homepage = https://www.elastic.co/products/logstash;
35+ license = licenses.asl20;
36+ platforms = platforms.unix;
37+ maintainers = with maintainers; [ wjlroe offline basvandijk ];
38+ };
39+}