2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
appdirs,
|
|
|
|
cffi,
|
|
|
|
decorator,
|
|
|
|
mako,
|
|
|
|
mesa_drivers,
|
|
|
|
numpy,
|
|
|
|
ocl-icd,
|
|
|
|
oldest-supported-numpy,
|
|
|
|
opencl-headers,
|
|
|
|
platformdirs,
|
|
|
|
pybind11,
|
|
|
|
pytestCheckHook,
|
|
|
|
pytools,
|
|
|
|
setuptools,
|
|
|
|
six,
|
|
|
|
wheel,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
os-specific-buildInputs = if stdenv.isDarwin then [ mesa_drivers.dev ] else [ ocl-icd ];
|
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pyopencl";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2024.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-7NVy7pQK2L2hY5w6e+tog0/JqYrX6z9uAarE99nUusE=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
oldest-supported-numpy
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [
|
|
|
|
opencl-headers
|
|
|
|
pybind11
|
|
|
|
] ++ os-specific-buildInputs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
cffi
|
|
|
|
decorator
|
2023-03-15 16:39:30 +00:00
|
|
|
mako
|
2022-02-10 20:34:41 +00:00
|
|
|
numpy
|
|
|
|
platformdirs
|
|
|
|
pytools
|
|
|
|
six
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
# gcc: error: pygpu_language_opencl.cpp: No such file or directory
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pythonImportsCheck = [ "pyopencl" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python wrapper for OpenCL";
|
|
|
|
homepage = "https://github.com/pyopencl/pyopencl";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|