1{ lib
2, fetchPypi
3, buildPythonPackage
4, gmp
5, mpfr
6, libmpc
7, ppl
8, cython
9, cysignals
10, gmpy2
11, sphinx
12}:
13
14buildPythonPackage rec {
15 pname = "pplpy";
16 version = "0.8.9";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "sha256-23o7Vx1u8FP3UTeXXpR8OhweRaMLq5Dq8hW05cwVeX4=";
21 };
22
23 buildInputs = [
24 gmp
25 mpfr
26 libmpc
27 ppl
28 ];
29
30 nativeBuildInputs = [
31 sphinx # docbuild, called by make
32 ];
33
34 propagatedBuildInputs = [
35 cython
36 cysignals
37 gmpy2
38 ];
39
40 outputs = [ "out" "doc" ];
41
42 postBuild = ''
43 # Find the build result in order to put it into PYTHONPATH. The doc
44 # build needs to import pplpy.
45 build_result="$PWD/$( find build/ -type d -name 'lib.*' | head -n1 )"
46
47 echo "Building documentation"
48 PYTHONPATH="$build_result:$PYTHONPATH" make -C docs html
49 '';
50
51 postInstall = ''
52 mkdir -p "$doc/share/doc"
53 mv docs/build/html "$doc/share/doc/pplpy"
54 '';
55
56 meta = with lib; {
57 description = "A Python wrapper for ppl";
58 homepage = "https://gitlab.com/videlec/pplpy";
59 maintainers = teams.sage.members;
60 license = licenses.gpl3;
61 };
62}