1{ lib
2, fetchPypi
3, buildPythonPackage
4, cython
5, pariSupport ? true, pari # for interfacing with the PARI/GP signal handler
6}:
7
8assert pariSupport -> pari != null;
9
10buildPythonPackage rec {
11 pname = "cysignals";
12 version = "1.7.2";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "0rzwd9bjw6bj01xcmimqfim1g0njjyyyal0f93frm1la4hcmq96v";
17 };
18
19 # explicit check:
20 # build/src/cysignals/implementation.c:27:2: error: #error "cysignals must be compiled without _FORTIFY_SOURCE"
21 hardeningDisable = [
22 "fortify"
23 ];
24
25 # currently fails, probably because of formatting changes in gdb 8.0
26 # https://trac.sagemath.org/ticket/24692
27 doCheck = false;
28
29 preCheck = ''
30 # Make sure cysignals-CSI is in PATH
31 export PATH="$out/bin:$PATH"
32 '';
33
34 buildInputs = lib.optionals pariSupport [
35 pari
36 ];
37
38 propagatedBuildInputs = [
39 cython
40 ];
41
42 enableParallelBuilding = true;
43
44 meta = {
45 description = "Interrupt and signal handling for Cython";
46 homepage = https://github.com/sagemath/cysignals/;
47 maintainers = with lib.maintainers; [ timokau ];
48 license = lib.licenses.lgpl3Plus;
49 };
50}