at 18.09-beta 886 B view raw
1{ stdenv, fetchurl, compressed ? true }: 2 3with stdenv.lib; 4 5stdenv.mkDerivation rec { 6 name = "jquery-1.11.3"; 7 8 src = if compressed then 9 fetchurl { 10 url = "http://code.jquery.com/${name}.min.js"; 11 sha256 = "1f4glgxxn3jnvry3dpzmazj3207baacnap5w20gr2xlk789idfgc"; 12 } 13 else 14 fetchurl { 15 url = "http://code.jquery.com/${name}.js"; 16 sha256 = "1v956yf5spw0156rni5z77hzqwmby7ajwdcd6mkhb6zvl36awr90"; 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}