pythonPackages.pypandoc: 1.4 -> 2018-06-18

Switch to an unstable version to make it work with pandoc v2.

Based on #56592 by @Twey. Reworked dependency handling.
This commit is contained in:
sternenseemann 2019-12-12 17:44:53 +01:00 committed by Benno Fünfstück
parent 201d9b8916
commit 6b6e54eebd

View File

@ -1,33 +1,33 @@
{ stdenv, buildPythonPackage, fetchPypi { stdenv, buildPythonPackage, fetchFromGitHub
, pip, pandoc, glibcLocales, haskellPackages, texlive }: , pandoc, haskellPackages, texlive }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pypandoc"; pname = "pypandoc";
version = "1.4"; version = "unstable-2018-06-18";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "bebraw";
sha256 = "e914e6d5f84a76764887e4d909b09d63308725f0cbb5293872c2c92f07c11a5b"; repo = pname;
rev = "87912f0f17e0a71c1160008df708c876d32e5819";
sha256 = "0l6knkxxhmni4lx8hyvbb71svnhza08ivyklqlk5fw637gznc0hx";
}; };
# Fix tests: first requires network access, second is a bug (reported upstream) postPatch = ''
preConfigure = '' # set pandoc path statically
sed -i '/^__pandoc_path = None$/c__pandoc_path = "${pandoc}/bin/pandoc"' pypandoc/__init__.py
# Fix tests: requires network access
substituteInPlace tests.py --replace "pypandoc.convert(url, 'html')" "'GPL2 license'" substituteInPlace tests.py --replace "pypandoc.convert(url, 'html')" "'GPL2 license'"
substituteInPlace tests.py --replace "pypandoc.convert_file(file_name, lua_file_name)" "'<h1 id=\"title\">title</h1>'"
''; '';
LC_ALL="en_US.UTF-8"; preCheck = ''
export PATH="${haskellPackages.pandoc-citeproc}/bin:${texlive.combined.scheme-small}/bin:$PATH"
propagatedBuildInputs = [ pip ]; '';
buildInputs = [ pandoc texlive.combined.scheme-small haskellPackages.pandoc-citeproc glibcLocales ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Thin wrapper for pandoc"; description = "Thin wrapper for pandoc";
homepage = https://github.com/bebraw/pypandoc; homepage = https://github.com/bebraw/pypandoc;
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ bennofs ]; maintainers = with maintainers; [ bennofs ];
broken = true; # incompatible with pandoc v2
}; };
} }