2017-12-18 19:53:54 +00:00
|
|
|
{ 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";
|
2018-01-17 00:03:31 +00:00
|
|
|
sha256 = "03xwd8r0l0a29wl6wrp4bh7xr1b79q2rqfmsq3d5k35pv85sw3lw";
|
2017-12-18 19:53:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|