elasticsearch: fix darwin, needs getopt

This commit is contained in:
Jaka Hudoklin 2014-08-16 12:53:12 +02:00
parent 68c7662e98
commit 953643bb0f

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, jre, utillinux }: { stdenv, fetchurl, makeWrapper, jre, utillinux, getopt }:
with stdenv.lib; with stdenv.lib;
@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
patches = [ ./es-home.patch ]; patches = [ ./es-home.patch ];
buildInputs = [ makeWrapper jre ] ++ optional (!stdenv.isDarwin) utillinux; buildInputs = [ makeWrapper jre ] ++
(if (!stdenv.isDarwin) then [utillinux] else [getopt]);
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
@ -24,10 +25,13 @@ stdenv.mkDerivation rec {
# set ES_CLASSPATH and JAVA_HOME # set ES_CLASSPATH and JAVA_HOME
wrapProgram $out/bin/elasticsearch \ wrapProgram $out/bin/elasticsearch \
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \ --prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
${optionalString (!stdenv.isDarwin) ''--prefix PATH : "${utillinux}/bin/"''} \ ${if (!stdenv.isDarwin)
then ''--prefix PATH : "${utillinux}/bin/"''
else ''--prefix PATH : "${getopt}/bin"''} \
--set JAVA_HOME "${jre}" --set JAVA_HOME "${jre}"
wrapProgram $out/bin/elasticsearch-plugin \ wrapProgram $out/bin/elasticsearch-plugin \
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" --set JAVA_HOME "${jre}" --prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
--set JAVA_HOME "${jre}"
''; '';
meta = { meta = {