1{ lib
2, beautifulsoup4
3, blinker
4, buildPythonPackage
5, docutils
6, feedgenerator
7, fetchFromGitHub
8, git
9, glibcLocales
10, jinja2
11, lxml
12, markdown
13, markupsafe
14, mock
15, pytestCheckHook
16, pandoc
17, pillow
18, pygments
19, python-dateutil
20, pythonOlder
21, pytz
22, rich
23, pytest-xdist
24, six
25, typogrify
26, unidecode
27}:
28
29buildPythonPackage rec {
30 pname = "pelican";
31 version = "4.8.0";
32 disabled = pythonOlder "3.6";
33
34 src = fetchFromGitHub {
35 owner = "getpelican";
36 repo = pname;
37 rev = "refs/tags/${version}";
38 hash = "sha256-T+XBRBfroG1gh9ZHU7V5wsgnI1xuNTXYAe6g5Xk8Qyg=";
39 # Remove unicode file names which leads to different checksums on HFS+
40 # vs. other filesystems because of unicode normalisation.
41 postFetch = ''
42 rm -r $out/pelican/tests/output/custom_locale/posts
43 '';
44 };
45
46 buildInputs = [
47 glibcLocales
48 pandoc
49 git
50 mock
51 markdown
52 typogrify
53 ];
54
55 propagatedBuildInputs = [
56 beautifulsoup4
57 blinker
58 docutils
59 feedgenerator
60 jinja2
61 lxml
62 markupsafe
63 pillow
64 pygments
65 python-dateutil
66 pytz
67 rich
68 six
69 unidecode
70 ];
71
72 nativeCheckInputs = [
73 pytest-xdist
74 pytestCheckHook
75 pandoc
76 ];
77
78 postPatch = ''
79 substituteInPlace pelican/tests/test_pelican.py \
80 --replace "'git'" "'${git}/bin/git'"
81 '';
82
83 pytestFlagsArray = [
84 # DeprecationWarning: 'jinja2.Markup' is deprecated and...
85 "-W ignore::DeprecationWarning"
86 ];
87
88 disabledTests = [
89 # AssertionError
90 "test_basic_generation_works"
91 "test_custom_generation_works"
92 "test_custom_locale_generation_works"
93 ];
94
95 LC_ALL = "en_US.UTF-8";
96
97 # We only want to patch shebangs in /bin, and not those
98 # of the project scripts that are created by Pelican.
99 # See https://github.com/NixOS/nixpkgs/issues/30116
100 dontPatchShebangs = true;
101
102 postFixup = ''
103 patchShebangs $out/bin
104 '';
105
106 pythonImportsCheck = [ "pelican" ];
107
108 meta = with lib; {
109 description = "Static site generator that requires no database or server-side logic";
110 homepage = "https://getpelican.com/";
111 license = licenses.agpl3;
112 maintainers = with maintainers; [ offline prikhi ];
113 };
114}