summary refs log tree commit diff
path: root/pkgs/development/python-modules/tkinter
diff options
context:
space:
mode:
authorChris Ostrouchov <chris.ostrouchov@gmail.com>2018-10-28 11:34:55 -0400
committerChris Ostrouchov <chris.ostrouchov@gmail.com>2018-10-30 00:50:53 -0400
commitc3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65 (patch)
tree2b8d96fcf4a830f2a020164978ab3b2f7da8410f /pkgs/development/python-modules/tkinter
parent8d26762f197b6dd39a66789bc8c3c75dbc7dff40 (diff)
downloadnixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.tar
nixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.tar.gz
nixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.tar.bz2
nixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.tar.lz
nixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.tar.xz
nixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.tar.zst
nixpkgs-c3793aa1b1b3ab8d1a9fdf74c34f659c0c568b65.zip
pythonPackages.tkinter: refactor move to python-modules
Diffstat (limited to 'pkgs/development/python-modules/tkinter')
-rw-r--r--pkgs/development/python-modules/tkinter/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/tkinter/default.nix b/pkgs/development/python-modules/tkinter/default.nix
new file mode 100644
index 00000000000..bd242c62ab8
--- /dev/null
+++ b/pkgs/development/python-modules/tkinter/default.nix
@@ -0,0 +1,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;
+
+}