2013-07-01 14:52:57 +02:00
|
|
|
{ stdenv, fetchurl, jre, gnutar, bash }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "closure-compiler-${version}";
|
|
|
|
version = "20130603";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
|
|
|
|
sha256 = "0bk0s8p9r9an5m0l8y23wjlx490k15i4zah0a384a2akzji8y095";
|
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
buildInputs = [ gnutar ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-09 13:01:38 +01:00
|
|
|
mkdir -p $out/share/java $out/bin
|
2013-07-01 14:52:57 +02:00
|
|
|
tar -xzf $src
|
2014-01-09 13:01:38 +01:00
|
|
|
cp -r compiler.jar $out/share/java/
|
2013-07-01 14:52:57 +02:00
|
|
|
echo "#!${bash}/bin/bash" > $out/bin/closure-compiler
|
2014-01-09 13:01:38 +01:00
|
|
|
echo "${jre}/bin/java -jar $out/share/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler
|
2013-07-01 14:52:57 +02: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;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|