2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-06-26 10:26:21 +00:00
|
|
|
, fetchpatch
|
2022-05-18 14:49:53 +00:00
|
|
|
, fetchPypi
|
|
|
|
, docutils
|
|
|
|
, mistune
|
|
|
|
, pygments
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "m2r";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-qvtn/EnPsdieRqNEOsdH4V9LtC3yDtBPBnrZ777iVqs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
patches = [
|
|
|
|
# fix tests in python 3.10
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/miyakogi/m2r/commit/58ee9cabdadf5e3deb13037f3052238f0f2bffcd.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-CN3PWmnk7xsn1wngRHuEWmDTP3HtVNxkFv0xzD2Zjlo=";
|
2022-06-26 10:26:21 +00:00
|
|
|
})
|
2022-08-12 12:06:08 +00:00
|
|
|
./docutils-0.19-compat.patch
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/test_cli.py \
|
|
|
|
--replace "optional" "positional"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ mistune docutils ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pygments ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/miyakogi/m2r";
|
2022-05-18 14:49:53 +00:00
|
|
|
description = "Markdown to reStructuredText converter";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2022-08-21 13:32:41 +00:00
|
|
|
# https://github.com/miyakogi/m2r/issues/66
|
|
|
|
broken = versionAtLeast mistune.version "2";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|