1{ stdenv, fetchurl, compressed ? true }: 2 3with stdenv.lib; 4 5stdenv.mkDerivation rec { 6 name = "jquery-1.11.2"; 7 8 src = if compressed then 9 fetchurl { 10 url = "http://code.jquery.com/${name}.min.js"; 11 sha256 = "1h09zz6cjm66g30wa7c41by1jswx9gjpgqgbxln0dv2v55fjkk9f"; 12 } 13 else 14 fetchurl { 15 url = "http://code.jquery.com/${name}.js"; 16 sha256 = "098gnzndmmjygpsfywxgmb0vi42b882pwpby77gqkrd2nwsp1hjq"; 17 }; 18 19 unpackPhase = "true"; 20 21 installPhase = 22 '' 23 mkdir -p "$out/js" 24 cp -v "$src" "$out/js/jquery.js" 25 ${optionalString compressed '' 26 (cd "$out/js" && ln -s jquery.js jquery.min.js) 27 ''} 28 ''; 29 30 meta = with stdenv.lib; { 31 description = "JavaScript library designed to simplify the client-side scripting of HTML"; 32 homepage = http://jquery.com/; 33 license = licenses.mit; 34 platforms = platforms.all; 35 }; 36}