From d2590d9d9e7588361e16d1e00d35db6a806f04f3 Mon Sep 17 00:00:00 2001 From: Chris Van Vranken Date: Thu, 29 Sep 2016 21:55:25 -0400 Subject: [PATCH] logstash: wrapProgram to provide jre at runtime --- pkgs/tools/misc/logstash/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/logstash/default.nix b/pkgs/tools/misc/logstash/default.nix index e8f3ccf747d6..afc7fe71cd92 100644 --- a/pkgs/tools/misc/logstash/default.nix +++ b/pkgs/tools/misc/logstash/default.nix @@ -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; {