1{stdenv, fetchFromGitHub, which, m4, python, bison, flex, llvmPackages}:
2
3# TODO: patch LLVM so Knights Landing works better (patch included in ispc github)
4
5stdenv.mkDerivation rec {
6 version = "20151128";
7 rev = "d3020580ff18836de2d4cae18901980b551d9d01";
8
9 name = "ispc-${version}";
10
11 src = fetchFromGitHub {
12 owner = "ispc";
13 repo = "ispc";
14 inherit rev;
15 sha256 = "15qi22qvmlx3jrhrf3rwl0y77v66prpan6qb66a55dw3pw2d4jvn";
16 };
17
18 enableParallelBuilding = false;
19
20 doCheck = true;
21
22 buildInputs = with llvmPackages; [
23 which
24 m4
25 python
26 bison
27 flex
28 llvm
29 clang
30 ];
31
32 # https://github.com/ispc/ispc/pull/1190
33 patches = [ ./gcc5.patch ];
34
35 postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";
36
37 installPhase = ''
38 mkdir -p $out/bin
39 cp ispc $out/bin
40 '';
41
42 checkPhase = ''
43 export ISPC_HOME=$PWD
44 python run_tests.py
45 '';
46
47 makeFlags = [
48 "CLANG_INCLUDE=${llvmPackages.clang-unwrapped}/include"
49 ];
50
51 meta = with stdenv.lib; {
52 homepage = https://ispc.github.io/ ;
53 description = "Intel 'Single Program, Multiple Data' Compiler, a vectorised language";
54 license = licenses.bsd3;
55 platforms = platforms.unix;
56 maintainers = [ maintainers.aristid ];
57 };
58}