1{ lib
2, autoreconfHook
3, fetchPypi
4, buildPythonPackage
5, cython
6, pariSupport ? true, pari # for interfacing with the PARI/GP signal handler
7}:
8
9assert pariSupport -> pari != null;
10
11buildPythonPackage rec {
12 pname = "cysignals";
13 version = "1.11.2";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "5858b1760fbe21848121b826b2463a67ac5a45caf3d73105497a68618c5a6fa6";
18 };
19
20 # explicit check:
21 # build/src/cysignals/implementation.c:27:2: error: #error "cysignals must be compiled without _FORTIFY_SOURCE"
22 hardeningDisable = [
23 "fortify"
24 ];
25
26 # known failure: https://github.com/sagemath/cysignals/blob/582dbf6a7b0f9ade0abe7a7b8720b7fb32435c3c/testgdb.py#L5
27 doCheck = false;
28 checkTarget = "check-install";
29
30 preCheck = ''
31 # Make sure cysignals-CSI is in PATH
32 export PATH="$out/bin:$PATH"
33 '';
34
35 propagatedBuildInputs = [
36 cython
37 ] ++ lib.optionals pariSupport [
38 # When cysignals is built with pari, including cysignals into the
39 # buildInputs of another python package will cause cython to link against
40 # pari.
41 pari
42 ];
43
44 nativeBuildInputs = [ autoreconfHook ];
45
46 enableParallelBuilding = true;
47
48 meta = with lib; {
49 description = "Interrupt and signal handling for Cython";
50 homepage = "https://github.com/sagemath/cysignals/";
51 maintainers = teams.sage.members;
52 license = licenses.lgpl3Plus;
53 };
54}