tk: Hardcode path to TK_LIBRARY.

Fixes <http://bugs.gnu.org/20889>.

* gnu/packages/patches/tk-find-library.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/tcl.scm (tk)[source]: Add patch.
This commit is contained in:
宋文武 2015-11-12 13:31:19 +08:00 committed by Ludovic Courtès
parent 26059753ae
commit 79c8a071e7
3 changed files with 32 additions and 1 deletions

View file

@ -701,6 +701,7 @@ dist_patch_DATA = \
gnu/packages/patches/texi2html-i18n.patch \ gnu/packages/patches/texi2html-i18n.patch \
gnu/packages/patches/tidy-CVE-2015-5522+5523.patch \ gnu/packages/patches/tidy-CVE-2015-5522+5523.patch \
gnu/packages/patches/tinyxml-use-stl.patch \ gnu/packages/patches/tinyxml-use-stl.patch \
gnu/packages/patches/tk-find-library.patch \
gnu/packages/patches/torsocks-dns-test.patch \ gnu/packages/patches/torsocks-dns-test.patch \
gnu/packages/patches/tvtime-gcc41.patch \ gnu/packages/patches/tvtime-gcc41.patch \
gnu/packages/patches/tvtime-pngoutput.patch \ gnu/packages/patches/tvtime-pngoutput.patch \

View file

@ -0,0 +1,29 @@
This patch hard-codes the Tk library directory during package initialization.
See <http://core.tcl.tk/tk/tktview/765642ffffffffffffff>.
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index b5cbbab..96b5501 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -988,6 +988,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 f21fdbb..c61b0df 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1029,7 +1029,7 @@ tkVisual.o: $(GENERIC_DIR)/tkVisual.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c
tkWindow.o: $(GENERIC_DIR)/tkWindow.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkWindow.c
+ $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" $(GENERIC_DIR)/tkWindow.c
tkButton.o: $(GENERIC_DIR)/tkButton.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c

View file

@ -140,7 +140,8 @@ (define-public tk
version "/tk" version "-src.tar.gz")) version "/tk" version "-src.tar.gz"))
(sha256 (sha256
(base32 (base32
"1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88")))) "1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88"))
(patches (list (search-patch "tk-find-library.patch")))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases '(#:phases (modify-phases %standard-phases