Merge pull request #19442 from peterhoeg/lc
linkchecker: make it work with newer requests2
This commit is contained in:
commit
f3c6236eb4
|
@ -1,26 +1,34 @@
|
|||
{ stdenv, lib, fetchurl, python2Packages }:
|
||||
{ stdenv, lib, fetchurl, python2Packages, gettext }:
|
||||
|
||||
python2Packages.buildPythonApplication rec {
|
||||
name = "LinkChecker-${version}";
|
||||
version = "9.3";
|
||||
|
||||
# LinkChecker 9.3 only works with requests 2.9.x
|
||||
propagatedBuildInputs = with python2Packages ; [ requests2 ];
|
||||
buildInputs = with python2Packages ; [ pytest ];
|
||||
propagatedBuildInputs = with python2Packages ; [ requests2 ] ++ [ gettext ];
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
|
||||
sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
|
||||
};
|
||||
|
||||
# upstream refuses to support ignoring robots.txt
|
||||
# 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/";
|
||||
|
|
14
pkgs/tools/networking/linkchecker/no-version-check.patch
Normal file
14
pkgs/tools/networking/linkchecker/no-version-check.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff --git a/linkcheck/__init__.py b/linkcheck/__init__.py
|
||||
--- a/linkcheck/__init__.py 2014-07-16 13:34:58.000000000 +0800
|
||||
+++ b/linkcheck/__init__.py 2016-10-11 10:42:08.914085950 +0800
|
||||
@@ -26,8 +26,8 @@
|
||||
sys.version_info < (2, 7, 2, 'final', 0)):
|
||||
raise SystemExit("This program requires Python 2.7.2 or later.")
|
||||
import requests
|
||||
-if requests.__version__ <= '2.2.0':
|
||||
- raise SystemExit("This program requires Python requests 2.2.0 or later.")
|
||||
+#if requests.__version__ <= '2.2.0':
|
||||
+# raise SystemExit("This program requires Python requests 2.2.0 or later.")
|
||||
|
||||
import os
|
||||
# add the custom linkcheck_dns directory to sys.path
|
Loading…
Reference in a new issue