mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
31 lines
872 B
Nix
31 lines
872 B
Nix
{ stdenv, fetchurl, jre, makeWrapper }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "closure-compiler";
|
|
version = "20200719";
|
|
|
|
src = fetchurl {
|
|
url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
|
|
sha256 = "18095i98mk5kc1vpaf6gvmvhiyl2x4zrcwd7ix5l98jydldiz7wx";
|
|
};
|
|
|
|
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;
|
|
};
|
|
}
|