spacepaste

diff --git a/pkgs/development/interpreters/pypy/default.nix b/pkgs/development/interpreters/pypy/default.nix
index d950184..06b4e3c 100644
a/pkgs/development/interpreters/pypy/default.nix
b/pkgs/development/interpreters/pypy/default.nix
1 1 { stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi
2 2 , sqlite, openssl, ncurses, pythonFull, expat, tcl, tk, xlibsWrapper, libX11
3 , makeWrapper, callPackage, self }:
3 , db, gdbm, makeWrapper, callPackage, self }:
4 4
5 5 assert zlibSupport -> zlib != null;
6 6
21 21 sha256 = "1g7iipllgdfjgdkypsa1g2pzxgjw9agp40rh82hk31rsbak2hfbl";
22 22 };
23 23
24 buildInputs = [ bzip2 openssl pkgconfig pythonFull libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 makeWrapper ]
24 buildInputs = [ bzip2 openssl pkgconfig pythonFull libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 db gdbm makeWrapper ]
25 25 ++ stdenv.lib.optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc
26 26 ++ stdenv.lib.optional zlibSupport zlib;
27 27
31 31 (stdenv.lib.filter (x : x.outPath != stdenv.cc.libc.outPath or "") buildInputs));
32 32
33 33 preConfigure = ''
34 substituteInPlace Makefile \
35 --replace "-Ojit" "-Ojit --batch" \
36 --replace "pypy/goal/targetpypystandalone.py" "pypy/goal/targetpypystandalone.py --withmod-_minimal_curses --withmod-unicodedata --withmod-thread --withmod-bz2 --withmod-_multiprocessing"
37
38 # we are using cpython and not pypy to do translation
39 substituteInPlace rpython/bin/rpython \
40 --replace "/usr/bin/env pypy" "${pythonFull}/bin/python"
41 substituteInPlace pypy/goal/targetpypystandalone.py \
42 --replace "/usr/bin/env pypy" "${pythonFull}/bin/python"
43
44 34 # hint pypy to find nix ncurses
45 35 substituteInPlace pypy/module/_minimal_curses/fficurses.py \
46 36 --replace "/usr/include/ncurses/curses.h" "${ncurses}/include/curses.h" \
57 47 sed -i "s@libraries=\['sqlite3'\]\$@libraries=['sqlite3'], include_dirs=['${sqlite}/include'], library_dirs=['${sqlite}/lib']@" lib_pypy/_sqlite3_build.py
58 48 '';
59 49
60 setupHook = ./setup-hook.sh;
61
62 postBuild = ''
63 cd ./lib_pypy
64 ../pypy-c ./_audioop_build.py
65 ../pypy-c ./_curses_build.py
66 ../pypy-c ./_pwdgrp_build.py
67 ../pypy-c ./_sqlite3_build.py
68 ../pypy-c ./_syslog_build.py
69 ../pypy-c ./_tkinter/tklib_build.py
70 cd ..
50 buildPhase = ''
51 ${pythonFull}/bin/python rpython/bin/rpython -Ojit --batch pypy/goal/targetpypystandalone.py --withmod-_minimal_curses --withmod-unicodedata --withmod-thread --withmod-bz2 --withmod-_multiprocessing
71 52 '';
72 53
54 setupHook = ./setup-hook.sh;
55
73 56 doCheck = true;
74 57 checkPhase = ''
75 58 export TERMINFO="${ncurses}/share/terminfo/";