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,6 +1,6 @@
 { stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi
 , sqlite, openssl, ncurses, pythonFull, expat, tcl, tk, xlibsWrapper, libX11
-, makeWrapper, callPackage, self }:
+, db, gdbm, makeWrapper, callPackage, self }:
 
 assert zlibSupport -> zlib != null;
 
@@ -21,7 +21,7 @@ let
       sha256 = "1g7iipllgdfjgdkypsa1g2pzxgjw9agp40rh82hk31rsbak2hfbl";
     };
 
-    buildInputs = [ bzip2 openssl pkgconfig pythonFull libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 makeWrapper ]
+    buildInputs = [ bzip2 openssl pkgconfig pythonFull libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 db gdbm makeWrapper ]
       ++ stdenv.lib.optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc
       ++ stdenv.lib.optional zlibSupport zlib;
 
@@ -31,16 +31,6 @@ let
       (stdenv.lib.filter (x : x.outPath != stdenv.cc.libc.outPath or "") buildInputs));
 
     preConfigure = ''
-      substituteInPlace Makefile \
-        --replace "-Ojit" "-Ojit --batch" \
-        --replace "pypy/goal/targetpypystandalone.py" "pypy/goal/targetpypystandalone.py --withmod-_minimal_curses --withmod-unicodedata --withmod-thread --withmod-bz2 --withmod-_multiprocessing"
-
-      # we are using cpython and not pypy to do translation
-      substituteInPlace rpython/bin/rpython \
-        --replace "/usr/bin/env pypy" "${pythonFull}/bin/python"
-      substituteInPlace pypy/goal/targetpypystandalone.py \
-        --replace "/usr/bin/env pypy" "${pythonFull}/bin/python"
-
       # hint pypy to find nix ncurses
       substituteInPlace pypy/module/_minimal_curses/fficurses.py \
         --replace "/usr/include/ncurses/curses.h" "${ncurses}/include/curses.h" \
@@ -57,19 +47,12 @@ let
       sed -i "s@libraries=\['sqlite3'\]\$@libraries=['sqlite3'], include_dirs=['${sqlite}/include'], library_dirs=['${sqlite}/lib']@" lib_pypy/_sqlite3_build.py
     '';
 
-    setupHook = ./setup-hook.sh;
-
-    postBuild = ''
-      cd ./lib_pypy
-        ../pypy-c ./_audioop_build.py
-        ../pypy-c ./_curses_build.py
-        ../pypy-c ./_pwdgrp_build.py
-        ../pypy-c ./_sqlite3_build.py
-        ../pypy-c ./_syslog_build.py
-        ../pypy-c ./_tkinter/tklib_build.py
-      cd ..
+    buildPhase = ''
+      ${pythonFull}/bin/python rpython/bin/rpython -Ojit --batch pypy/goal/targetpypystandalone.py --withmod-_minimal_curses --withmod-unicodedata --withmod-thread --withmod-bz2 --withmod-_multiprocessing
     '';
 
+    setupHook = ./setup-hook.sh;
+
     doCheck = true;
     checkPhase = ''
        export TERMINFO="${ncurses}/share/terminfo/";