1{ stdenv, buildPythonPackage, fetchFromGitHub
2, glibcLocales, git
3, mock, nose, markdown, lxml, typogrify
4, jinja2, pygments, docutils, pytz, unidecode, six, dateutil, feedgenerator
5, blinker, pillow, beautifulsoup4, markupsafe }:
6
7buildPythonPackage rec {
8 pname = "pelican";
9 version = "4.2.0";
10
11 src = fetchFromGitHub {
12 owner = "getpelican";
13 repo = "pelican";
14 rev = version;
15 sha256 = "0w9nqdw2jmqc6kqwg4rh6irr5k6j7hk8axg6vgd137rs50v62yv5";
16 # Remove unicode file names which leads to different checksums on HFS+
17 # vs. other filesystems because of unicode normalisation.
18 extraPostFetch = ''
19 rm -r $out/pelican/tests/output/custom_locale/posts
20 '';
21 };
22
23 doCheck = true;
24
25 # Exclude custom locale test, which files were removed above to fix the source checksum
26 checkPhase = ''
27 nosetests -sv --exclude=test_custom_locale_generation_works pelican
28 '';
29
30 buildInputs = [
31 glibcLocales
32 # Note: Pelican has to adapt to a changed CLI of pandoc before enabling this
33 # again. Compare https://github.com/getpelican/pelican/pull/2252.
34 # Version 4.2.0 is incompatible with our current pandoc version.
35 # pandoc
36 git
37 mock
38 markdown
39 typogrify
40 ];
41
42 propagatedBuildInputs = [
43 jinja2 pygments docutils pytz unidecode six dateutil feedgenerator
44 blinker pillow beautifulsoup4 markupsafe lxml
45 ];
46
47 checkInputs = [
48 nose
49 ];
50
51 postPatch= ''
52 substituteInPlace pelican/tests/test_pelican.py \
53 --replace "'git'" "'${git}/bin/git'"
54
55 # Markdown-3.1 changed footnote separator to colon
56 # https://github.com/getpelican/pelican/issues/2493#issuecomment-491723744
57 sed -i '/test_article_with_footnote/i\
58 @unittest.skip("")' pelican/tests/test_readers.py
59 '';
60
61 LC_ALL="en_US.UTF-8";
62
63
64 # We only want to patch shebangs in /bin, and not those
65 # of the project scripts that are created by Pelican.
66 # See https://github.com/NixOS/nixpkgs/issues/30116
67 dontPatchShebangs = true;
68
69 postFixup = ''
70 patchShebangs $out/bin
71 '';
72
73 meta = with stdenv.lib; {
74 description = "A tool to generate a static blog from reStructuredText or Markdown input files";
75 homepage = http://getpelican.com/;
76 license = licenses.agpl3;
77 maintainers = with maintainers; [ offline prikhi ];
78 broken = true;
79 };
80}