Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37766180
en ru br
ALT Linux repos
S:8.6.13-alt1
5.0: 8.5.5-alt2
4.1: 8.5.2-alt1
4.0: 8.4.17-alt0.M40.1
3.0: 8.4.11-alt1

Group :: Development/Tcl
RPM: tcl

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 0005-ALT-libpath.patch
Download


From 124344d7daa8886ebf5a8c813e601bb54e151609 Mon Sep 17 00:00:00 2001
From: Sergey Bolshakov <sbolshakov@altlinux.org>
Date: Sat, 15 Sep 2007 00:12:52 +0400
Subject: [PATCH] ALT libpath
Co-Authored-by: Vladimir D. Seleznev <vseleznv@altlinux.org>
---
 tcl/library/init.tcl    |  5 -----
 tcl/tests/unixInit.test | 20 +++++++++++---------
 tcl/unix/configure.in   |  6 ++----
 tcl/unix/tclUnixInit.c  |  7 +++----
 4 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/tcl/library/init.tcl b/tcl/library/init.tcl
index 0655dc87b8..de92960ced 100644
--- a/tcl/library/init.tcl
+++ b/tcl/library/init.tcl
@@ -57,11 +57,6 @@ namespace eval tcl {
 		lappend ::auto_path $Dir
 	    }
 	}
