Skip to content

Commit

Permalink
pythonPackages.tkinter: patch rpath to use only one interpreter
Browse files Browse the repository at this point in the history
The `tkinter` module is copied from a build of `python` with
`x11Support=true;` but has a reference to that build of `python`. We
however want to use the module in combination with a build of `python`
with `x11Support=false;` (the default). Therefore we patch the rpath to
refer to that `python` instead.
  • Loading branch information
FRidh committed Jan 4, 2017
1 parent 567c1a3 commit e276f59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25512,9 +25512,13 @@ in {
disabled = isPy26 || isPyPy;

installPhase = ''
# Move the tkinter module
mkdir -p $out/${py.sitePackages}
ls -Al lib/${py.libPrefix}/lib-dynload/ | grep tkinter
mv lib/${py.libPrefix}/lib-dynload/_tkinter* $out/${py.sitePackages}/
# 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*
'';

inherit (py) meta;
Expand Down

0 comments on commit e276f59

Please sign in to comment.