2019-12-12 16:44:53 +00:00
|
|
|
{ stdenv, buildPythonPackage, fetchFromGitHub
|
|
|
|
, pandoc, haskellPackages, texlive }:
|
2017-07-15 07:51:07 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pypandoc";
|
2020-04-13 08:24:43 +00:00
|
|
|
version = "1.5";
|
2017-07-15 07:51:07 +00:00
|
|
|
|
2019-12-12 16:44:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bebraw";
|
|
|
|
repo = pname;
|
2020-04-13 08:24:43 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "1lpslfns6zxx7b0xr13bzg921lwrj5am8za0b2dviywk6iiib0ld";
|
2017-07-15 07:51:07 +00:00
|
|
|
};
|
|
|
|
|
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 08:24:43 +00: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 07:51:07 +00: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 07:51:07 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Thin wrapper for pandoc";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/bebraw/pypandoc";
|
2017-07-15 07:51:07 +00:00
|
|
|
license = licenses.mit;
|
2020-01-19 11:41:36 +00:00
|
|
|
maintainers = with maintainers; [ sternenseemann bennofs ];
|
2017-07-15 07:51:07 +00:00
|
|
|
};
|
|
|
|
}
|