depot/third_party/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

45 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, ruby
, opencl-headers
, addDriverRunpath
, autoreconfHook
, windows
}:
stdenv.mkDerivation rec {
pname = "ocl-icd";
version = "2.3.2";
src = fetchFromGitHub {
owner = "OCL-dev";
repo = "ocl-icd";
rev = "v${version}";
sha256 = "sha256-nx9Zz5DpS29g1HRIwPAQi6i+d7Blxd53WQ7Sb1a3FHg=";
};
nativeBuildInputs = [
autoreconfHook
ruby
];
buildInputs = [ opencl-headers ]
++ lib.optionals stdenv.hostPlatform.isWindows [ windows.dlfcn ];
configureFlags = [
"--enable-custom-vendordir=/run/opengl-driver/etc/OpenCL/vendors"
];
# fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified
makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined" ];
meta = with lib; {
description = "OpenCL ICD Loader for ${opencl-headers.name}";
mainProgram = "cllayerinfo";
homepage = "https://github.com/OCL-dev/ocl-icd";
license = licenses.bsd2;
platforms = platforms.unix ++ platforms.windows;
maintainers = with maintainers; [ r-burns ];
};
}