From a3495eb0c44b430086d4b550418670f871afc65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 11 Aug 2024 06:13:53 -0700 Subject: [PATCH] python312Packages.md2pdf: init at 1.0.1 --- .../python-modules/md2pdf/default.nix | 57 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/md2pdf/default.nix diff --git a/pkgs/development/python-modules/md2pdf/default.nix b/pkgs/development/python-modules/md2pdf/default.nix new file mode 100644 index 000000000000..abcb118aa818 --- /dev/null +++ b/pkgs/development/python-modules/md2pdf/default.nix @@ -0,0 +1,57 @@ +{ + buildPythonPackage, + docopt, + fetchFromGitHub, + lib, + markdown2, + pytest-cov-stub, + pytestCheckHook, + setuptools, + weasyprint, +}: + +buildPythonPackage rec { + pname = "md2pdf"; + version = "1.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jmaupetit"; + repo = "md2pdf"; + rev = "refs/tags/${version}"; + hash = "sha256-9B1vVfcBHk+xdE2Xouu95j3Hp4xm9d5DgPv2zKwCvHY="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace-fail '"pytest-runner",' "" + ''; + + build-system = [ setuptools ]; + + dependencies = [ + docopt + markdown2 + weasyprint + ]; + + pythonImportsCheck = [ "md2pdf" ]; + + nativeCheckInputs = [ + pytest-cov-stub + pytestCheckHook + ]; + + preCheck = '' + export PATH="$out/bin:$PATH" + ''; + + meta = { + changelog = "https://github.com/jmaupetit/md2pdf/blob/${src.rev}/CHANGELOG.md"; + description = "Markdown to PDF conversion tool"; + homepage = "https://github.com/jmaupetit/md2pdf"; + license = lib.licenses.mit; + mainProgram = "md2pdf"; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0420320704d3..600dfc58729e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9623,6 +9623,8 @@ with pkgs; md2gemini = with python3.pkgs; toPythonApplication md2gemini; + md2pdf = with python3Packages; toPythonApplication md2pdf; + mdbook-emojicodes = callPackage ../tools/text/mdbook-emojicodes { }; mdbook-epub = callPackage ../tools/text/mdbook-epub { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9abd47731678..c2752224b4f7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7564,6 +7564,8 @@ self: super: with self; { md2gemini = callPackage ../development/python-modules/md2gemini { }; + md2pdf = callPackage ../development/python-modules/md2pdf { }; + mdformat = callPackage ../development/python-modules/mdformat { }; mdformat-admon = callPackage ../development/python-modules/mdformat-admon { }; mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { };