1{
2 lib,
3 buildPythonPackage,
4 fetchpatch,
5 fetchPypi,
6 docutils,
7 mistune,
8 pygments,
9}:
10
11buildPythonPackage rec {
12 pname = "m2r";
13 version = "0.3.1";
14 format = "setuptools";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-qvtn/EnPsdieRqNEOsdH4V9LtC3yDtBPBnrZ777iVqs=";
19 };
20
21 patches = [
22 # fix tests in python 3.10
23 (fetchpatch {
24 url = "https://github.com/miyakogi/m2r/commit/58ee9cabdadf5e3deb13037f3052238f0f2bffcd.patch";
25 hash = "sha256-CN3PWmnk7xsn1wngRHuEWmDTP3HtVNxkFv0xzD2Zjlo=";
26 })
27 ./docutils-0.19-compat.patch
28 ];
29
30 postPatch = ''
31 substituteInPlace tests/test_cli.py \
32 --replace "optional" "positional"
33 '';
34
35 propagatedBuildInputs = [
36 mistune
37 docutils
38 ];
39
40 nativeCheckInputs = [ pygments ];
41
42 meta = with lib; {
43 homepage = "https://github.com/miyakogi/m2r";
44 description = "Markdown to reStructuredText converter";
45 license = licenses.mit;
46 maintainers = with maintainers; [ ];
47 # https://github.com/miyakogi/m2r/issues/66
48 broken = versionAtLeast mistune.version "2";
49 };
50}