1{ autoconf, fetchurl, makedepend, perl, python3, lib, stdenv, zip }:
2
3stdenv.mkDerivation rec {
4 pname = "jscoverage";
5 version = "0.5.1";
6
7 src = fetchurl {
8 url = "https://siliconforks.com/${pname}/download/${pname}-${version}.tar.bz2";
9 sha256 = "c45f051cec18c10352f15f9844f47e37e8d121d5fd16680e2dd0f3b4420eb7f4";
10 };
11
12 patches = [
13 ./jsfalse_to_null.patch
14 ];
15
16 nativeBuildInputs = [ perl python3 zip ];
17
18 strictDeps = true;
19
20 # It works without MOZ_FIX_LINK_PATHS, circumventing an impurity
21 # issue. Maybe we could kick js/ (spidermonkey) completely and
22 # instead use our spidermonkey via nix.
23 preConfigure = ''
24 sed -i 's/^MOZ_FIX_LINK_PATHS=.*$/MOZ_FIX_LINK_PATHS=""/' ./js/configure
25 '';
26
27 meta = {
28 description = "Code coverage for JavaScript";
29
30 longDescription = ''
31 JSCoverage is a tool that measures code coverage for JavaScript
32 programs.
33
34 Code coverage statistics show which lines of a program have been
35 executed (and which have been missed). This information is useful
36 for constructing comprehensive test suites (hence, it is often
37 called test coverage).
38
39 JSCoverage works by instrumenting the JavaScript code used in web
40 pages. Code coverage statistics are collected while the
41 instrumented JavaScript code is executed in a web browser.
42
43 JSCoverage supports the complete language syntax described in the
44 ECMAScript Language Specification (ECMA-262, 3rd
45 edition). JSCoverage works with any modern standards-compliant web
46 browser - including Internet Explorer (IE 6, 7, and 8), Firefox,
47 Opera, Safari, and Google Chrome - on Microsoft Windows and
48 GNU/Linux.
49 '';
50
51 homepage = "http://siliconforks.com/jscoverage/";
52 license = lib.licenses.gpl2;
53 platforms = lib.platforms.linux;
54 };
55}