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