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