1{ stdenv, buildPythonPackage, fetchFromGitHub
2, pandoc, haskellPackages, texlive }:
3
4buildPythonPackage rec {
5 pname = "pypandoc";
6 version = "1.5";
7
8 src = fetchFromGitHub {
9 owner = "bebraw";
10 repo = pname;
11 rev = version;
12 sha256 = "1lpslfns6zxx7b0xr13bzg921lwrj5am8za0b2dviywk6iiib0ld";
13 };
14
15 postPatch = ''
16 # set pandoc path statically
17 sed -i '/^__pandoc_path = None$/c__pandoc_path = "${pandoc}/bin/pandoc"' pypandoc/__init__.py
18
19 # Skip test that requires network access
20 sed -i '/test_basic_conversion_from_http_url/i\\ @unittest.skip\("no network access during checkPhase"\)' tests.py
21 '';
22
23 preCheck = ''
24 export PATH="${haskellPackages.pandoc-citeproc}/bin:${texlive.combined.scheme-small}/bin:$PATH"
25 '';
26
27 meta = with stdenv.lib; {
28 description = "Thin wrapper for pandoc";
29 homepage = "https://github.com/bebraw/pypandoc";
30 license = licenses.mit;
31 maintainers = with maintainers; [ sternenseemann bennofs ];
32 };
33}