From 0ad178d902aee02c3538098aafe8a75ed619a8c6 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 31 May 2023 22:59:33 +0200 Subject: [PATCH 1/2] tk: hardcode path to TK_LIBRARY --- pkgs/development/libraries/tk/8.6.nix | 4 +++ .../libraries/tk/tk-8_6_13-find-library.patch | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/libraries/tk/tk-8_6_13-find-library.patch diff --git a/pkgs/development/libraries/tk/8.6.nix b/pkgs/development/libraries/tk/8.6.nix index 3e3d8ad54011..fbf456051754 100644 --- a/pkgs/development/libraries/tk/8.6.nix +++ b/pkgs/development/libraries/tk/8.6.nix @@ -14,4 +14,8 @@ callPackage ./generic.nix (args // { sha256 = "sha256-LmX6BpojNlRAo8VsVWuGc7XjKig4ANjZslfj9YTOBnU="; }; + patches = [ + ./tk-8_6_13-find-library.patch + ]; + }) diff --git a/pkgs/development/libraries/tk/tk-8_6_13-find-library.patch b/pkgs/development/libraries/tk/tk-8_6_13-find-library.patch new file mode 100644 index 000000000000..a055ade80cc0 --- /dev/null +++ b/pkgs/development/libraries/tk/tk-8_6_13-find-library.patch @@ -0,0 +1,25 @@ +diff --git a/generic/tkWindow.c b/generic/tkWindow.c +index fa25553..ad45598 100644 +--- a/generic/tkWindow.c ++++ b/generic/tkWindow.c +@@ -1045,6 +1045,7 @@ TkCreateMainWindow( + + Tcl_SetVar2(interp, "tk_patchLevel", NULL, TK_PATCH_LEVEL, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tk_version", NULL, TK_VERSION, TCL_GLOBAL_ONLY); ++ Tcl_SetVar2(interp, "tk_library", NULL, TK_LIBRARY, TCL_GLOBAL_ONLY); + + tsdPtr->numMainWindows++; + return tkwin; +diff --git a/unix/Makefile.in b/unix/Makefile.in +index e98070e..f417753 100644 +--- a/unix/Makefile.in ++++ b/unix/Makefile.in +@@ -1033,7 +1033,7 @@ tkVisual.o: $(GENERIC_DIR)/tkVisual.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c + + tkWindow.o: $(GENERIC_DIR)/tkWindow.c tkUuid.h +- $(CC) -c $(CC_SWITCHES) -I. $(GENERIC_DIR)/tkWindow.c ++ $(CC) -c $(CC_SWITCHES) -I. -DTK_LIBRARY=\"${TK_LIBRARY}\" $(GENERIC_DIR)/tkWindow.c + + tkButton.o: $(GENERIC_DIR)/tkButton.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c From 8a6917f715543d7ca3480ef15770c595241d7a87 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 31 May 2023 22:59:51 +0200 Subject: [PATCH 2/2] thonny: drop TK_LIBRARY --- pkgs/applications/editors/thonny/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/editors/thonny/default.nix b/pkgs/applications/editors/thonny/default.nix index 40ba0701ce71..a6d698b65a13 100644 --- a/pkgs/applications/editors/thonny/default.nix +++ b/pkgs/applications/editors/thonny/default.nix @@ -42,7 +42,6 @@ buildPythonApplication rec { preFixup = '' wrapProgram "$out/bin/thonny" \ - --set TK_LIBRARY "${tk}/lib/${tk.libPrefix}" \ --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath ${python3.pkgs.jedi}) ''; @@ -64,6 +63,6 @@ buildPythonApplication rec { homepage = "https://www.thonny.org/"; license = licenses.mit; maintainers = with maintainers; [ leenaars ]; - platforms = platforms.linux; + platforms = platforms.unix; }; }