2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
|
2019-12-12 16:44:53 +00:00
|
|
|
, pandoc, haskellPackages, texlive }:
|
2017-07-15 08:51:07 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pypandoc";
|
2020-04-13 09:24:43 +01:00
|
|
|
version = "1.5";
|
2017-07-15 08:51:07 +01:00
|
|
|
|
2019-12-12 16:44:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bebraw";
|
|
|
|
repo = pname;
|
2020-04-13 09:24:43 +01:00
|
|
|
rev = version;
|
|
|
|
sha256 = "1lpslfns6zxx7b0xr13bzg921lwrj5am8za0b2dviywk6iiib0ld";
|
2017-07-15 08:51:07 +01:00
|
|
|
};
|
|
|
|
|
2020-11-22 18:16:29 +00:00
|
|
|
# https://github.com/bebraw/pypandoc/pull/204
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/sternenseemann/pypandoc/commit/e422e277dd667c77dae11fad931dbb6015e9a784.patch";
|
|
|
|
sha256 = "11l11kh2a4k0h1g4yvijb60076kzxlkrvda3x6dc1s8fz352bpg3";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-12-12 16:44:53 +00:00
|
|
|
postPatch = ''
|
|
|
|
# set pandoc path statically
|
|
|
|
sed -i '/^__pandoc_path = None$/c__pandoc_path = "${pandoc}/bin/pandoc"' pypandoc/__init__.py
|
|
|
|
|
2020-04-13 09:24:43 +01:00
|
|
|
# Skip test that requires network access
|
|
|
|
sed -i '/test_basic_conversion_from_http_url/i\\ @unittest.skip\("no network access during checkPhase"\)' tests.py
|
2017-07-15 08:51:07 +01:00
|
|
|
'';
|
|
|
|
|
2019-12-12 16:44:53 +00:00
|
|
|
preCheck = ''
|
|
|
|
export PATH="${haskellPackages.pandoc-citeproc}/bin:${texlive.combined.scheme-small}/bin:$PATH"
|
|
|
|
'';
|
2017-07-15 08:51:07 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-07-15 08:51:07 +01:00
|
|
|
description = "Thin wrapper for pandoc";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/bebraw/pypandoc";
|
2017-07-15 08:51:07 +01:00
|
|
|
license = licenses.mit;
|
2020-01-19 11:41:36 +00:00
|
|
|
maintainers = with maintainers; [ sternenseemann bennofs ];
|
2017-07-15 08:51:07 +01:00
|
|
|
};
|
|
|
|
}
|