nixpkgs-suyu/pkgs/development/libraries/libclc/default.nix

38 lines
1.1 KiB
Nix
Raw Normal View History

{ 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
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 {
owner = "llvm";
repo = "llvm-project";
rev = "llvmorg-${version}";
sha256 = "0bxh43hp1vl4axl3s9n2nb2ii8x1cbq98xz9c996f8rl5jy84ags";
2015-03-28 21:54:27 +01:00
};
sourceRoot = "source/libclc";
2015-03-28 21:54:27 +01: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 = ''
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
'';
nativeBuildInputs = [ cmake ninja python3 ];
buildInputs = [ llvm clang-unwrapped ];
strictDeps = true;
meta = with lib; {
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;
};
}