1{ stdenv, fetchFromGitHub, which, m4, python, bison, flex, llvmPackages, glibc32 }:
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 glibc32
31 ];
32
33 # https://github.com/ispc/ispc/pull/1190
34 patches = [ ./gcc5.patch ];
35
36 postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";
37
38 installPhase = ''
39 mkdir -p $out/bin
40 cp ispc $out/bin
41 '';
42
43 checkPhase = ''
44 export ISPC_HOME=$PWD
45 python run_tests.py
46 '';
47
48 makeFlags = [
49 "CLANG_INCLUDE=${llvmPackages.clang-unwrapped}/include"
50 ];
51
52 meta = with stdenv.lib; {
53 homepage = https://ispc.github.io/ ;
54 description = "Intel 'Single Program, Multiple Data' Compiler, a vectorised language";
55 license = licenses.bsd3;
56 platforms = platforms.unix;
57 maintainers = [ maintainers.aristid ];
58 };
59}