nixpkgs/pkgs/development/libraries/beignet/default.nix

117 lines
2.6 KiB
Nix
Raw Normal View History

2016-04-23 23:14:04 +01:00
{ stdenv
2019-06-07 10:22:48 +01:00
, fetchFromGitHub
2016-04-23 23:14:04 +01:00
, cmake
, pkgconfig
, clang-unwrapped
, llvm
, libdrm
, libX11
, libpthreadstubs
, libXdmcp
, libXdamage
, libXext
, python3
2016-04-23 23:14:04 +01:00
, ocl-icd
, libGL
, makeWrapper
, beignet
2017-11-01 15:21:45 +00:00
}:
2016-04-23 23:14:04 +01:00
stdenv.mkDerivation rec {
pname = "beignet";
2019-06-07 10:22:48 +01:00
version = "unstable-2018.08.20";
2016-04-23 23:14:04 +01:00
2019-06-07 10:22:48 +01:00
src = fetchFromGitHub {
owner = "intel";
repo = "beignet";
rev = "fc5f430cb7b7a8f694d86acbb038bd5b38ec389c";
sha256 = "1z64v69w7f52jrskh1jfyh1x46mzfhjrqxj9hhgzh3xxv9yla32h";
2017-11-01 15:21:45 +00:00
};
2016-04-23 23:14:04 +01:00
2017-11-01 15:21:45 +00:00
patches = [ ./clang_llvm.patch ];
2016-04-23 23:14:04 +01:00
enableParallelBuilding = true;
2016-04-23 23:14:04 +01:00
postPatch = ''
2019-06-07 10:22:48 +01:00
substituteInPlace CMakeLists.txt --replace /etc/OpenCL/vendors "\''${CMAKE_INSTALL_PREFIX}/etc/OpenCL/vendors"
patchShebangs src/git_sha1.sh
2017-11-01 15:21:45 +00:00
'';
2016-04-23 23:14:04 +01:00
cmakeFlags = [ "-DCLANG_LIBRARY_DIR=${clang-unwrapped}/lib" ];
2016-04-23 23:14:04 +01:00
2017-11-01 15:21:45 +00:00
buildInputs = [
llvm
2016-04-23 23:14:04 +01:00
clang-unwrapped
2017-11-01 15:21:45 +00:00
libX11
libXext
2016-04-23 23:14:04 +01:00
libpthreadstubs
2017-11-01 15:21:45 +00:00
libdrm
2016-04-23 23:14:04 +01:00
libXdmcp
libXdamage
ocl-icd
libGL
2016-04-23 23:14:04 +01:00
];
nativeBuildInputs = [
cmake
pkgconfig
python3
];
2019-08-13 22:52:01 +01:00
passthru.utests = stdenv.mkDerivation {
pname = "beignet-utests";
inherit version src;
preConfigure = ''
cd utests
'';
enableParallelBuilding = true;
nativeBuildInputs = [
cmake
python3
pkgconfig
makeWrapper
];
buildInputs = [
ocl-icd
];
installPhase = ''
wrapBin() {
install -Dm755 "$1" "$out/bin/$(basename "$1")"
wrapProgram "$out/bin/$(basename "$1")" \
--set OCL_BITCODE_LIB_PATH ${beignet}/lib/beignet/beignet.bc \
--set OCL_HEADER_FILE_DIR "${beignet}/lib/beignet/include" \
--set OCL_PCH_PATH "${beignet}/lib/beignet/beignet.pch" \
--set OCL_GBE_PATH "${beignet}/lib/beignet/libgbe.so" \
--set OCL_INTERP_PATH "${beignet}/lib/beignet/libgbeinterp.so" \
--set OCL_KERNEL_PATH "$out/lib/beignet/kernels" \
--set OCL_IGNORE_SELF_TEST 1
}
install -Dm755 libutests.so $out/lib/libutests.so
wrapBin utest_run
wrapBin flat_address_space
mkdir $out/lib/beignet
cp -r ../../kernels $out/lib/beignet
'';
};
2016-04-23 23:14:04 +01:00
meta = with stdenv.lib; {
homepage = https://cgit.freedesktop.org/beignet/;
2016-04-23 23:14:04 +01:00
description = "OpenCL Library for Intel Ivy Bridge and newer GPUs";
longDescription = ''
2019-06-07 10:22:48 +01:00
The package provides an open source implementation of the OpenCL specification for Intel GPUs.
It supports the Intel OpenCL runtime library and compiler.
2016-04-23 23:14:04 +01:00
'';
license = licenses.lgpl21Plus;
2017-11-01 15:21:45 +00:00
maintainers = with maintainers; [ artuuge zimbatm ];
2016-04-23 23:14:04 +01:00
platforms = platforms.linux;
2018-12-09 23:47:36 +00:00
# Requires libdrm_intel
badPlatforms = [ "aarch64-linux" ];
2017-11-01 15:21:45 +00:00
};
2016-04-23 23:14:04 +01:00
}