nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
volth 46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00

33 lines
952 B
Nix

{stdenv, fetchurl, ruby, opencl-headers, addOpenGLRunpath }:
stdenv.mkDerivation rec {
pname = "ocl-icd";
version = "2.2.10";
src = fetchurl {
url = "https://forge.imag.fr/frs/download.php/810/${pname}-${version}.tar.gz";
sha256 = "0f14gpa13sdm0kzqv5yycp4pschbmi6n5fj7wl4ilspzsrqcgqr2";
};
nativeBuildInputs = [ ruby addOpenGLRunpath ];
buildInputs = [ opencl-headers ];
postPatch = ''
sed -i 's,"/etc/OpenCL/vendors","${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors",g' ocl_icd_loader.c
'';
# Set RUNPATH so that driver libraries in /run/opengl-driver(-32)/lib can be found.
# See the explanation in addOpenGLRunpath.
postFixup = ''
addOpenGLRunpath $out/lib/libOpenCL.so
'';
meta = with stdenv.lib; {
description = "OpenCL ICD Loader for ${opencl-headers.name}";
homepage = https://forge.imag.fr/projects/ocl-icd/;
license = licenses.bsd2;
platforms = platforms.linux;
};
}