2021-03-13 10:33:31 +00:00
|
|
|
{ lib
|
2021-07-17 16:22:11 +00:00
|
|
|
, python
|
2021-03-13 10:33:31 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-09-11 02:33:29 +00:00
|
|
|
, openmp
|
2021-03-13 10:33:31 +00:00
|
|
|
, ply
|
|
|
|
, networkx
|
|
|
|
, decorator
|
|
|
|
, gast
|
|
|
|
, six
|
|
|
|
, numpy
|
|
|
|
, beniget
|
|
|
|
, isPy3k
|
2021-07-17 16:22:11 +00:00
|
|
|
, substituteAll
|
2021-03-13 10:33:31 +00:00
|
|
|
}:
|
|
|
|
|
2021-07-17 16:22:11 +00:00
|
|
|
let
|
|
|
|
inherit (python) stdenv;
|
|
|
|
|
|
|
|
in buildPythonPackage rec {
|
2021-03-13 10:33:31 +00:00
|
|
|
pname = "pythran";
|
2022-06-28 07:18:09 +00:00
|
|
|
version = "0.11.0";
|
2021-03-13 10:33:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "serge-sans-paille";
|
|
|
|
repo = "pythran";
|
|
|
|
rev = version;
|
2023-03-03 00:48:06 +00:00
|
|
|
hash = "sha256-F9gUZOTSuiqvfGoN4yQqwUg9mnCeBntw5eHO7ZnjpzI=";
|
2021-03-13 10:33:31 +00:00
|
|
|
};
|
|
|
|
|
2021-07-17 16:22:11 +00:00
|
|
|
patches = [
|
|
|
|
# Hardcode path to mp library
|
|
|
|
(substituteAll {
|
|
|
|
src = ./0001-hardcode-path-to-libgomp.patch;
|
2021-09-11 02:33:29 +00:00
|
|
|
gomp = "${if stdenv.cc.isClang then openmp else stdenv.cc.cc.lib}/lib/libgomp${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2021-07-17 16:22:11 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-13 10:33:31 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
ply
|
|
|
|
networkx
|
|
|
|
decorator
|
|
|
|
gast
|
|
|
|
six
|
|
|
|
numpy
|
|
|
|
beniget
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pythran"
|
|
|
|
"pythran.backend"
|
|
|
|
"pythran.middlend"
|
|
|
|
"pythran.passmanager"
|
|
|
|
"pythran.toolchain"
|
|
|
|
"pythran.spec"
|
|
|
|
];
|
|
|
|
|
2022-06-28 07:18:09 +00:00
|
|
|
# Test suite is huge and has a circular dependency on scipy.
|
2021-03-13 10:33:31 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Ahead of Time compiler for numeric kernels";
|
2021-07-17 16:22:11 +00:00
|
|
|
homepage = "https://github.com/serge-sans-paille/pythran";
|
2021-03-13 10:33:31 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|