nixpkgs/pkgs/tools/networking/linkchecker/default.nix
Peter Hoeg b120ef422c linkchecker: make it work with newer requests2
linkchecker has an odd version check for requests2 that fails on
versions > 2.9.x.

We patch out the check as we are providing a recent requests2. This
patch should be dropped when linkchecker >v9.3 is released.

We now also run the tests although I had to remove one failing test.
Yes, that's covering up the issue but we're still better off than
before.
2016-10-11 11:02:52 +08:00

39 lines
1.1 KiB
Nix

{ stdenv, lib, fetchurl, python2Packages, gettext }:
python2Packages.buildPythonApplication rec {
name = "LinkChecker-${version}";
version = "9.3";
buildInputs = with python2Packages ; [ pytest ];
propagatedBuildInputs = with python2Packages ; [ requests2 ] ++ [ gettext ];
src = fetchurl {
url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
};
# 1. upstream refuses to support ignoring robots.txt
# 2. work around requests2 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
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 ];
};
}