1{ stdenv, buildPythonPackage, fetchFromGitHub
2, pandoc, haskellPackages, texlive }:
3
4buildPythonPackage rec {
5 pname = "pypandoc";
6 version = "unstable-2018-06-18";
7
8 src = fetchFromGitHub {
9 owner = "bebraw";
10 repo = pname;
11 rev = "87912f0f17e0a71c1160008df708c876d32e5819";
12 sha256 = "0l6knkxxhmni4lx8hyvbb71svnhza08ivyklqlk5fw637gznc0hx";
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 # Fix tests: requires network access
20 substituteInPlace tests.py --replace "pypandoc.convert(url, 'html')" "'GPL2 license'"
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}