Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, fetchPypi 4, buildPythonPackage 5, appdirs 6, cffi 7, decorator 8, mako 9, mesa_drivers 10, numpy 11, ocl-icd 12, opencl-headers 13, platformdirs 14, pybind11 15, pytest 16, pytools 17, six 18}: 19 20let 21 os-specific-buildInputs = 22 if stdenv.isDarwin then [ mesa_drivers.dev ] else [ ocl-icd ]; 23in buildPythonPackage rec { 24 pname = "pyopencl"; 25 version = "2022.3.1"; 26 27 nativeCheckInputs = [ pytest ]; 28 buildInputs = [ opencl-headers pybind11 ] ++ os-specific-buildInputs; 29 30 propagatedBuildInputs = [ 31 appdirs 32 cffi 33 decorator 34 mako 35 numpy 36 platformdirs 37 pytools 38 six 39 ]; 40 41 src = fetchPypi { 42 inherit pname version; 43 hash = "sha256-Sj2w/mG1zclSZ1Jt7r1xp+HXlWlNSw/idh8GMLzKNiE="; 44 }; 45 46 # py.test is not needed during runtime, so remove it from `install_requires` 47 postPatch = '' 48 substituteInPlace setup.py --replace "pytest>=2" "" 49 ''; 50 51 preBuild = '' 52 export HOME=$(mktemp -d) 53 ''; 54 55 # gcc: error: pygpu_language_opencl.cpp: No such file or directory 56 doCheck = false; 57 58 meta = with lib; { 59 description = "Python wrapper for OpenCL"; 60 homepage = "https://github.com/pyopencl/pyopencl"; 61 license = licenses.mit; 62 maintainers = [ maintainers.fridh ]; 63 }; 64}