nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchPypi
4, freetype
5, pillow
6, glibcLocales
7, python
8, isPyPy
9}:
10
11let
12 ft = freetype.overrideAttrs (oldArgs: { dontDisableStatic = true; });
13in buildPythonPackage rec {
14 pname = "reportlab";
15 version = "3.6.9";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "sha256-XQzDaCRWrSExUPbb/+fUfqtzfYCeUXwxYQM3a+VI+4Q=";
20 };
21
22 checkInputs = [ glibcLocales ];
23
24 buildInputs = [ ft pillow ];
25
26 postPatch = ''
27 substituteInPlace setup.py \
28 --replace "mif = findFile(d,'ft2build.h')" "mif = findFile('${lib.getDev ft}','ft2build.h')"
29
30 # Remove all the test files that require access to the internet to pass.
31 rm tests/test_lib_utils.py
32 rm tests/test_platypus_general.py
33 rm tests/test_platypus_images.py
34
35 # Remove the tests that require Vera fonts installed
36 rm tests/test_graphics_render.py
37 rm tests/test_graphics_charts.py
38 '';
39
40 checkPhase = ''
41 cd tests
42 LC_ALL="en_US.UTF-8" ${python.interpreter} runAll.py
43 '';
44
45 # See https://bitbucket.org/pypy/compatibility/wiki/reportlab%20toolkit
46 disabled = isPyPy;
47
48 meta = {
49 description = "An Open Source Python library for generating PDFs and graphics";
50 homepage = "http://www.reportlab.com/";
51 };
52}