From 19e80fa19d01fb0f15d6b99c860c7a9b0de264b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 27 Jun 2016 17:02:19 +0200 Subject: [PATCH] pypy: fix pyexpat tests with expat-2.2.0 /cc #16477. /cc @domenKozar (don't know who better), as I still experience test failures of different kind: =================================== FAILURES =================================== _______________________________________ _______________________________________ Traceback (most recent call last): File "/tmp/nix-build-pypy-5.1.1.drv-0/pypy-pypy-b0a649e90b66/pypy/tool/pytest/run-script/regrverbose.py", line 14, in indirect_test() File "/tmp/nix-build-pypy-5.1.1.drv-0/pypy-pypy-b0a649e90b66/lib-python/2.7/test/test_ctypes.py", line 10, in test_main skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0) File "/tmp/nix-build-pypy-5.1.1.drv-0/pypy-pypy-b0a649e90b66/lib-python/2.7/ctypes/test/__init__.py", line 72, in get_tests mod = __import__(modname, globals(), locals(), ['*']) File "/tmp/nix-build-pypy-5.1.1.drv-0/pypy-pypy-b0a649e90b66/lib-python/2.7/ctypes/test/test_python_api.py", line 9, in from _ctypes import PyObj_FromPtr ImportError: cannot import name 'PyObj_FromPtr' =========================== short test summary info ============================ FAIL lib-python/2.7/test/test_ctypes.py::unmodified 9 tests deselected by '-knot ( test_ssl or test_urllib2net or test_urllibnet or test_urllib2_localnet or test_socket or test_shutil or test_zipfile64 or test_epoll )' ======= 1 failed, 341 passed, 51 skipped, 9 deselected in 550.97 seconds ======= --- pkgs/development/interpreters/pypy/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/interpreters/pypy/default.nix b/pkgs/development/interpreters/pypy/default.nix index 708c251e4aff..f07e53e592f5 100644 --- a/pkgs/development/interpreters/pypy/default.nix +++ b/pkgs/development/interpreters/pypy/default.nix @@ -21,6 +21,17 @@ let sha256 = "1dmckvffanmh0b50pq34shnw05r55gjxn43kgvnkz5kkvvsbxdg1"; }; + # http://bugs.python.org/issue27369 + postPatch = let + expatch = fetchurl { + name = "tests-expat-2.2.0.patch"; + url = "http://bugs.python.org/file43514/0001-Fix-Python-2.7.11-tests-for-Expat-2.2.0.patch"; + sha256 = "1j3pa7ly9xrhp8jjwg5l77z7i3y68gx8f8jchqk6zc39d9glq3il"; + }; + in '' + patch lib-python/2.7/test/test_pyexpat.py < '${expatch}' + ''; + buildInputs = [ bzip2 openssl pkgconfig pythonFull libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 makeWrapper gdbm db ] ++ stdenv.lib.optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++ stdenv.lib.optional zlibSupport zlib;