From 89530810e6de191e8937a43c17b2087e7aab22ec Mon Sep 17 00:00:00 2001 From: noiioiu Date: Wed, 4 Jun 2025 06:54:54 -0500 Subject: [PATCH] python3Packages.tkinter-gl: use tkgl --- .../python-modules/tkinter-gl/default.nix | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/development/python-modules/tkinter-gl/default.nix b/pkgs/development/python-modules/tkinter-gl/default.nix index d10c824380ee..a39a6d940d4d 100644 --- a/pkgs/development/python-modules/tkinter-gl/default.nix +++ b/pkgs/development/python-modules/tkinter-gl/default.nix @@ -1,9 +1,11 @@ { lib, + python, buildPythonPackage, fetchFromGitHub, setuptools-scm, tkinter, + tkgl, }: buildPythonPackage rec { @@ -18,10 +20,28 @@ buildPythonPackage rec { hash = "sha256-ObI8EEQ7mAOAuV6f+Ld4HH0xkFzqiAZqHDvzjwPA/wM"; }; + postPatch = '' + # Remove compiled TkGL, we compile it ourselves + rm -r src/tkinter_gl/tk + # Platform-specific directories are only necessary when using compiled TkGL + substituteInPlace src/tkinter_gl/__init__.py \ + --replace-fail "pkg_dir = os.path.join(__path__[0], 'tk', sys.platform,)" \ + "pkg_dir = os.path.join(__path__[0], 'tk')" + ''; + build-system = [ setuptools-scm ]; dependencies = [ tkinter ]; + postInstall = + let + pkgDir = "$out/${python.sitePackages}/tkinter_gl/tk"; + in + '' + mkdir -p ${pkgDir} + ln -s ${tkgl}/lib/Tkgl* ${pkgDir} + ''; + pythonImportsCheck = [ "tkinter_gl" ]; meta = {