2017-09-28 02:16:32 +00:00
|
|
|
{ stdenv, fetchurl, elk5Version, makeWrapper, jre_headless, utillinux, getopt }:
|
2017-05-17 12:46:16 +00:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-06-13 20:36:08 +00:00
|
|
|
version = elk5Version;
|
2017-05-17 12:46:16 +00:00
|
|
|
name = "elasticsearch-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://artifacts.elastic.co/downloads/elasticsearch/${name}.tar.gz";
|
2018-01-17 00:27:23 +00:00
|
|
|
sha256 = "0wjjvzjbdgdv9qznk1b8dx63zgs7s6jnrrbrnd5dn27lhymxiwpl";
|
2017-05-17 12:46:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./es-home-5.x.patch ./es-classpath-5.x.patch ];
|
|
|
|
|
2017-09-28 02:16:32 +00:00
|
|
|
buildInputs = [ makeWrapper jre_headless ] ++
|
2017-05-17 12:46:16 +00:00
|
|
|
(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"''} \
|
2017-09-28 02:16:32 +00:00
|
|
|
--set JAVA_HOME "${jre_headless}" \
|
2017-05-17 12:46:16 +00:00
|
|
|
--set ES_JVM_OPTIONS "$out/config/jvm.options"
|
|
|
|
|
2017-09-28 02:16:32 +00:00
|
|
|
wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}"
|
2017-05-17 12:46:16 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Open Source, Distributed, RESTful Search Engine";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [
|
|
|
|
maintainers.apeschar
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|