diff --git a/pkgs/development/python-modules/latex2mathml/default.nix b/pkgs/development/python-modules/latex2mathml/default.nix new file mode 100644 index 000000000000..8737f0ef31da --- /dev/null +++ b/pkgs/development/python-modules/latex2mathml/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, poetry-core +, setuptools +, pytestCheckHook +, multidict +, xmljson +}: + +buildPythonPackage rec { + pname = "latex2mathml"; + version = "3.75.2"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "roniemartinez"; + repo = pname; + rev = version; + hash = "sha256-i/F1B/Rndg66tiKok1PDMK/rT5c2e8upnQrMSCTUzpU="; + }; + + format = "pyproject"; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + setuptools # needs pkg_resources at runtime + ]; + + nativeCheckInputs = [ + pytestCheckHook + multidict + xmljson + ]; + + # Disable code coverage in check phase + postPatch = '' + sed -i '/--cov/d' pyproject.toml + ''; + + pythonImportsCheck = [ "latex2mathml" ]; + + meta = with lib; { + description = "Pure Python library for LaTeX to MathML conversion"; + homepage = "https://github.com/roniemartinez/latex2mathml"; + changelog = "https://github.com/roniemartinez/latex2mathml/releases/tag/${version}"; + license = licenses.mit; + maintainers = with maintainers; [ sfrijters ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4057e0ca1dd7..21e4468f02d4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4791,6 +4791,8 @@ with pkgs; gladtex = callPackage ../tools/typesetting/tex/gladtex { }; + latex2mathml = with python3Packages; toPythonApplication latex2mathml; + latexrun = callPackage ../tools/typesetting/tex/latexrun { }; lkproof = callPackage ../tools/typesetting/tex/lkproof { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ea6f4d83086f..a51bb2945025 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5341,6 +5341,8 @@ self: super: with self; { laszip = callPackage ../development/python-modules/laszip { }; + latex2mathml = callPackage ../development/python-modules/latex2mathml { }; + latexcodec = callPackage ../development/python-modules/latexcodec { }; latexify-py = callPackage ../development/python-modules/latexify-py { };