2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-05-20 23:08:51 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
2022-02-10 20:34:41 +00:00
|
|
|
, appdirs
|
2020-04-24 23:36:52 +00:00
|
|
|
, cffi
|
|
|
|
, decorator
|
2023-03-15 16:39:30 +00:00
|
|
|
, mako
|
2022-02-10 20:34:41 +00:00
|
|
|
, mesa_drivers
|
|
|
|
, numpy
|
2020-04-24 23:36:52 +00:00
|
|
|
, ocl-icd
|
2023-10-09 19:29:22 +00:00
|
|
|
, oldest-supported-numpy
|
2022-02-10 20:34:41 +00:00
|
|
|
, opencl-headers
|
|
|
|
, platformdirs
|
2020-04-24 23:36:52 +00:00
|
|
|
, pybind11
|
2022-02-10 20:34:41 +00:00
|
|
|
, pytest
|
2023-07-15 17:15:38 +00:00
|
|
|
, pytestCheckHook
|
2022-02-10 20:34:41 +00:00
|
|
|
, pytools
|
2023-07-15 17:15:38 +00:00
|
|
|
, setuptools
|
2022-02-10 20:34:41 +00:00
|
|
|
, six
|
2023-10-09 19:29:22 +00:00
|
|
|
, wheel
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
let
|
|
|
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2023.1.2";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-6wDNV0BJ1ZK2edz4v+erSjbJSjn9Gssaa0XWwNe+mmg=";
|
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
|
|
|
|
2021-05-20 23:08:51 +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;
|
|
|
|
maintainers = [ maintainers.fridh ];
|
|
|
|
};
|
|
|
|
}
|