1{ lib
2, python
3, buildPythonPackage
4, fetchFromGitHub
5, openmp
6, pytest-runner
7, ply
8, networkx
9, decorator
10, gast
11, six
12, numpy
13, beniget
14, pytestCheckHook
15, scipy
16, isPy3k
17, substituteAll
18}:
19
20let
21 inherit (python) stdenv;
22
23in buildPythonPackage rec {
24 pname = "pythran";
25 version = "0.9.12";
26
27 src = fetchFromGitHub {
28 owner = "serge-sans-paille";
29 repo = "pythran";
30 rev = version;
31 sha256 = "sha256-lQbVq4K/Q8RzlFhE+l3HPCmUGmauXawcKe31kfbUHsI=";
32 };
33
34 patches = [
35 # Hardcode path to mp library
36 (substituteAll {
37 src = ./0001-hardcode-path-to-libgomp.patch;
38 gomp = "${if stdenv.cc.isClang then openmp else stdenv.cc.cc.lib}/lib/libgomp${stdenv.hostPlatform.extensions.sharedLibrary}";
39 })
40 ];
41
42 nativeBuildInputs = [
43 pytest-runner
44 ];
45
46 propagatedBuildInputs = [
47 ply
48 networkx
49 decorator
50 gast
51 six
52 numpy
53 beniget
54 ];
55
56 pythonImportsCheck = [
57 "pythran"
58 "pythran.backend"
59 "pythran.middlend"
60 "pythran.passmanager"
61 "pythran.toolchain"
62 "pythran.spec"
63 ];
64
65 checkInputs = [
66 pytestCheckHook
67 numpy
68 scipy
69 ];
70
71 # Test suite is huge.
72 # Also, in the future scipy will rely on it resulting in a circular test dependency
73 doCheck = false;
74
75 disabled = !isPy3k;
76
77 meta = {
78 description = "Ahead of Time compiler for numeric kernels";
79 homepage = "https://github.com/serge-sans-paille/pythran";
80 license = lib.licenses.bsd3;
81 };
82
83}