Unverified Commit 9e6a1699 authored by Mauricio Collares's avatar Mauricio Collares Committed by GitHub
Browse files

Merge pull request #281579 from collares/cypari214

python311Packages.cypari2: fix build
parents b0b3ca9f 369b1aca
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -30,20 +30,13 @@ buildPythonPackage rec {
    })
  ];

  # This differs slightly from the default python installPhase in that it pip-installs
  # "." instead of "*.whl".
  # That is because while the default install phase succeeds to build the package,
  # it fails to generate the file "auto_paridecl.pxd".
  installPhase = ''
    export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"

    # install "." instead of "*.whl"
    pip install . --no-index --no-warn-script-location --prefix="$out" --no-cache
  preBuild = ''
    # generate cythonized extensions (auto_paridecl.pxd is crucial)
    ${python.pythonOnBuildForHost.interpreter} setup.py build_ext --inplace
  '';

  nativeBuildInputs = [
    pari
    python.pythonOnBuildForHost.pkgs.pip
  ];

  buildInputs = [
@@ -56,6 +49,7 @@ buildPythonPackage rec {
  ];

  checkPhase = ''
    test -f "$out/${python.sitePackages}/cypari2/auto_paridecl.pxd"
    make check
  '';

+11 −2
Original line number Diff line number Diff line
{ lib
, autoreconfHook
, fetchpatch
, fetchPypi
, buildPythonPackage
, cython_3
, cython
, pariSupport ? true, pari # for interfacing with the PARI/GP signal handler
}:

@@ -18,6 +19,14 @@ buildPythonPackage rec {
    hash = "sha256-Dx4yHlWgf5AchqNqHkSX9v+d/nAGgdATCjjDbk6yOMM=";
  };

  patches = [
    # https://github.com/sagemath/cysignals/pull/193
    (fetchpatch {
      url = "https://github.com/sagemath/cysignals/commit/474179c87ab0ff562fdfd2471b02797e4bdd3148.diff";
      sha256 = "sha256-qEAmf4kU+QDI/JPFNjQMZIjMBk8dnaLmOpagIBMsh7w=";
    })
  ];

  # explicit check:
  # build/src/cysignals/implementation.c:27:2: error: #error "cysignals must be compiled without _FORTIFY_SOURCE"
  hardeningDisable = [
@@ -34,7 +43,7 @@ buildPythonPackage rec {
  '';

  propagatedBuildInputs = [
    cython_3
    cython
  ] ++ lib.optionals pariSupport [
    # When cysignals is built with pari, including cysignals into the
    # buildInputs of another python package will cause cython to link against
+16 −2
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, fetchpatch
, buildPythonPackage

# build-system
, cysignals
, cython_3
, cython
, pkgconfig
, setuptools

@@ -30,8 +31,21 @@ buildPythonPackage rec {
    hash = "sha256-EyReCkVRb3CgzIRal5H13OX/UdwWi+evDe7PoS1qP4A=";
  };

  # temporarily revert to cython 0.29
  patches = [
    (fetchpatch {
      url = "https://github.com/fplll/fpylll/commit/528243c6fa6491c8e9652b99bdf9758766273d66.diff";
      revert = true;
      sha256 = "sha256-IRppkESy0CRwARhxBAsZxP6JkTe0M91apG4CTSSYNUU=";
      excludes = ["requirements.txt"];
    })
  ];
  postPatch = ''
    substituteInPlace requirements.txt --replace "Cython>=3.0" "Cython"
  '';

  nativeBuildInputs = [
    cython_3
    cython
    cysignals
    pkgconfig
    setuptools