2016-10-11 04:02:52 +01:00
|
|
|
{ stdenv, lib, fetchurl, python2Packages, gettext }:
|
2016-05-26 10:20:30 +01:00
|
|
|
|
|
|
|
python2Packages.buildPythonApplication rec {
|
|
|
|
name = "LinkChecker-${version}";
|
|
|
|
version = "9.3";
|
|
|
|
|
2016-10-11 04:02:52 +01:00
|
|
|
buildInputs = with python2Packages ; [ pytest ];
|
2017-05-07 11:55:45 +01:00
|
|
|
propagatedBuildInputs = with python2Packages ; [ requests ] ++ [ gettext ];
|
2016-05-26 10:20:30 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
|
|
|
|
sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
|
|
|
|
};
|
|
|
|
|
2016-10-11 04:02:52 +01:00
|
|
|
# 1. upstream refuses to support ignoring robots.txt
|
2017-05-07 11:55:45 +01:00
|
|
|
# 2. work around requests version detection - can be dropped >v9.3
|
2016-05-26 10:20:30 +01:00
|
|
|
patches = [
|
|
|
|
./add-no-robots-flag.patch
|
2016-10-11 04:02:52 +01:00
|
|
|
./no-version-check.patch
|
2016-05-26 10:20:30 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm $out/bin/linkchecker-gui
|
|
|
|
'';
|
|
|
|
|
2016-10-11 04:02:52 +01:00
|
|
|
checkPhase = ''
|
|
|
|
# the mime test fails for me...
|
|
|
|
rm tests/test_mimeutil.py
|
2017-02-26 11:21:24 +00:00
|
|
|
${lib.optionalString stdenv.isDarwin ''
|
|
|
|
# network tests fails on darwin
|
|
|
|
rm tests/test_network.py
|
|
|
|
''}
|
2016-10-11 04:02:52 +01:00
|
|
|
make test PYTESTOPTS="--tb=short" TESTS="tests/test_*.py tests/logger/test_*.py"
|
|
|
|
'';
|
|
|
|
|
2016-05-26 10:20:30 +01:00
|
|
|
meta = {
|
|
|
|
description = "Check websites for broken links";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://wummel.github.io/linkchecker/;
|
2016-05-26 10:20:30 +01:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [ peterhoeg ];
|
|
|
|
};
|
|
|
|
}
|