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