2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, python
|
|
|
|
, pygments
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "markdown2";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "2.4.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# PyPI does not contain tests, so using GitHub instead.
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trentm";
|
|
|
|
repo = "python-markdown2";
|
|
|
|
rev = version;
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-zNZ7/dDZbPIwcxSLvf8u5oaAgHLrZ6kk4vXNPUuZs/4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "SNYK-PYTHON-MARKDOWN2-2606985-xss.patch"; # no CVE (yet?)
|
|
|
|
url = "https://github.com/trentm/python-markdown2/commit/5898fcc1090ef7cd7783fa1422cc0e53cbca9d1b.patch";
|
|
|
|
sha256 = "sha256-M6kKxjHVC3O0BvDeEF4swzfpFsDO/LU9IHvfjK4hznA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
checkInputs = [ pygments ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
pushd test
|
|
|
|
${python.interpreter} ./test.py -- -knownfailure
|
|
|
|
popd # test
|
|
|
|
|
|
|
|
runHook postCheck
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A fast and complete Python implementation of Markdown";
|
|
|
|
homepage = "https://github.com/trentm/python-markdown2";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hbunke ];
|
|
|
|
};
|
|
|
|
}
|