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