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
|
2022-02-10 20:34:41 +00:00
|
|
|
, Mako
|
|
|
|
, mesa_drivers
|
|
|
|
, numpy
|
2020-04-24 23:36:52 +00:00
|
|
|
, ocl-icd
|
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
|
|
|
|
, pytools
|
|
|
|
, six
|
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-01-20 10:41:00 +00:00
|
|
|
version = "2022.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
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
|
|
|
|
Mako
|
|
|
|
numpy
|
|
|
|
platformdirs
|
|
|
|
pytools
|
|
|
|
six
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-Sj2w/mG1zclSZ1Jt7r1xp+HXlWlNSw/idh8GMLzKNiE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# py.test is not needed during runtime, so remove it from `install_requires`
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace "pytest>=2" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
# gcc: error: pygpu_language_opencl.cpp: No such file or directory
|
|
|
|
doCheck = false;
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|