depot/third_party/nixpkgs/pkgs/development/python-modules/tkinter/default.nix
Default email ae91cbe6cc Project import generated by Copybara.
GitOrigin-RevId: 536fe36e23ab0fc8b7f35c24603422eee9fc17a2
2021-02-05 18:12:51 +01:00

30 lines
691 B
Nix

{ lib
, stdenv
, buildPythonPackage
, python
, py
, isPyPy
}:
buildPythonPackage {
pname = "tkinter";
version = 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}/
'' + 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;
}