summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorRobert Schütz <rschuetz17@gmail.com>2018-03-06 10:13:01 +0100
committerGitHub <noreply@github.com>2018-03-06 10:13:01 +0100
commiteae4965117a7c58b6a382679a0aee1b821a8c0fa (patch)
treece96b6d08b9b414fc3ebb5915c04329a11bbe060 /pkgs/tools
parent8f38b1cd8f72beae05d9ea0509c4c12a86e8ff0d (diff)
parent93752a8eebfe6811decdaa298158140d927bcdde (diff)
downloadnixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.tar
nixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.tar.gz
nixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.tar.bz2
nixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.tar.lz
nixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.tar.xz
nixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.tar.zst
nixlib-eae4965117a7c58b6a382679a0aee1b821a8c0fa.zip
Merge pull request #36228 from tw-360vier/fix-linkchecker
linkchecker: 9.3 -> 9.3.1
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/networking/linkchecker/default.nix59
-rw-r--r--pkgs/tools/networking/linkchecker/no-version-check.patch14
2 files changed, 43 insertions, 30 deletions
diff --git a/pkgs/tools/networking/linkchecker/default.nix b/pkgs/tools/networking/linkchecker/default.nix
index 686242aa0670..6e41de8999b9 100644
--- a/pkgs/tools/networking/linkchecker/default.nix
+++ b/pkgs/tools/networking/linkchecker/default.nix
@@ -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";
+
+  propagatedBuildInputs = (with python2Packages; [ 
+    requests
+  ]) ++ [ gettext ];
 
-  buildInputs = with python2Packages ; [ pytest ];
-  propagatedBuildInputs = with python2Packages ; [ requests ] ++ [ gettext ];
+  checkInputs = with python2Packages; [ pytest ];
 
-  src = fetchurl {
-    url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
-    sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
+  # 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 ];
   };
 }
diff --git a/pkgs/tools/networking/linkchecker/no-version-check.patch b/pkgs/tools/networking/linkchecker/no-version-check.patch
deleted file mode 100644
index 49b674f37359..000000000000
--- a/pkgs/tools/networking/linkchecker/no-version-check.patch
+++ /dev/null
@@ -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