2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python, llvmPackages }:
|
2017-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
llvm = llvmPackages.llvm;
|
|
|
|
clang = llvmPackages.clang;
|
2019-06-09 11:51:48 +00:00
|
|
|
clang-unwrapped = llvmPackages.clang-unwrapped;
|
2017-12-01 00:00:00 +00:00
|
|
|
in
|
2015-03-28 20:54:27 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-06-09 11:51:48 +00:00
|
|
|
name = "libclc-2019-06-09";
|
2015-03-28 20:54:27 +00:00
|
|
|
|
2015-05-13 13:32:32 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "llvm-mirror";
|
|
|
|
repo = "libclc";
|
2019-06-09 11:51:48 +00:00
|
|
|
rev = "9f6204ec04a8cadb6bef57caa71e3161c4f398f2";
|
|
|
|
sha256 = "03l9frx3iw3qdsb9rrscgzdwm6872gv6mkssvn027ndf9y321xk7";
|
2015-03-28 20:54:27 +00:00
|
|
|
};
|
|
|
|
|
2018-02-12 19:40:18 +00:00
|
|
|
nativeBuildInputs = [ python ];
|
2019-06-09 11:51:48 +00:00
|
|
|
buildInputs = [ llvm clang clang-unwrapped ];
|
2015-03-28 20:54:27 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2019-06-09 11:51:48 +00:00
|
|
|
sed -i 's,llvm_clang =.*,llvm_clang = "${clang-unwrapped}/bin/clang",' configure.py
|
2015-03-28 20:54:27 +00:00
|
|
|
sed -i 's,cxx_compiler =.*,cxx_compiler = "${clang}/bin/clang++",' configure.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
2018-02-12 19:40:18 +00:00
|
|
|
${python.interpreter} ./configure.py --prefix=$out
|
2015-03-28 20:54:27 +00:00
|
|
|
'';
|
|
|
|
|
2020-02-14 17:31:53 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://libclc.llvm.org/";
|
2015-05-13 13:32:32 +00:00
|
|
|
description = "Implementation of the library requirements of the OpenCL C programming language";
|
2015-03-28 20:54:27 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|