diff options
Diffstat (limited to 'pkgs/tools/misc/lektor/default.nix')
-rw-r--r-- | pkgs/tools/misc/lektor/default.nix | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/pkgs/tools/misc/lektor/default.nix b/pkgs/tools/misc/lektor/default.nix new file mode 100644 index 000000000000..b9c6cd4a69de --- /dev/null +++ b/pkgs/tools/misc/lektor/default.nix @@ -0,0 +1,89 @@ +{ lib +, fetchFromGitHub +, fetchNpmDeps +, nodejs +, npmHooks +, python3 +}: + +let + python = python3; +in python.pkgs.buildPythonApplication rec { + pname = "lektor"; + version = "3.4.0b8"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "lektor"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-FtmRW4AS11zAX2jvGY8XTsPrN3mhHkIWoFY7sXmqG/U="; + }; + + npmDeps = fetchNpmDeps { + src = "${src}/frontend"; + hash = "sha256-Z7LP9rrVSzKoLITUarsnRbrhIw7W7TZSZUgV/OT+m0M="; + }; + + npmRoot = "frontend"; + + nativeBuildInputs = [ + python.pkgs.hatch-vcs + python.pkgs.hatchling + nodejs + npmHooks.npmConfigHook + ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + propagatedBuildInputs = with python.pkgs; [ + babel + click + exifread + filetype + flask + inifile + jinja2 + markupsafe + marshmallow + marshmallow-dataclass + mistune + pillow + pip + python-slugify + requests + watchfiles + werkzeug + ]; + + nativeCheckInputs = with python.pkgs; [ + pytest-click + pytest-mock + pytestCheckHook + ]; + + postInstall = '' + cp -r lektor/translations "$out/${python.sitePackages}/lektor/" + ''; + + pythonImportsCheck = [ + "lektor" + ]; + + disabledTests = [ + # Tests require network access + "test_path_installed_plugin_is_none" + "test_VirtualEnv_run_pip_install" + # expects FHS paths + "test_VirtualEnv_executable" + ]; + + meta = with lib; { + description = "A static content management system"; + homepage = "https://www.getlektor.com/"; + changelog = "https://github.com/lektor/lektor/blob/v${version}/CHANGES.md"; + license = licenses.bsd0; + mainProgram = "lektor"; + maintainers = with maintainers; [ ]; + }; +} |