Skip to content

Commit a3495eb

Browse files
committed
python312Packages.md2pdf: init at 1.0.1
1 parent cc0f717 commit a3495eb

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
buildPythonPackage,
3+
docopt,
4+
fetchFromGitHub,
5+
lib,
6+
markdown2,
7+
pytest-cov-stub,
8+
pytestCheckHook,
9+
setuptools,
10+
weasyprint,
11+
}:
12+
13+
buildPythonPackage rec {
14+
pname = "md2pdf";
15+
version = "1.0.1";
16+
pyproject = true;
17+
18+
src = fetchFromGitHub {
19+
owner = "jmaupetit";
20+
repo = "md2pdf";
21+
rev = "refs/tags/${version}";
22+
hash = "sha256-9B1vVfcBHk+xdE2Xouu95j3Hp4xm9d5DgPv2zKwCvHY=";
23+
};
24+
25+
postPatch = ''
26+
substituteInPlace setup.py \
27+
--replace-fail '"pytest-runner",' ""
28+
'';
29+
30+
build-system = [ setuptools ];
31+
32+
dependencies = [
33+
docopt
34+
markdown2
35+
weasyprint
36+
];
37+
38+
pythonImportsCheck = [ "md2pdf" ];
39+
40+
nativeCheckInputs = [
41+
pytest-cov-stub
42+
pytestCheckHook
43+
];
44+
45+
preCheck = ''
46+
export PATH="$out/bin:$PATH"
47+
'';
48+
49+
meta = {
50+
changelog = "https://github.com/jmaupetit/md2pdf/blob/${src.rev}/CHANGELOG.md";
51+
description = "Markdown to PDF conversion tool";
52+
homepage = "https://github.com/jmaupetit/md2pdf";
53+
license = lib.licenses.mit;
54+
mainProgram = "md2pdf";
55+
maintainers = with lib.maintainers; [ dotlambda ];
56+
};
57+
}

pkgs/top-level/all-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9623,6 +9623,8 @@ with pkgs;
96239623

96249624
md2gemini = with python3.pkgs; toPythonApplication md2gemini;
96259625

9626+
md2pdf = with python3Packages; toPythonApplication md2pdf;
9627+
96269628
mdbook-emojicodes = callPackage ../tools/text/mdbook-emojicodes { };
96279629

96289630
mdbook-epub = callPackage ../tools/text/mdbook-epub {

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7564,6 +7564,8 @@ self: super: with self; {
75647564

75657565
md2gemini = callPackage ../development/python-modules/md2gemini { };
75667566

7567+
md2pdf = callPackage ../development/python-modules/md2pdf { };
7568+
75677569
mdformat = callPackage ../development/python-modules/mdformat { };
75687570
mdformat-admon = callPackage ../development/python-modules/mdformat-admon { };
75697571
mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { };

0 commit comments

Comments
 (0)