2016-04-24 00:14:04 +02:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, pkgconfig
|
|
|
|
, clang-unwrapped
|
|
|
|
, llvm
|
|
|
|
, libdrm
|
|
|
|
, libX11
|
|
|
|
, libpthreadstubs
|
|
|
|
, libXdmcp
|
|
|
|
, libXdamage
|
2017-01-20 00:49:34 +01:00
|
|
|
, libXext
|
|
|
|
, python3
|
2016-04-24 00:14:04 +02:00
|
|
|
, ocl-icd
|
2017-01-20 00:49:34 +01:00
|
|
|
, mesa_noglu
|
|
|
|
, makeWrapper
|
|
|
|
, beignet
|
2016-04-24 00:14:04 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "beignet-${version}";
|
2017-07-27 11:43:28 +02:00
|
|
|
version = "1.3.1";
|
2016-04-24 00:14:04 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://01.org/sites/default/files/${name}-source.tar.gz";
|
2017-07-27 11:43:28 +02:00
|
|
|
sha256 = "07snrgjlhwl5fxz82dyqp632cnf5hp0gfqrjd2930jv79p37p6rr";
|
2016-04-24 00:14:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./clang_llvm.patch ];
|
|
|
|
|
2017-01-20 00:49:34 +01:00
|
|
|
enableParallelBuilding = true;
|
2016-04-24 00:14:04 +02:00
|
|
|
|
2017-01-20 00:49:34 +01:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs src/git_sha1.sh
|
2016-04-24 00:14:04 +02:00
|
|
|
'';
|
|
|
|
|
2017-01-20 00:49:34 +01:00
|
|
|
cmakeFlags = [ "-DCLANG_LIBRARY_DIR=${clang-unwrapped}/lib" ];
|
2016-04-24 00:14:04 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
llvm
|
|
|
|
clang-unwrapped
|
|
|
|
libX11
|
2017-01-20 00:49:34 +01:00
|
|
|
libXext
|
2016-04-24 00:14:04 +02:00
|
|
|
libpthreadstubs
|
2017-01-20 00:49:34 +01:00
|
|
|
libdrm
|
2016-04-24 00:14:04 +02:00
|
|
|
libXdmcp
|
|
|
|
libXdamage
|
|
|
|
ocl-icd
|
2017-01-20 00:49:34 +01:00
|
|
|
mesa_noglu
|
2016-04-24 00:14:04 +02:00
|
|
|
];
|
|
|
|
|
2017-01-20 00:49:34 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkgconfig
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.utests = stdenv.mkDerivation rec {
|
|
|
|
name = "beignet-utests-${version}";
|
|
|
|
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-24 00:14:04 +02:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://cgit.freedesktop.org/beignet/;
|
2016-04-24 00:14:04 +02:00
|
|
|
description = "OpenCL Library for Intel Ivy Bridge and newer GPUs";
|
|
|
|
longDescription = ''
|
|
|
|
The package provides an open source implementation of the OpenCL specification for Intel GPUs.
|
|
|
|
It supports the Intel OpenCL runtime library and compiler.
|
|
|
|
'';
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ artuuge ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|