1{ stdenv
2, buildPythonPackage
3, python
4, py
5, isPyPy
6}:
7
8buildPythonPackage {
9 pname = "tkinter";
10 version = python.version;
11 src = py;
12 format = "other";
13
14 disabled = isPyPy;
15
16 installPhase = ''
17 # Move the tkinter module
18 mkdir -p $out/${py.sitePackages}
19 mv lib/${py.libPrefix}/lib-dynload/_tkinter* $out/${py.sitePackages}/
20 '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
21 # Update the rpath to point to python without x11Support
22 old_rpath=$(patchelf --print-rpath $out/${py.sitePackages}/_tkinter*)
23 new_rpath=$(sed "s#${py}#${python}#g" <<< "$old_rpath" )
24 patchelf --set-rpath $new_rpath $out/${py.sitePackages}/_tkinter*
25 '';
26
27 meta = py.meta;
28
29}