From b43959a817c115d92d5adcf7c6db80e58aa22e92 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 16 Jul 2021 01:59:26 -0400 Subject: pypy: fix for sandboxed darwin The implementation of multiprocessing.cpu_count() tries to call the impure sysctl binary. In the sandbox that fails, so cffi bindings are not generated. --- pkgs/development/interpreters/python/pypy/default.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkgs/development/interpreters/python') diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index a5ba4983e43..1f229c7d34e 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -84,6 +84,9 @@ in with passthru; stdenv.mkDerivation rec { ]; postPatch = '' + substituteInPlace lib_pypy/pypy_tools/build_cffi_imports.py \ + --replace "multiprocessing.cpu_count()" "$NIX_BUILD_CORES" + substituteInPlace "lib-python/${if isPy3k then "3/tkinter/tix.py" else "2.7/lib-tk/Tix.py"}" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" sed -i "s@libraries=\['sqlite3'\]\$@libraries=['sqlite3'], include_dirs=['${sqlite.dev}/include'], library_dirs=['${sqlite.out}/lib']@" lib_pypy/_sqlite3_build.py -- cgit 1.4.1