diff options
Diffstat (limited to 'pkgs/servers/search/elasticsearch')
-rw-r--r-- | pkgs/servers/search/elasticsearch/5.x.nix | 44 | ||||
-rw-r--r-- | pkgs/servers/search/elasticsearch/es-classpath-5.x.patch | 34 | ||||
-rw-r--r-- | pkgs/servers/search/elasticsearch/es-home-5.x.patch | 31 |
3 files changed, 109 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 + ]; + }; +} diff --git a/pkgs/servers/search/elasticsearch/es-classpath-5.x.patch b/pkgs/servers/search/elasticsearch/es-classpath-5.x.patch new file mode 100644 index 000000000000..6898ffcf1d79 --- /dev/null +++ b/pkgs/servers/search/elasticsearch/es-classpath-5.x.patch @@ -0,0 +1,34 @@ +diff -rupN a/bin/elasticsearch b/bin/elasticsearch +--- a/bin/elasticsearch 2017-05-17 10:53:49.444487071 +0200 ++++ b/bin/elasticsearch 2017-05-17 10:55:52.755081523 +0200 +@@ -129,12 +129,7 @@ ES_JAVA_OPTS="$(parse_jvm_options "$ES_J + # If an include wasn't specified in the environment, then search for one... + if [ "x$ES_INCLUDE" = "x" ]; then + # Locations (in order) to use when searching for an include file. +- for include in /usr/share/elasticsearch/elasticsearch.in.sh \ +- /usr/local/share/elasticsearch/elasticsearch.in.sh \ +- /opt/elasticsearch/elasticsearch.in.sh \ +- ~/.elasticsearch.in.sh \ +- "$ES_HOME/bin/elasticsearch.in.sh" \ +- "`dirname "$0"`"/elasticsearch.in.sh; do ++ for include in "`dirname "$0"`"/elasticsearch.in.sh; do + if [ -r "$include" ]; then + . "$include" + break +diff -rupN a/bin/elasticsearch.in.sh b/bin/elasticsearch.in.sh +--- a/bin/elasticsearch.in.sh 2017-04-28 19:41:47.000000000 +0200 ++++ b/bin/elasticsearch.in.sh 2017-05-17 10:56:49.303519788 +0200 +@@ -1,13 +1 @@ + #!/bin/bash +- +-# check in case a user was using this mechanism +-if [ "x$ES_CLASSPATH" != "x" ]; then +- cat >&2 << EOF +-Error: Don't modify the classpath with ES_CLASSPATH. Best is to add +-additional elements via the plugin mechanism, or if code must really be +-added to the main classpath, add jars to lib/ (unsupported). +-EOF +- exit 1 +-fi +- +-ES_CLASSPATH="$ES_HOME/lib/*" diff --git a/pkgs/servers/search/elasticsearch/es-home-5.x.patch b/pkgs/servers/search/elasticsearch/es-home-5.x.patch new file mode 100644 index 000000000000..cee0137312f1 --- /dev/null +++ b/pkgs/servers/search/elasticsearch/es-home-5.x.patch @@ -0,0 +1,31 @@ +diff -rupN a/bin/elasticsearch b/bin/elasticsearch +--- a/bin/elasticsearch 2017-05-17 10:53:42.214686741 +0200 ++++ b/bin/elasticsearch 2017-05-17 10:53:49.444487071 +0200 +@@ -105,7 +105,11 @@ while [ -h "$SCRIPT" ] ; do + done + + # determine elasticsearch home +-ES_HOME=`dirname "$SCRIPT"`/.. ++ ++if [ -z "$ES_HOME" ]; then ++ echo "You must set the ES_HOME var" >&2 ++ exit 1 ++fi + + # make ELASTICSEARCH_HOME absolute + ES_HOME=`cd "$ES_HOME"; pwd` +diff -rupN a/bin/elasticsearch-plugin b/bin/elasticsearch-plugin +--- a/bin/elasticsearch-plugin 2017-05-17 10:53:42.214686741 +0200 ++++ b/bin/elasticsearch-plugin 2017-05-17 10:53:49.445487044 +0200 +@@ -16,7 +16,10 @@ while [ -h "$SCRIPT" ] ; do + done + + # determine elasticsearch home +-ES_HOME=`dirname "$SCRIPT"`/.. ++if [ -z "$ES_HOME" ]; then ++ echo "You must set the ES_HOME var" >&2 ++ exit 1 ++fi + + # make ELASTICSEARCH_HOME absolute + ES_HOME=`cd "$ES_HOME"; pwd` |