nixpkgs/pkgs/development/compilers/closure/default.nix

32 lines
964 B
Nix
Raw Normal View History

{ stdenv, fetchurl, jre, gnutar, bash }:
stdenv.mkDerivation rec {
name = "closure-compiler-${version}";
2017-03-11 18:37:05 +01:00
version = "20170218";
src = fetchurl {
url = "http://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
2017-03-11 18:37:05 +01:00
sha256 = "06snabmpy07x4xm8d1xgq5dfzbjli10xkxk3nx9jms39zkj493cd";
};
phases = [ "installPhase" ];
buildInputs = [ gnutar ];
installPhase = ''
2014-01-09 13:01:38 +01:00
mkdir -p $out/share/java $out/bin
tar -xzf $src
2017-03-11 18:37:05 +01:00
cp -r closure-compiler-v${version}.jar $out/share/java/
echo "#!${bash}/bin/bash" > $out/bin/closure-compiler
2017-03-11 18:37:05 +01:00
echo "${jre}/bin/java -jar $out/share/java/closure-compiler-v${version}.jar \"\$@\"" >> $out/bin/closure-compiler
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.unix;
};
}