From 94c3ac25747538f2c5057fae6dc50a32e51a3b9b Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 7 Mar 2019 22:26:45 +0100 Subject: [PATCH 1/2] pythonPackages.pybind11: apply patch to properly get headers directories It seems as the `pybind11` build code returns the Python headers directory (where the `pybind11` headers are stored as well on traditional setups) rather than returning the dedicated prefix[1]. An exemplary fallout is the broken build of `pyopencl`[2]. [1] https://github.com/pybind/pybind11/issues/1425 [2] https://github.com/NixOS/nixpkgs/pull/56082 --- pkgs/development/python-modules/pybind11/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pybind11/default.nix b/pkgs/development/python-modules/pybind11/default.nix index 0bdac6594062..f49c50185db7 100644 --- a/pkgs/development/python-modules/pybind11/default.nix +++ b/pkgs/development/python-modules/pybind11/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, fetchPypi }: +{ lib, buildPythonPackage, fetchPypi, fetchpatch }: buildPythonPackage rec { pname = "pybind11"; @@ -9,6 +9,13 @@ buildPythonPackage rec { sha256 = "1kz1z2cg3q901q9spkdhksmcfiskaghzmbb9ivr5mva856yvnak4"; }; + patches = [ + (fetchpatch { + url = https://github.com/pybind/pybind11/commit/44a40dd61e5178985cfb1150cf05e6bfcec73042.patch; + sha256 = "047nzyfsihswdva96hwchnp4gj2mlbiqvmkdnhxrfi9sji8x31ka"; + }) + ]; + # Current PyPi version does not include test suite doCheck = false; From d2379192b5056b335dcfd541cf004e6ed87086ab Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 7 Mar 2019 22:29:14 +0100 Subject: [PATCH 2/2] python3Packages.pyopencl: fix build Fix the recently broken build by adding `pybind11` to the build. Also set $HOME to a temporary directory during the build to avoid "Permission denied" errors in the build script. This also unbreaks `sasview` and `pybitmessage`. See also #56826 See also https://hydra.nixos.org/build/89037506 --- pkgs/development/python-modules/pyopencl/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pyopencl/default.nix b/pkgs/development/python-modules/pyopencl/default.nix index 274c72974fe6..edfc8b42daf9 100644 --- a/pkgs/development/python-modules/pyopencl/default.nix +++ b/pkgs/development/python-modules/pyopencl/default.nix @@ -11,6 +11,7 @@ , six , opencl-headers , ocl-icd +, pybind11 }: buildPythonPackage rec { @@ -18,7 +19,7 @@ buildPythonPackage rec { version = "2018.2.2"; checkInputs = [ pytest ]; - buildInputs = [ opencl-headers ocl-icd ]; + buildInputs = [ opencl-headers ocl-icd pybind11 ]; propagatedBuildInputs = [ numpy cffi pytools decorator appdirs six Mako ]; @@ -32,6 +33,10 @@ buildPythonPackage rec { substituteInPlace setup.py --replace "pytest>=2" "" ''; + preBuild = '' + export HOME=$(mktemp -d) + ''; + # gcc: error: pygpu_language_opencl.cpp: No such file or directory doCheck = false;