summary refs log tree commit diff
path: root/pkgs/servers/search/elasticsearch
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2017-12-18 20:53:54 +0100
committerBas van Dijk <v.dijk.bas@gmail.com>2018-01-02 01:15:29 +0100
commit803077ef1cdac1dc7f0bc9224adbb0de45f6bffc (patch)
tree014a53c7cb1b8c9367af266ab9212ee2074892f6 /pkgs/servers/search/elasticsearch
parent95913d27689c506da5f3716394f1814ba66e9f50 (diff)
downloadnixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.tar
nixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.tar.gz
nixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.tar.bz2
nixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.tar.lz
nixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.tar.xz
nixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.tar.zst
nixlib-803077ef1cdac1dc7f0bc9224adbb0de45f6bffc.zip
elk: add elasticsearch6, logstash6, kibana6 and the beats at v6.1.0
This change is backwards compatible since the ELK tools at version 5.x
remain unchanged.

The test suite now both tests ELK-5 and ELK-6.
Diffstat (limited to 'pkgs/servers/search/elasticsearch')
-rw-r--r--pkgs/servers/search/elasticsearch/6.x.nix45
-rw-r--r--pkgs/servers/search/elasticsearch/es-home-6.x.patch26
2 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/servers/search/elasticsearch/6.x.nix b/pkgs/servers/search/elasticsearch/6.x.nix
new file mode 100644
index 000000000000..3b7ff42d4e32
--- /dev/null
+++ b/pkgs/servers/search/elasticsearch/6.x.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, elk6Version, makeWrapper, jre_headless, utillinux, getopt }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  version = elk6Version;
+  name = "elasticsearch-${version}";
+
+  src = fetchurl {
+    url = "https://artifacts.elastic.co/downloads/elasticsearch/${name}.tar.gz";
+    sha256 = "1mq8lnpv5y82a7d8vxn5np6hrg2pys22v85l5l9jynk3k0kgwyf8";
+  };
+
+  patches = [ ./es-home-6.x.patch ];
+
+  postPatch = ''
+    sed -i "s|ES_CLASSPATH=\"\$ES_HOME/lib/\*\"|ES_CLASSPATH=\"$out/lib/*\"|" ./bin/elasticsearch-env
+  '';
+
+  buildInputs = [ makeWrapper jre_headless ] ++
+    (if (!stdenv.isDarwin) then [utillinux] else [getopt]);
+
+  installPhase = ''
+    mkdir -p $out
+    cp -R bin config lib modules plugins $out
+
+    chmod -x $out/bin/*.*
+
+    wrapProgram $out/bin/elasticsearch \
+      ${if (!stdenv.isDarwin)
+        then ''--prefix PATH : "${utillinux}/bin/"''
+        else ''--prefix PATH : "${getopt}/bin"''} \
+      --set JAVA_HOME "${jre_headless}" \
+      --set ES_JVM_OPTIONS "$out/config/jvm.options"
+
+    wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}"
+  '';
+
+  meta = {
+    description = "Open Source, Distributed, RESTful Search Engine";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ apeschar basvandijk ];
+  };
+}
diff --git a/pkgs/servers/search/elasticsearch/es-home-6.x.patch b/pkgs/servers/search/elasticsearch/es-home-6.x.patch
new file mode 100644
index 000000000000..aba8d396a69c
--- /dev/null
+++ b/pkgs/servers/search/elasticsearch/es-home-6.x.patch
@@ -0,0 +1,26 @@
+diff -Naur a/bin/elasticsearch-env b/bin/elasticsearch-env
+--- a/bin/elasticsearch-env	2017-12-12 13:31:51.000000000 +0100
++++ b/bin/elasticsearch-env	2017-12-18 19:51:12.282809695 +0100
+@@ -19,18 +19,10 @@
+   fi
+ done
+ 
+-# determine Elasticsearch home; to do this, we strip from the path until we find
+-# bin, and then strip bin (there is an assumption here that there is no nested
+-# directory under bin also named bin)
+-ES_HOME=`dirname "$SCRIPT"`
+-
+-# now make ES_HOME absolute
+-ES_HOME=`cd "$ES_HOME"; pwd`
+-
+-while [ "`basename "$ES_HOME"`" != "bin" ]; do
+-  ES_HOME=`dirname "$ES_HOME"`
+-done
+-ES_HOME=`dirname "$ES_HOME"`
++if [ -z "$ES_HOME" ]; then
++    echo "You must set the ES_HOME var" >&2
++    exit 1
++fi
+ 
+ # now set the classpath
+ ES_CLASSPATH="$ES_HOME/lib/*"