2021-07-20 17:25:02 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ninja, cmake, python3, llvmPackages }:
|
2017-12-01 01:00:00 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
llvm = llvmPackages.llvm;
|
2019-06-09 13:51:48 +02:00
|
|
|
clang-unwrapped = llvmPackages.clang-unwrapped;
|
2017-12-01 01:00:00 +01:00
|
|
|
in
|
2015-03-28 21:54:27 +01:00
|
|
|
|
2021-07-20 17:25:02 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libclc";
|
|
|
|
version = "11.0.1";
|
2015-03-28 21:54:27 +01:00
|
|
|
|
2015-05-13 15:32:32 +02:00
|
|
|
src = fetchFromGitHub {
|
2021-07-20 17:25:02 +02:00
|
|
|
owner = "llvm";
|
|
|
|
repo = "llvm-project";
|
|
|
|
rev = "llvmorg-${version}";
|
|
|
|
sha256 = "0bxh43hp1vl4axl3s9n2nb2ii8x1cbq98xz9c996f8rl5jy84ags";
|
2015-03-28 21:54:27 +01:00
|
|
|
};
|
2021-07-20 17:25:02 +02:00
|
|
|
sourceRoot = "source/libclc";
|
2015-03-28 21:54:27 +01:00
|
|
|
|
2021-07-20 17:25:02 +02:00
|
|
|
# cmake expects all required binaries to be in the same place, so it will not be able to find clang without the patch
|
2015-03-28 21:54:27 +01:00
|
|
|
postPatch = ''
|
2021-07-20 17:25:02 +02:00
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace 'find_program( LLVM_CLANG clang PATHS ''${LLVM_BINDIR} NO_DEFAULT_PATH )' \
|
|
|
|
'find_program( LLVM_CLANG clang PATHS "${clang-unwrapped}/bin" NO_DEFAULT_PATH )'
|
2015-03-28 21:54:27 +01:00
|
|
|
'';
|
|
|
|
|
2021-07-20 17:25:02 +02:00
|
|
|
nativeBuildInputs = [ cmake ninja python3 ];
|
|
|
|
buildInputs = [ llvm clang-unwrapped ];
|
|
|
|
strictDeps = true;
|
2020-02-14 18:31:53 +01:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://libclc.llvm.org/";
|
2015-05-13 15:32:32 +02:00
|
|
|
description = "Implementation of the library requirements of the OpenCL C programming language";
|
2015-03-28 21:54:27 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|