logstash: wrapProgram to provide jre at runtime

This commit is contained in:
Chris Van Vranken 2016-09-29 21:55:25 -04:00 committed by Jörg Thalheim
parent 5bf5de58ea
commit d2590d9d9e
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, makeWrapper, jre }:
stdenv.mkDerivation rec {
version = "2.3.4";
@ -14,10 +14,20 @@ stdenv.mkDerivation rec {
dontStrip = true;
dontPatchShebangs = true;
buildInputs = [
makeWrapper jre
];
installPhase = ''
mkdir -p $out
cp -r {Gemfile*,vendor,lib,bin} $out
mv $out/bin/plugin $out/bin/logstash-plugin
wrapProgram $out/bin/logstash \
--set JAVA_HOME "${jre}"
wrapProgram $out/bin/rspec \
--set JAVA_HOME "${jre}"
'';
meta = with stdenv.lib; {