···11+diff -Naur a/bin/elasticsearch-env b/bin/elasticsearch-env
22+--- a/bin/elasticsearch-env 2017-12-12 13:31:51.000000000 +0100
33++++ b/bin/elasticsearch-env 2017-12-18 19:51:12.282809695 +0100
44+@@ -19,18 +19,10 @@
55+ fi
66+ done
77+88+-# determine Elasticsearch home; to do this, we strip from the path until we find
99+-# bin, and then strip bin (there is an assumption here that there is no nested
1010+-# directory under bin also named bin)
1111+-ES_HOME=`dirname "$SCRIPT"`
1212+-
1313+-# now make ES_HOME absolute
1414+-ES_HOME=`cd "$ES_HOME"; pwd`
1515+-
1616+-while [ "`basename "$ES_HOME"`" != "bin" ]; do
1717+- ES_HOME=`dirname "$ES_HOME"`
1818+-done
1919+-ES_HOME=`dirname "$ES_HOME"`
2020++if [ -z "$ES_HOME" ]; then
2121++ echo "You must set the ES_HOME var" >&2
2222++ exit 1
2323++fi
2424+2525+ # now set the classpath
2626+ ES_CLASSPATH="$ES_HOME/lib/*"
+39
pkgs/tools/misc/logstash/6.x.nix
···11+{ stdenv, fetchurl, elk6Version, makeWrapper, jre }:
22+33+stdenv.mkDerivation rec {
44+ version = elk6Version;
55+ name = "logstash-${version}";
66+77+ src = fetchurl {
88+ url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz";
99+ sha256 = "1s2w8d2siryg2wy8i9lwqbp4mjf1sv80lf3sllxwa2vqwsv6l64p";
1010+ };
1111+1212+ dontBuild = true;
1313+ dontPatchELF = true;
1414+ dontStrip = true;
1515+ dontPatchShebangs = true;
1616+1717+ buildInputs = [
1818+ makeWrapper jre
1919+ ];
2020+2121+ installPhase = ''
2222+ mkdir -p $out
2323+ cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out
2424+2525+ wrapProgram $out/bin/logstash \
2626+ --set JAVA_HOME "${jre}"
2727+2828+ wrapProgram $out/bin/logstash-plugin \
2929+ --set JAVA_HOME "${jre}"
3030+ '';
3131+3232+ meta = with stdenv.lib; {
3333+ description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems";
3434+ homepage = https://www.elastic.co/products/logstash;
3535+ license = licenses.asl20;
3636+ platforms = platforms.unix;
3737+ maintainers = with maintainers; [ wjlroe offline basvandijk ];
3838+ };
3939+}