nixpkgs/pkgs/development/compilers/closure/default.nix

31 lines
880 B
Nix
Raw Normal View History

2017-09-26 23:19:56 +01:00
{ stdenv, fetchurl, jre, makeWrapper }:
stdenv.mkDerivation rec {
name = "closure-compiler-${version}";
version = "20180506";
src = fetchurl {
2017-09-26 23:19:56 +01:00
url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
sha256 = "10w9vs61fs14k8g3wlng0ifj0knfm0xfc4rsnd2c75464hkdxvr9";
};
2017-09-26 23:19:56 +01:00
sourceRoot = ".";
2017-09-26 23:19:56 +01:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
installPhase = ''
2014-01-09 12:01:38 +00:00
mkdir -p $out/share/java $out/bin
2017-09-26 23:19:56 +01:00
cp closure-compiler-v${version}.jar $out/share/java
makeWrapper ${jre}/bin/java $out/bin/closure-compiler \
--add-flags "-jar $out/share/java/closure-compiler-v${version}.jar"
'';
2017-09-26 23:19:56 +01:00
meta = with stdenv.lib; {
description = "A tool for making JavaScript download and run faster";
homepage = https://developers.google.com/closure/compiler/;
2017-09-26 23:19:56 +01:00
license = licenses.asl20;
platforms = platforms.all;
};
}