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