2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "closure-compiler";
|
2020-05-15 21:57:56 +00:00
|
|
|
version = "20200406";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
|
2020-05-15 21:57:56 +00:00
|
|
|
sha256 = "1dd6fakavnadpm8h8r4d1saf9flm7ilhknfy0q6i5i237psjf7i5";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/java $out/bin
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A tool for making JavaScript download and run faster";
|
|
|
|
homepage = "https://developers.google.com/closure/compiler/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|