1{ stdenv 2, lib 3, fetchPypi 4, buildPythonPackage 5, python 6, pythonOlder 7}: 8 9buildPythonPackage rec { 10 pname = "docutils"; 11 version = "0.20.1"; 12 13 disabled = pythonOlder "3.7"; 14 15 format = "setuptools"; 16 17 src = fetchPypi { 18 inherit pname version; 19 hash = "sha256-8IpOJ2w6FYOobc4+NKuj/gTQK7ot1R7RYQYkToqSPjs="; 20 }; 21 22 # Only Darwin needs LANG, but we could set it in general. 23 # It's done here conditionally to prevent mass-rebuilds. 24 checkPhase = lib.optionalString stdenv.isDarwin ''LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" '' + '' 25 ${python.interpreter} test/alltests.py 26 ''; 27 28 # Create symlinks lacking a ".py" suffix, many programs depend on these names 29 postFixup = '' 30 for f in $out/bin/*.py; do 31 ln -s $(basename $f) $out/bin/$(basename $f .py) 32 done 33 ''; 34 35 meta = with lib; { 36 description = "Python Documentation Utilities"; 37 homepage = "http://docutils.sourceforge.net/"; 38 license = with licenses; [ publicDomain bsd2 psfl gpl3Plus ]; 39 maintainers = with maintainers; [ AndersonTorres ]; 40 }; 41}