From ea0f8fbd5306776e3e31b4ee849188bfd67fa11d Mon Sep 17 00:00:00 2001 From: Christopher League Date: Thu, 12 Jan 2017 23:08:55 -0500 Subject: [PATCH] yuicompressor: add bin wrapper for jar yuicompressor is a JavaScript and CSS minifier, distributed as a jar file. This change uses `makeWrapper` to create a corresponding bin script, adding `jre` as a dependency. --- pkgs/development/tools/yuicompressor/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/yuicompressor/default.nix b/pkgs/development/tools/yuicompressor/default.nix index 1a5485af541d..da9b9df3cd4e 100644 --- a/pkgs/development/tools/yuicompressor/default.nix +++ b/pkgs/development/tools/yuicompressor/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, makeWrapper, jre }: stdenv.mkDerivation rec { name = "yuicompressor"; @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1qjxlak9hbl9zd3dl5ks0w4zx5z64wjsbk7ic73r1r45fasisdrh"; }; + buildInputs = [makeWrapper jre]; + meta = { description = "A JavaScript and CSS minifier"; maintainers = [ stdenv.lib.maintainers.jwiegley ]; @@ -17,7 +19,9 @@ stdenv.mkDerivation rec { }; buildCommand = '' - mkdir -p $out/lib + mkdir -p $out/{bin,lib} ln -s $src $out/lib/yuicompressor.jar + makeWrapper ${jre}/bin/java $out/bin/${name} --add-flags \ + "-cp $out/lib/yuicompressor.jar com.yahoo.platform.yui.compressor.YUICompressor" ''; }