summary refs log tree commit diff
path: root/pkgs/tools/networking/linkchecker/default.nix
blob: 686242aa0670d24ea8b78ad07bf2a31e73df1f6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ stdenv, lib, fetchurl, python2Packages, gettext }:

python2Packages.buildPythonApplication rec {
  name = "LinkChecker-${version}";
  version = "9.3";

  buildInputs = with python2Packages ; [ pytest ];
  propagatedBuildInputs = with python2Packages ; [ requests ] ++ [ gettext ];

  src = fetchurl {
    url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
    sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
  };

  # 1. upstream refuses to support ignoring robots.txt
  # 2. work around requests version detection - can be dropped >v9.3
  patches = [
    ./add-no-robots-flag.patch
    ./no-version-check.patch
  ];

  postInstall = ''
    rm $out/bin/linkchecker-gui
  '';

  checkPhase = ''
    # the mime test fails for me...
    rm tests/test_mimeutil.py
    ${lib.optionalString stdenv.isDarwin ''
    # network tests fails on darwin
    rm tests/test_network.py
    ''}
    make test PYTESTOPTS="--tb=short" TESTS="tests/test_*.py tests/logger/test_*.py"
  '';

  meta = {
    description = "Check websites for broken links";
    homepage = https://wummel.github.io/linkchecker/;
    license = lib.licenses.gpl2;
    maintainers = with lib.maintainers; [ peterhoeg ];
  };
}