4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
55 lines
1.4 KiB
Nix
55 lines
1.4 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, patchelf
|
|
, cmake
|
|
, pkgconfig
|
|
|
|
, intel-gmmlib
|
|
, intel-graphics-compiler
|
|
, libva
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "intel-compute-runtime";
|
|
version = "20.34.17727";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "intel";
|
|
repo = "compute-runtime";
|
|
rev = version;
|
|
sha256 = "19scbbr6jf3yp2v7z8xyzzm01g44jym7xfkf1dz64d5nhvjw6ig5";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
buildInputs = [ intel-gmmlib intel-graphics-compiler libva ];
|
|
|
|
cmakeFlags = [
|
|
"-DSKIP_UNIT_TESTS=1"
|
|
|
|
"-DIGC_DIR=${intel-graphics-compiler}"
|
|
"-DOCL_ICD_VENDORDIR=${placeholder "out"}/etc/OpenCL/vendors"
|
|
|
|
# The install script assumes this path is relative to CMAKE_INSTALL_PREFIX
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
];
|
|
|
|
postInstall = ''
|
|
# Avoid clash with intel-ocl
|
|
mv $out/etc/OpenCL/vendors/intel.icd $out/etc/OpenCL/vendors/intel-neo.icd
|
|
'';
|
|
|
|
postFixup = ''
|
|
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ intel-gmmlib intel-graphics-compiler libva stdenv.cc.cc.lib ]} \
|
|
$out/lib/intel-opencl/libigdrcl.so
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/intel/compute-runtime";
|
|
description = "Intel Graphics Compute Runtime for OpenCL. Replaces Beignet for Gen8 (Broadwell) and beyond";
|
|
license = licenses.mit;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ gloaming ];
|
|
};
|
|
}
|