2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
, python
|
2020-06-18 07:06:33 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, gdb
|
|
|
|
, numpy
|
|
|
|
, ncurses
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-09-18 10:52:07 +00:00
|
|
|
excludedTests = [ "reimport_from_subinterpreter" ]
|
2020-04-24 23:36:52 +00:00
|
|
|
# cython's testsuite is not working very well with libc++
|
|
|
|
# We are however optimistic about things outside of testsuite still working
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals (stdenv.cc.isClang or false) [ "cpdef_extern_func" "libcpp_algo" ]
|
2020-04-24 23:36:52 +00:00
|
|
|
# Some tests in the test suite isn't working on aarch64. Disable them for
|
|
|
|
# now until upstream finds a workaround.
|
|
|
|
# Upstream issue here: https://github.com/cython/cython/issues/2308
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isAarch64 [ "numpy_memoryview" ]
|
|
|
|
++ lib.optionals stdenv.isi686 [ "future_division" "overflow_check_longlong" ]
|
2020-04-24 23:36:52 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
in buildPythonPackage rec {
|
2022-07-14 12:49:19 +00:00
|
|
|
pname = "cython";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.0.9";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2022-07-14 12:49:19 +00:00
|
|
|
pname = "Cython";
|
|
|
|
inherit version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-otNU8FnR8FXTTPqmLFtovHisLOq2QHFI1H+1CM87pPM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2020-06-18 07:06:33 +00:00
|
|
|
pkg-config
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-21 07:28:18 +00:00
|
|
|
gdb numpy ncurses
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
env.LC_ALL = "en_US.UTF-8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export HOME="$NIX_BUILD_TOP"
|
|
|
|
${python.interpreter} runtests.py -j$NIX_BUILD_CORES \
|
|
|
|
--no-code-style \
|
2021-02-05 17:12:51 +00:00
|
|
|
${lib.optionalString (builtins.length excludedTests != 0)
|
2020-04-24 23:36:52 +00:00
|
|
|
''--exclude="(${builtins.concatStringsSep "|" excludedTests})"''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
# https://github.com/cython/cython/issues/2785
|
|
|
|
# Temporary solution
|
|
|
|
doCheck = false;
|
2021-09-18 10:52:07 +00:00
|
|
|
# doCheck = !stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
# force regeneration of generated code in source distributions
|
|
|
|
# https://github.com/cython/cython/issues/5089
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2023-02-16 17:41:37 +00:00
|
|
|
changelog = "https://github.com/cython/cython/blob/${version}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An optimising static compiler for both the Python programming language and the extended Cython programming language";
|
|
|
|
homepage = "https://cython.org";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ fridh ];
|
|
|
|
};
|
|
|
|
}
|