-	set Dir [file join [file dirname [file dirname \
-		[info nameofexecutable]]] lib]
-	if {$Dir ni $::auto_path} {
-	    lappend ::auto_path $Dir
-	}
 	if {[info exists ::tcl_pkgPath]} { catch {
 	    foreach Dir $::tcl_pkgPath {
 		if {$Dir ni $::auto_path} {
diff --git a/tcl/tests/unixInit.test b/tcl/tests/unixInit.test
index 51ecafe438..1f2b07603c 100644
--- a/tcl/tests/unixInit.test
+++ b/tcl/tests/unixInit.test
@@ -102,7 +102,7 @@ test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -setup
     }
 } -body {
     set path [getlibpath]
-    set installLib lib/tcl[info tclversion]
+    set installLib share/tcl/tcl[info tclversion]
     set developLib tcl[info patchlevel]/library
     set prefix [file dirname [file dirname [interpreter]]]
     list [string equal [lindex $path 0] $prefix/$installLib] \
@@ -174,16 +174,18 @@ test unixInit-2.6 {TclpInitLibraryPath: executable relative} -setup {
     makeDirectory [file join tmp sparkly bin]
     file copy [interpreter] [file join [temporaryDirectory] tmp sparkly \
 	    bin tcltest]
-    makeDirectory [file join tmp sparkly lib]
-    makeDirectory [file join tmp sparkly lib tcl[info tclversion]]
-    makeFile {} [file join tmp sparkly lib tcl[info tclversion] init.tcl]
+    makeDirectory [file join tmp sparkly share]
+    makeDirectory [file join tmp sparkly share tcl]
+    makeDirectory [file join tmp sparkly share tcl tcl[info tclversion]]
+    makeFile {} [file join tmp sparkly share tcl tcl[info tclversion] init.tcl]
 } -body {
     lrange [getlibpath [file join [temporaryDirectory] tmp sparkly \
 	    bin tcltest]] 1 2
 } -cleanup {
-    removeFile [file join tmp sparkly lib tcl[info tclversion] init.tcl]
-    removeDirectory [file join tmp sparkly lib tcl[info tclversion]]
-    removeDirectory [file join tmp sparkly lib]
+    removeFile [file join tmp sparkly share tcl tcl[info tclversion] init.tcl]
+    removeDirectory [file join tmp sparkly share tcl tcl[info tclversion]]
+    removeDirectory [file join tmp sparkly share tcl]
+    removeDirectory [file join tmp sparkly share]
     removeDirectory [file join tmp sparkly bin]
     removeDirectory [file join tmp sparkly]
     removeDirectory tmp
@@ -192,7 +194,7 @@ test unixInit-2.6 {TclpInitLibraryPath: executable relative} -setup {
 	set env(TCL_LIBRARY) $oldlibrary
 	unset oldlibrary
     }
-} -result [list [temporaryDirectory]/tmp/sparkly/lib/tcl[info tclversion] [temporaryDirectory]/tmp/lib/tcl[info tclversion]]
+} -result [list [temporaryDirectory]/tmp/sparkly/share/tcl//tcl[info tclversion] [temporaryDirectory]/tmp/share/tcl//tcl[info tclversion]]
 test unixInit-2.7 {TclpInitLibraryPath: compiled-in library path} {
     # would need test command to get defaultLibDir and compare it to
     # [lindex $auto_path end]
@@ -282,7 +284,7 @@ test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} -setup {
 	set env(TCL_LIBRARY) $oldlibrary
 	unset oldlibrary
     }
-} -result [list /tmp/lib/tcl[info tclversion] /lib/tcl[info tclversion] \
+} -result [list /tmp/share/tcl/tcl[info tclversion] /share/tcl/tcl[info tclversion] \
         /tmp/library /library /tcl[info patchlevel]/library]
 test unixInit-2.10 {TclpInitLibraryPath: executable relative} -setup {
     unset -nocomplain oldlibrary
diff --git a/tcl/unix/configure.in b/tcl/unix/configure.in
index 68680a2672..17385a7c12 100644
--- a/tcl/unix/configure.in
+++ b/tcl/unix/configure.in
@@ -773,7 +773,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
 
 eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
 
-test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
+test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/share/tcl/tcl$(VERSION)'
 PRIVATE_INCLUDE_DIR='$(includedir)'
 HTML_DIR='$(DISTDIR)/html'
 
@@ -865,10 +865,8 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
 	TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl ~/Library/Frameworks /Library/Frameworks"
     test -z "$TCL_MODULE_PATH"  && \
 	TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl"
-elif test "$prefix/lib" != "$libdir"; then
-    test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${libdir}} {${prefix}/lib} ${TCL_PACKAGE_PATH}"
 else
-    test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${prefix}/lib} ${TCL_PACKAGE_PATH}"
+    test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="{${prefix}/share/tcl} {${libdir}/tcl}"
 fi
 
 #--------------------------------------------------------------------
diff --git a/tcl/unix/tclUnixInit.c b/tcl/unix/tclUnixInit.c
index 746793815b..59f83b3021 100644
--- a/tcl/unix/tclUnixInit.c
+++ b/tcl/unix/tclUnixInit.c
@@ -500,7 +500,7 @@ TclpInitLibraryPath(
 	 * installed.
 	 */
 
-	sprintf(installLib, "lib/tcl%s", TCL_VERSION);
+	sprintf(installLib, "share/tcl/tcl%s", TCL_VERSION);
 
 	/*
 	 * If TCL_LIBRARY is set, search there.
@@ -509,7 +509,7 @@ TclpInitLibraryPath(
 	Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_NewStringObj(str, -1));
 
 	Tcl_SplitPath(str, &pathc, &pathv);
-	if ((pathc > 0) && (strcasecmp(installLib + 4, pathv[pathc-1]) != 0)) {
+	if ((pathc > 0) && (strcasecmp(installLib + 10, pathv[pathc-1]) != 0)) {
 	    /*
 	     * If TCL_LIBRARY is set but refers to a different tcl
 	     * installation than the current version, try fiddling with the
@@ -517,8 +517,7 @@ TclpInitLibraryPath(
 	     * removing the old "tclX.Y" and substituting the current version
 	     * string.
 	     */
-
-	    pathv[pathc - 1] = installLib + 4;
+	    pathv[pathc - 1] = installLib + 10;
 	    str = Tcl_JoinPath(pathc, pathv, &ds);
 	    Tcl_ListObjAppendElement(NULL, pathPtr, TclDStringToObj(&ds));
 	}
-- 
2.33.5
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin