2021-01-22 11:25:31 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper }:
|
2013-07-01 12:52:57 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "closure-compiler";
|
2021-08-18 20:40:40 +00:00
|
|
|
version = "20210808";
|
2013-07-01 12:52:57 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-11-06 01:56:39 +00:00
|
|
|
url = "mirror://maven/com/google/javascript/closure-compiler/v${version}/closure-compiler-v${version}.jar";
|
2021-08-18 20:40:40 +00:00
|
|
|
sha256 = "1cvibvm8l4mp64ml6lpsh3w62bgbr42pi3i7ga8ss0prhr0dsk3y";
|
2013-07-01 12:52:57 +00:00
|
|
|
};
|
|
|
|
|
2021-08-18 20:40:40 +00:00
|
|
|
dontUnpack = true;
|
2013-07-01 12:52:57 +00:00
|
|
|
|
2017-09-26 22:19:56 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2013-07-01 12:52:57 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-09 12:01:38 +00:00
|
|
|
mkdir -p $out/share/java $out/bin
|
2021-08-18 20:40:40 +00:00
|
|
|
cp ${src} $out/share/java/closure-compiler-v${version}.jar
|
2017-09-26 22:19:56 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/closure-compiler \
|
|
|
|
--add-flags "-jar $out/share/java/closure-compiler-v${version}.jar"
|
2013-07-01 12:52:57 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2013-07-01 12:52:57 +00:00
|
|
|
description = "A tool for making JavaScript download and run faster";
|
2020-03-04 18:56:56 +00:00
|
|
|
homepage = "https://developers.google.com/closure/compiler/";
|
2017-09-26 22:19:56 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
2013-07-01 12:52:57 +00:00
|
|
|
};
|
|
|
|
}
|