Merge pull request #36228 from tw-360vier/fix-linkchecker

linkchecker: 9.3 -> 9.3.1
This commit is contained in:
Robert Schütz 2018-03-06 10:13:01 +01:00 committed by GitHub
commit eae4965117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 30 deletions

View File

@ -1,23 +1,50 @@
{ stdenv, lib, fetchurl, python2Packages, gettext }:
{ stdenv, lib, fetchFromGitHub, fetchpatch, python2, gettext }:
let
# pin requests version until next release.
# see: https://github.com/linkcheck/linkchecker/issues/76
python2Packages = (python2.override {
packageOverrides = self: super: {
requests = super.requests.overridePythonAttrs(oldAttrs: rec {
version = "2.14.2";
src = oldAttrs.src.override {
inherit version;
sha256 = "0lyi82a0ijs1m7k9w1mqwbmq1qjsac35fazx7xqyh8ws76xanx52";
};
});
};
}).pkgs;
in
python2Packages.buildPythonApplication rec {
name = "LinkChecker-${version}";
version = "9.3";
pname = "LinkChecker";
version = "9.3.1";
buildInputs = with python2Packages ; [ pytest ];
propagatedBuildInputs = with python2Packages ; [ requests ] ++ [ gettext ];
propagatedBuildInputs = (with python2Packages; [
requests
]) ++ [ gettext ];
src = fetchurl {
url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
checkInputs = with python2Packages; [ pytest ];
# the original repository is abandoned, development is now happening here:
src = fetchFromGitHub {
owner = "linkcheck";
repo = "linkchecker";
rev = "v${version}";
sha256 = "080mv4iwvlsfnm7l9basd6i8p4q8990mdhkwick9s6javrbf1r1d";
};
# 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
];
# 2. fix build: https://github.com/linkcheck/linkchecker/issues/10
patches =
let
fix-setup-py = fetchpatch {
name = "fix-setup-py.patch";
url = https://github.com/linkcheck/linkchecker/commit/e62e630.patch;
sha256 = "046q1whg715w2yv33xx6rkj7fspvvz60cl978ax92lnf8j101czx";
};
in [
./add-no-robots-flag.patch
fix-setup-py
];
postInstall = ''
rm $out/bin/linkchecker-gui
@ -35,8 +62,8 @@ python2Packages.buildPythonApplication rec {
meta = {
description = "Check websites for broken links";
homepage = https://wummel.github.io/linkchecker/;
homepage = https://linkcheck.github.io/linkchecker/;
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ peterhoeg ];
maintainers = with lib.maintainers; [ peterhoeg tweber ];
};
}

View File

@ -1,14 +0,0 @@
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