aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/tkinter/default.nix
blob: bd242c62ab8d3fe7de07a94581426ab6ae6a82eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ stdenv
, buildPythonPackage
, python
, py
, isPyPy
}:

buildPythonPackage rec {
  name = "tkinter-${python.version}";
  src = py;
  format = "other";

  disabled = isPyPy;

  installPhase = ''
    # Move the tkinter module
    mkdir -p $out/${py.sitePackages}
    mv lib/${py.libPrefix}/lib-dynload/_tkinter* $out/${py.sitePackages}/
  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
    # Update the rpath to point to python without x11Support
    old_rpath=$(patchelf --print-rpath $out/${py.sitePackages}/_tkinter*)
    new_rpath=$(sed "s#${py}#${python}#g" <<< "$old_rpath" )
    patchelf --set-rpath $new_rpath $out/${py.sitePackages}/_tkinter*
  '';

  meta = py.meta;

}