diff options
Diffstat (limited to 'pkgs/tools/networking/linkchecker/default.nix')
-rw-r--r-- | pkgs/tools/networking/linkchecker/default.nix | 77 |
1 files changed, 31 insertions, 46 deletions
diff --git a/pkgs/tools/networking/linkchecker/default.nix b/pkgs/tools/networking/linkchecker/default.nix index acc6893d0cd..3c361fe48ba 100644 --- a/pkgs/tools/networking/linkchecker/default.nix +++ b/pkgs/tools/networking/linkchecker/default.nix @@ -1,64 +1,49 @@ -{ 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 { - pname = "LinkChecker"; - version = "9.3.1"; - - nativeBuildInputs = [ gettext ]; - pythonPath = (with python2Packages; [ - requests - ]) ++ [ gettext ]; +{ stdenv, lib, fetchFromGitHub, python2Packages, gettext }: - checkInputs = with python2Packages; [ pytest ]; +python2Packages.buildPythonApplication rec { + pname = "linkchecker"; + version = "9.4.0"; - # the original repository is abandoned, development is now happening here: src = fetchFromGitHub { - owner = "linkcheck"; - repo = "linkchecker"; + owner = pname; + repo = pname; rev = "v${version}"; - sha256 = "080mv4iwvlsfnm7l9basd6i8p4q8990mdhkwick9s6javrbf1r1d"; + sha256 = "1vbwl2vb8dyzki27z3sl5yf9dhdd2cpkg10vbgaz868dhpqlshgs"; }; - # 1. upstream refuses to support ignoring robots.txt - # 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 - ]; + nativeBuildInputs = [ gettext ]; - postInstall = '' - rm $out/bin/linkchecker-gui + propagatedBuildInputs = with python2Packages; [ + ConfigArgParse + argcomplete + dnspython + pyxdg + requests + ]; + + checkInputs = with python2Packages; [ + parameterized + pytest + ]; + + postPatch = '' + sed -i 's/^requests.*$/requests>=2.2/' requirements.txt + sed -i "s/'request.*'/'requests >= 2.2'/" setup.py + sed -i 's~/usr/lib/python2.7/argparse.py~~g' po/Makefile ''; checkPhase = '' + runHook preCheck + # the mime test fails for me... rm tests/test_mimeutil.py ${lib.optionalString stdenv.isDarwin '' - # network tests fails on darwin - rm tests/test_network.py + # network tests fails on darwin + rm tests/test_network.py ''} make test PYTESTOPTS="--tb=short" TESTS="tests/test_*.py tests/logger/test_*.py" + + runHook postCheck ''; meta = { |