Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-18.03 73 lines 2.0 kB view raw
1{stdenv, fetchFromGitHub, bash, which, m4, python, bison, flex, llvmPackages, clangWrapSelf, 2testedTargets ? ["sse2" "host"] # the default test target is sse4, but that is not supported by all Hydra agents 3}: 4 5stdenv.mkDerivation rec { 6 version = "1.9.2"; 7 rev = "v${version}"; 8 9 inherit testedTargets; 10 11 name = "ispc-${version}"; 12 13 src = fetchFromGitHub { 14 owner = "ispc"; 15 repo = "ispc"; 16 inherit rev; 17 sha256 = "0zaw7mwvly1csbdcbz9j8ry89n0r1fag1m1f579l4mgg1x6ksqry"; 18 }; 19 20 # there are missing dependencies in the Makefile, causing sporadic build failures 21 enableParallelBuilding = false; 22 23 doCheck = true; 24 25 buildInputs = with llvmPackages; [ 26 which 27 m4 28 python 29 bison 30 flex 31 llvm 32 llvmPackages.clang-unwrapped # we need to link against libclang, so we need the unwrapped 33 ]; 34 35 postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile"; 36 37 # TODO: this correctly catches errors early, but also some things that are just weird and don't seem to be real 38 # errors 39 #configurePhase = '' 40 # makeFlagsArray=( SHELL="${bash}/bin/bash -o pipefail" ) 41 #''; 42 43 installPhase = '' 44 mkdir -p $out/bin 45 cp ispc $out/bin 46 ''; 47 48 checkPhase = '' 49 export ISPC_HOME=$PWD 50 for target in $testedTargets 51 do 52 echo "Testing target $target" 53 echo "================================" 54 echo 55 PATH=${llvmPackages.clang}/bin:$PATH python run_tests.py -t $target --non-interactive --verbose --file=test_output.log 56 fgrep -q "No new fails" test_output.log || exit 1 57 done 58 ''; 59 60 makeFlags = [ 61 "CXX=${stdenv.cc}/bin/clang++" 62 "CLANG=${stdenv.cc}/bin/clang" 63 "CLANG_INCLUDE=${llvmPackages.clang-unwrapped}/include" 64 ]; 65 66 meta = with stdenv.lib; { 67 homepage = https://ispc.github.io/ ; 68 description = "Intel 'Single Program, Multiple Data' Compiler, a vectorised language"; 69 license = licenses.bsd3; 70 platforms = ["x86_64-linux"]; # TODO: buildable on more platforms? 71 maintainers = [ maintainers.aristid ]; 72 }; 73}