2021-08-27 14:25:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pythonRelaxDepsHook
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
, pdm-backend
|
|
|
|
|
|
|
|
# native dependencies
|
2021-08-27 14:25:00 +00:00
|
|
|
, glibcLocales
|
2024-01-13 08:15:51 +00:00
|
|
|
, git
|
|
|
|
, pandoc
|
|
|
|
, typogrify
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, backports-zoneinfo
|
|
|
|
, blinker
|
|
|
|
, docutils
|
|
|
|
, feedgenerator
|
2021-08-27 14:25:00 +00:00
|
|
|
, jinja2
|
|
|
|
, markdown
|
2024-01-13 08:15:51 +00:00
|
|
|
, ordered-set
|
2021-08-27 14:25:00 +00:00
|
|
|
, pygments
|
|
|
|
, python-dateutil
|
|
|
|
, rich
|
2024-01-13 08:15:51 +00:00
|
|
|
, tzdata
|
2021-08-27 14:25:00 +00:00
|
|
|
, unidecode
|
2024-01-13 08:15:51 +00:00
|
|
|
, watchfiles
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
2021-08-27 14:25:00 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pelican";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "4.9.1";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "getpelican";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "pelican";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-nz2OnxJ4mGgnafz4Xp8K/BTyVgXNpNYqteNL1owP8Hk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
# Remove unicode file names which leads to different checksums on HFS+
|
|
|
|
# vs. other filesystems because of unicode normalisation.
|
2022-06-16 17:23:12 +00:00
|
|
|
postFetch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
rm -r $out/pelican/tests/output/custom_locale/posts
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pelican/tests/test_pelican.py \
|
|
|
|
--replace "'git'" "'${git}/bin/git'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pdm-backend
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"unidecode"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
glibcLocales
|
2020-09-25 04:45:31 +00:00
|
|
|
pandoc
|
2020-04-24 23:36:52 +00:00
|
|
|
git
|
|
|
|
markdown
|
|
|
|
typogrify
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-08-27 14:25:00 +00:00
|
|
|
blinker
|
|
|
|
docutils
|
|
|
|
feedgenerator
|
|
|
|
jinja2
|
2024-01-13 08:15:51 +00:00
|
|
|
ordered-set
|
2021-08-27 14:25:00 +00:00
|
|
|
pygments
|
|
|
|
python-dateutil
|
|
|
|
rich
|
2024-01-13 08:15:51 +00:00
|
|
|
tzdata
|
2021-08-27 14:25:00 +00:00
|
|
|
unidecode
|
2024-01-13 08:15:51 +00:00
|
|
|
watchfiles
|
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
backports-zoneinfo
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
mock
|
2021-08-27 14:25:00 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
pandoc
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# DeprecationWarning: 'jinja2.Markup' is deprecated and...
|
|
|
|
"-W ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError
|
|
|
|
"test_basic_generation_works"
|
|
|
|
"test_custom_generation_works"
|
|
|
|
"test_custom_locale_generation_works"
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
env.LC_ALL = "en_US.UTF-8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# We only want to patch shebangs in /bin, and not those
|
|
|
|
# of the project scripts that are created by Pelican.
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/30116
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
patchShebangs $out/bin
|
|
|
|
'';
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
pythonImportsCheck = [ "pelican" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-08-27 14:25:00 +00:00
|
|
|
description = "Static site generator that requires no database or server-side logic";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://getpelican.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.agpl3;
|
|
|
|
maintainers = with maintainers; [ offline prikhi ];
|
|
|
|
};
|
|
|
|
}
|