about summary refs log tree commit diff
path: root/pkgs/servers/search/elasticsearch/5.x.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/search/elasticsearch/5.x.nix')
-rw-r--r--pkgs/servers/search/elasticsearch/5.x.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/servers/search/elasticsearch/5.x.nix b/pkgs/servers/search/elasticsearch/5.x.nix
new file mode 100644
index 000000000000..030c4730f38e
--- /dev/null
+++ b/pkgs/servers/search/elasticsearch/5.x.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, makeWrapper, jre, utillinux, getopt }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  version = "5.4.0";
+  name = "elasticsearch-${version}";
+
+  src = fetchurl {
+    url = "https://artifacts.elastic.co/downloads/elasticsearch/${name}.tar.gz";
+    sha256 = "1ml2dvwxxhj3azj13wa8xd08kpapal2477lpcaxzw5gnzizgyx5z";
+  };
+
+  patches = [ ./es-home-5.x.patch ./es-classpath-5.x.patch ];
+
+  buildInputs = [ makeWrapper jre ] ++
+    (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 \
+      --prefix ES_CLASSPATH : "$out/lib/*" \
+      ${if (!stdenv.isDarwin)
+        then ''--prefix PATH : "${utillinux}/bin/"''
+        else ''--prefix PATH : "${getopt}/bin"''} \
+      --set JAVA_HOME "${jre}" \
+      --set ES_JVM_OPTIONS "$out/config/jvm.options"
+
+    wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre}"
+  '';
+
+  meta = {
+    description = "Open Source, Distributed, RESTful Search Engine";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = [
+      maintainers.apeschar
+    ];
+  };
+}