diff --git a/pkgs/development/python-modules/pyopencl/default.nix b/pkgs/development/python-modules/pyopencl/default.nix index b1e81140a906..d983e2bc14cc 100644 --- a/pkgs/development/python-modules/pyopencl/default.nix +++ b/pkgs/development/python-modules/pyopencl/default.nix @@ -1,4 +1,5 @@ { lib +, stdenv , fetchPypi , buildPythonPackage , Mako @@ -12,14 +13,18 @@ , opencl-headers , ocl-icd , pybind11 +, mesa_drivers }: -buildPythonPackage rec { +let + os-specific-buildInputs = + if stdenv.isDarwin then [ mesa_drivers.dev ] else [ ocl-icd ]; +in buildPythonPackage rec { pname = "pyopencl"; version = "2021.1.4"; checkInputs = [ pytest ]; - buildInputs = [ opencl-headers ocl-icd pybind11 ]; + buildInputs = [ opencl-headers pybind11 ] ++ os-specific-buildInputs; propagatedBuildInputs = [ numpy cffi pytools decorator appdirs six Mako ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b9cda5ce3a39..d75a16153781 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5866,7 +5866,9 @@ in { phonemizer = callPackage ../development/python-modules/phonemizer { }; - pyopencl = callPackage ../development/python-modules/pyopencl { }; + pyopencl = callPackage ../development/python-modules/pyopencl { + mesa_drivers = pkgs.mesa.drivers; + }; pyopengl = callPackage ../development/python-modules/pyopengl { };