2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "closure-compiler";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "20220803";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "mirror://maven/com/google/javascript/closure-compiler/v${version}/closure-compiler-v${version}.jar";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-1h+/i2csV/rCdMVOFsoNG/HrzGfUPPEEfAeRUKnPNSs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/java $out/bin
|
2021-08-22 07:53:02 +00:00
|
|
|
cp ${src} $out/share/java/closure-compiler-v${version}.jar
|
2020-04-24 23:36:52 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/closure-compiler \
|
|
|
|
--add-flags "-jar $out/share/java/closure-compiler-v${version}.jar"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A tool for making JavaScript download and run faster";
|
|
|
|
homepage = "https://developers.google.com/closure/compiler/";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|