nixpkgs/pkgs/servers/search/elasticsearch/default.nix

44 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper, jre, utillinux, getopt }:
2014-07-05 08:58:08 +00:00
with stdenv.lib;
2013-03-07 11:36:29 +00:00
stdenv.mkDerivation rec {
2015-08-19 22:18:32 +00:00
name = "elasticsearch-1.5.2";
2013-03-07 11:36:29 +00:00
src = fetchurl {
2015-08-19 22:18:32 +00:00
url = "https://download.elastic.co/elasticsearch/elasticsearch/${name}.tar.gz";
sha256 = "054s0k0y0g1x6wzbd6gmvrp5n89fqwqssbyhay0gmhvs6sbpibpg";
2013-03-07 11:36:29 +00:00
};
patches = [ ./es-home.patch ];
buildInputs = [ makeWrapper jre ] ++
(if (!stdenv.isDarwin) then [utillinux] else [getopt]);
2013-08-27 15:58:46 +00:00
2013-03-07 11:36:29 +00:00
installPhase = ''
mkdir -p $out
cp -R bin config lib $out
2013-08-27 15:58:46 +00:00
# don't want to have binary with name plugin
mv $out/bin/plugin $out/bin/elasticsearch-plugin
# set ES_CLASSPATH and JAVA_HOME
wrapProgram $out/bin/elasticsearch \
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
${if (!stdenv.isDarwin)
then ''--prefix PATH : "${utillinux}/bin/"''
else ''--prefix PATH : "${getopt}/bin"''} \
2013-08-27 15:58:46 +00:00
--set JAVA_HOME "${jre}"
wrapProgram $out/bin/elasticsearch-plugin \
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
--set JAVA_HOME "${jre}"
2013-03-07 11:36:29 +00:00
'';
meta = {
description = "Open Source, Distributed, RESTful Search Engine";
2015-08-19 22:18:32 +00:00
license = licenses.asl20;
2014-07-05 10:09:53 +00:00
platforms = platforms.unix;
2015-08-19 22:18:32 +00:00
maintainers = [ maintainers.offline ];
2013-03-07 11:36:29 +00:00
};
}