nixpkgs/pkgs/by-name/cl/closurecompiler/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1007 B
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, jre, makeWrapper }:
stdenv.mkDerivation rec {
pname = "closure-compiler";
2024-03-23 02:11:18 +00:00
version = "20240317";
src = fetchurl {
url = "mirror://maven/com/google/javascript/closure-compiler/v${version}/closure-compiler-v${version}.jar";
2024-03-23 02:11:18 +00:00
sha256 = "sha256-axJQrCHAW90gncUV2bYDezC1VVooTddB/wWRqChIt84=";
};
2021-08-18 20:40:40 +00:00
dontUnpack = true;
2017-09-26 22:19:56 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
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"
'';
meta = with lib; {
description = "Tool for making JavaScript download and run faster";
mainProgram = "closure-compiler";
2020-03-04 18:56:56 +00:00
homepage = "https://developers.google.com/closure/compiler/";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2017-09-26 22:19:56 +00:00
license = licenses.asl20;
platforms = platforms.all;
};
}