2013-07-01 16:52:57 +04:00
|
|
|
{ stdenv, fetchurl, jre, gnutar, bash }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "closure-compiler-${version}";
|
2016-02-10 17:50:59 +03:00
|
|
|
version = "20160208";
|
2013-07-01 16:52:57 +04:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
|
2016-02-10 17:50:59 +03:00
|
|
|
sha256 = "19v9z8lfxfmhc4cl9fys7vnaslqiznjy1jpk5mcv468p7vysg46p";
|
2013-07-01 16:52:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
buildInputs = [ gnutar ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-09 16:01:38 +04:00
|
|
|
mkdir -p $out/share/java $out/bin
|
2013-07-01 16:52:57 +04:00
|
|
|
tar -xzf $src
|
2014-01-09 16:01:38 +04:00
|
|
|
cp -r compiler.jar $out/share/java/
|
2013-07-01 16:52:57 +04:00
|
|
|
echo "#!${bash}/bin/bash" > $out/bin/closure-compiler
|
2014-01-09 16:01:38 +04:00
|
|
|
echo "${jre}/bin/java -jar $out/share/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler
|
2013-07-01 16:52:57 +04:00
|
|
|
chmod +x $out/bin/closure-compiler
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A tool for making JavaScript download and run faster";
|
|
|
|
homepage = https://developers.google.com/closure/compiler/;
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
2015-12-09 11:48:15 +03:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2013-07-01 16:52:57 +04:00
|
|
|
};
|
|
|
|
}
|