1{ stdenv, fetchFromGitHub, python, llvmPackages }:
2
3let
4 llvm = llvmPackages.llvm;
5 clang = llvmPackages.clang;
6in
7
8stdenv.mkDerivation {
9 name = "libclc-2017-11-29";
10
11 src = fetchFromGitHub {
12 owner = "llvm-mirror";
13 repo = "libclc";
14 rev = "d6384415ab854c68777dd77451aa2bc0d959da99";
15 sha256 = "10fqrlnqlknh58x7pfsbg9r07fblfg2mgq2m4fr1jbb836ncn3wh";
16 };
17
18 nativeBuildInputs = [ python ];
19 buildInputs = [ llvm clang ];
20
21 postPatch = ''
22 sed -i 's,llvm_clang =.*,llvm_clang = "${clang}/bin/clang",' configure.py
23 sed -i 's,cxx_compiler =.*,cxx_compiler = "${clang}/bin/clang++",' configure.py
24 '';
25
26 configurePhase = ''
27 ${python.interpreter} ./configure.py --prefix=$out
28 '';
29
30 meta = with stdenv.lib; {
31 homepage = http://libclc.llvm.org/;
32 description = "Implementation of the library requirements of the OpenCL C programming language";
33 license = licenses.mit;
34 platforms = platforms.all;
35 maintainers = with maintainers; [ wkennington ];
36 };
37}