3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/libclc/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, ninja, cmake, python3, llvmPackages, spirv-llvm-translator }:
2017-12-01 00:00:00 +00:00
let
llvm = llvmPackages.llvm;
2019-06-09 12:51:48 +01: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 rec {
pname = "libclc";
version = "12.0.1";
2015-03-28 20:54:27 +00:00
2015-05-13 14:32:32 +01:00
src = fetchFromGitHub {
owner = "llvm";
repo = "llvm-project";
rev = "llvmorg-${version}";
sha256 = "08s5w2db9imb2yaqsvxs6pg21csi1cf6wa35rf8x6q07mam7j8qv";
2015-03-28 20:54:27 +00:00
};
sourceRoot = "source/libclc";
2015-03-28 20:54:27 +00: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 20:54:27 +00:00
postPatch = ''
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 )' \
--replace 'find_program( LLVM_SPIRV llvm-spirv PATHS ''${LLVM_BINDIR} NO_DEFAULT_PATH )' \
'find_program( LLVM_SPIRV llvm-spirv PATHS "${spirv-llvm-translator}/bin" NO_DEFAULT_PATH )'
2015-03-28 20:54:27 +00:00
'';
nativeBuildInputs = [ cmake ninja python3 spirv-llvm-translator ];
buildInputs = [ llvm clang-unwrapped ];
strictDeps = true;
2022-01-08 06:37:27 +00:00
cmakeFlags = [
"-DCMAKE_INSTALL_INCLUDEDIR=include"
];
meta = with lib; {
broken = stdenv.isDarwin;
homepage = "http://libclc.llvm.org/";
2015-05-13 14:32:32 +01: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;
};
}