summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/tcltk8
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/tcltk8')
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch33
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/alter-includedir.patch75
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/fix_non_native_build_issue.patch80
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/interp.patch40
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/run-ptest31
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/tcl-add-soname.patch42
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8/tcl-remove-hardcoded-install-path.patch31
-rw-r--r--meta/recipes-devtools/tcltk8/tcl8_8.6.16.bb122
8 files changed, 454 insertions, 0 deletions
diff --git a/meta/recipes-devtools/tcltk8/tcl8/0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch b/meta/recipes-devtools/tcltk8/tcl8/0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch
new file mode 100644
index 0000000000..1859992838
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch
@@ -0,0 +1,33 @@
1From ff508f2e6786df697876140f21855ecb92a3ed36 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Fri, 18 Aug 2023 12:25:11 +0200
4Subject: [PATCH] generic/tcl.h: use Tcl_WideInt for seconds in Tcl_Time
5
6This ensures the value will not overflow, particularly on 32 bit systems
7in 2038, where long will.
8
9This patch was proposed at https://core.tcl-lang.org/tcl/tktview/86dd172271
10Upstream was generally supportive of the fix, but they merged a much more
11elaborate version of it for tcl 9.x (released in 9.0.0), and declined
12to merge it into 8.x due to ABI breakage (sadly this change is in a public header).
13But we can carry the fix downstream.
14
15Upstream-Status: Inappropriate [see above]
16Signed-off-by: Alexander Kanavin <alex@linutronix.de>
17---
18 generic/tcl.h | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/generic/tcl.h b/generic/tcl.h
22index 3a4622e..6204c57 100644
23--- a/generic/tcl.h
24+++ b/generic/tcl.h
25@@ -1418,7 +1418,7 @@ typedef enum {
26 */
27
28 typedef struct Tcl_Time {
29- long sec; /* Seconds. */
30+ Tcl_WideInt sec; /* Seconds. */
31 long usec; /* Microseconds. */
32 } Tcl_Time;
33
diff --git a/meta/recipes-devtools/tcltk8/tcl8/alter-includedir.patch b/meta/recipes-devtools/tcltk8/tcl8/alter-includedir.patch
new file mode 100644
index 0000000000..6ceb297cea
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/alter-includedir.patch
@@ -0,0 +1,75 @@
1From 8bb8174e13c1c0e3b27fdf96a393f9fb1b7e14be Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Tue, 22 Nov 2022 18:48:27 +0800
4Subject: [PATCH] tcl: update the header location
5
6Lets install the include header and private header files into
7usr/include/tcl8.6 when version of tcl is 8.6.x
8
9Upstream-Status: Inappropriate [Configuration Specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmai.com>
12
13Fixed the TCL_INCLUDE_SPEC
14
15Also update the header location in tcl.pc to correct the header
16location in case some package such python3 which use pkg-config
17to detect tcl doesn't find the header.
18
19Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
20Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
21Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
22---
23 unix/Makefile.in | 2 +-
24 unix/configure.in | 4 ++--
25 unix/tcl.pc.in | 2 +-
26 3 files changed, 4 insertions(+), 4 deletions(-)
27
28diff --git a/unix/Makefile.in b/unix/Makefile.in
29index c3b75e3..60ed93e 100644
30--- a/unix/Makefile.in
31+++ b/unix/Makefile.in
32@@ -57,7 +57,7 @@ SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY)
33 MODULE_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)/../tcl8
34
35 # Directory in which to install the include file tcl.h:
36-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)
37+INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)/tcl$(VERSION)
38
39 # Path to the private tcl header dir:
40 PRIVATE_INCLUDE_DIR = @PRIVATE_INCLUDE_DIR@
41diff --git a/unix/configure.in b/unix/configure.in
42index 8e6726b..2345689 100644
43--- a/unix/configure.in
44+++ b/unix/configure.in
45@@ -775,7 +775,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
46 eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
47
48 test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
49-PRIVATE_INCLUDE_DIR='$(includedir)'
50+PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
51 HTML_DIR='$(DISTDIR)/html'
52
53 # Note: in the following variable, it's important to use the absolute
54@@ -898,7 +898,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
55 TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
56
57 # Install time header dir can be set via --includedir
58-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
59+eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
60
61 #------------------------------------------------------------------------
62 # tclConfig.sh refers to this by a different name
63diff --git a/unix/tcl.pc.in b/unix/tcl.pc.in
64index 93b5e69..dcd51d7 100644
65--- a/unix/tcl.pc.in
66+++ b/unix/tcl.pc.in
67@@ -3,7 +3,7 @@
68 prefix=@prefix@
69 exec_prefix=@exec_prefix@
70 libdir=@libdir@
71-includedir=@includedir@
72+includedir=@includedir@/tcl@PACKAGE_VERSION@
73 libfile=@TCL_LIB_FILE@
74
75 Name: Tool Command Language
diff --git a/meta/recipes-devtools/tcltk8/tcl8/fix_non_native_build_issue.patch b/meta/recipes-devtools/tcltk8/tcl8/fix_non_native_build_issue.patch
new file mode 100644
index 0000000000..61153878fe
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/fix_non_native_build_issue.patch
@@ -0,0 +1,80 @@
1From 3d11e7fd9aba6251974d990286347c06582e87b9 Mon Sep 17 00:00:00 2001
2From: Nitin A Kamble <nitin.a.kamble@intel.com>
3Date: Fri, 13 Aug 2010 12:24:00 -0700
4Subject: [PATCH] tcl: fix a build issue
5
6Upstream-Status: Inappropriate [upstream does not support installed tests]
7Signed-off-by: Alexander Kanavin <alex@linutronix.de>
8---
9 unix/Makefile.in | 20 ++++++++++----------
10 1 file changed, 10 insertions(+), 10 deletions(-)
11
12diff --git a/unix/Makefile.in b/unix/Makefile.in
13index a2f9e21..c3b75e3 100644
14--- a/unix/Makefile.in
15+++ b/unix/Makefile.in
16@@ -723,7 +723,7 @@ tcltest-real:
17 test: test-tcl test-packages
18
19 test-tcl: ${TCLTEST_EXE}
20- $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
21+ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
22
23 gdb-test: ${TCLTEST_EXE}
24 @printf '%s ' set env @LD_LIBRARY_PATH_VAR@=\"`pwd`$${@LD_LIBRARY_PATH_VAR@:+:$${@LD_LIBRARY_PATH_VAR}}\" > gdb.run
25@@ -732,17 +732,17 @@ gdb-test: ${TCLTEST_EXE}
26 @printf '\n' >>gdb.run
27 @printf '%s ' set args $(call shquotequote,$(TOP_DIR))/tests/all.tcl\
28 $(call shquotequote,$(TESTFLAGS)) -singleproc 1 >> gdb.run
29- $(GDB) ./${TCLTEST_EXE} --command=gdb.run
30+ $(GDB) ${TCLTEST_EXE} --command=gdb.run
31 rm gdb.run
32
33 # Useful target to launch a built tcltest with the proper path,...
34 runtest: ${TCLTEST_EXE}
35- $(SHELL_ENV) ./${TCLTEST_EXE}
36+ $(SHELL_ENV) ${TCLTEST_EXE}
37
38 # Useful target for running the test suite with an unwritable current
39 # directory...
40 ro-test: ${TCLTEST_EXE}
41- echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source -encoding utf-8 ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE}
42+ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source -encoding utf-8 ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ${TCLTEST_EXE}
43
44 # The following target generates the shared libraries in dltest/ that are used
45 # for testing; they are included as part of the "tcltest" target (via the
46@@ -760,28 +760,28 @@ dltest.marker: ${STUB_LIB_FILE}
47 # This target can be used to run tclsh from the build directory
48 # via `make shell SCRIPT=/tmp/foo.tcl`
49 shell: ${TCL_EXE}
50- $(SHELL_ENV) ./${TCL_EXE} $(SCRIPT)
51+ $(SHELL_ENV) ${TCL_EXE} $(SCRIPT)
52
53 # This target can be used to run tclsh inside either gdb or insight
54 gdb: ${TCL_EXE}
55- $(SHELL_ENV) $(GDB) ./${TCL_EXE}
56+ $(SHELL_ENV) $(GDB) ${TCL_EXE}
57
58 lldb: ${TCL_EXE}
59 $(SHELL_ENV) $(LLDB) ./${TCL_EXE}
60
61 valgrind: ${TCL_EXE} ${TCLTEST_EXE}
62- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} \
63+ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCLTEST_EXE} \
64 $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind \
65 $(TESTFLAGS)
66
67 valgrindshell: ${TCL_EXE}
68- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
69+ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCL_EXE} $(SCRIPT)
70
71 trace-shell: ${TCL_EXE}
72- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT)
73+ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCL_EXE} $(SCRIPT)
74
75 trace-test: ${TCLTEST_EXE}
76- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
77+ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
78
79 #--------------------------------------------------------------------------
80 # Installation rules
diff --git a/meta/recipes-devtools/tcltk8/tcl8/interp.patch b/meta/recipes-devtools/tcltk8/tcl8/interp.patch
new file mode 100644
index 0000000000..aeebb038e3
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/interp.patch
@@ -0,0 +1,40 @@
1From 09049beed723243d092ffaa37939dfe0f2ed6828 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Mon, 12 Jul 2021 14:50:13 +0100
4Subject: [PATCH] tcl: fix race in interp.test
5
6The interp-36.7 patch has race conditions and is missing cleanup. This patch by
7a Tcl maintainer should improve matters.
8
9Upstream-Status: Inappropriate [tcl 8.x is obsolete; upstream submission should be for 9.x patches]
10Signed-off-by: Ross Burton <ross.burton@arm.com>
11---
12 tests/interp.test | 7 ++++---
13 1 file changed, 4 insertions(+), 3 deletions(-)
14
15diff --git a/tests/interp.test b/tests/interp.test
16index 24ffb1b..c6460ad 100644
17--- a/tests/interp.test
18+++ b/tests/interp.test
19@@ -3614,17 +3614,18 @@ test interp-36.7 {ChildBgerror sets error handler of child [1999035]} -setup {
20 variable result
21 set result [lindex $args 0]
22 }
23+ set tout [after 5000 {set result timeout}]
24 } -body {
25 child eval {
26 variable done {}
27 after 0 error foo
28- after 10 [list ::set [namespace which -variable done] {}]
29- vwait [namespace which -variable done]
30 }
31+ vwait result
32 set result
33 } -cleanup {
34+ after cancel $tout
35 variable result {}
36- unset -nocomplain result
37+ unset -nocomplain result tout
38 interp delete child
39 } -result foo
40
diff --git a/meta/recipes-devtools/tcltk8/tcl8/run-ptest b/meta/recipes-devtools/tcltk8/tcl8/run-ptest
new file mode 100644
index 0000000000..bea9d9ccfd
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/run-ptest
@@ -0,0 +1,31 @@
1#!/bin/sh
2
3# clock.test needs a timezone to be set
4export TZ="Europe/London"
5export TCL_LIBRARY=@libdir@/tcl8/ptest/library
6export ERROR_ON_FAILURES=1
7
8# Some tests are overly strict with timings and fail on loaded systems.
9SKIP=""
10# 15321
11SKIP="$SKIP async-\* event-\*"
12# 14882
13SKIP="$SKIP cmdMZ-6.6"
14# 15081
15SKIP="$SKIP exit-1.\*"
16# 15407 15421
17SKIP="$SKIP \*io-46.1"
18# io-13.6 explicitly says it can fail on slow/loaded machines
19SKIP="$SKIP io-13.6"
20# 14825
21SKIP="$SKIP socket-\* socket_inet-\*"
22
23for i in tests/*.test; do
24 i=$(basename $i)
25 ./tcltest tests/all.tcl -file $i -skip "$SKIP"
26 if [ $? -eq 0 ]; then
27 echo "PASS: $i"
28 else
29 echo "FAIL: $i"
30 fi
31done
diff --git a/meta/recipes-devtools/tcltk8/tcl8/tcl-add-soname.patch b/meta/recipes-devtools/tcltk8/tcl8/tcl-add-soname.patch
new file mode 100644
index 0000000000..898e8241fc
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/tcl-add-soname.patch
@@ -0,0 +1,42 @@
1From 0d8e567d132e050c5d4a8d8d9257417e0679483c Mon Sep 17 00:00:00 2001
2From: Richard Purdie <rpurdie@linux.intel.com>
3Date: Wed, 9 Dec 2009 23:59:44 +0000
4Subject: [PATCH] tcl: Add tcltk from OE.dev but with legacy staging function
5
6Upstream-Status: Inappropriate [tcl 8.x is obsolete; upstream submission should be for 9.x patches]
7Signed-off-by: Alexander Kanavin <alex@linutronix.de>
8---
9 unix/Makefile.in | 5 ++++-
10 unix/tcl.m4 | 3 +++
11 2 files changed, 7 insertions(+), 1 deletion(-)
12
13diff --git a/unix/Makefile.in b/unix/Makefile.in
14index bc743b3..a2f9e21 100644
15--- a/unix/Makefile.in
16+++ b/unix/Makefile.in
17@@ -812,7 +812,10 @@ install-binaries: binaries
18 done
19 @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
20 @@INSTALL_LIB@
21- @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
22+ mv "$(DLL_INSTALL_DIR)"/$(LIB_FILE) "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
23+ ln -sf $(LIB_FILE).0 "$(DLL_INSTALL_DIR)"/$(LIB_FILE)
24+ ln -sf "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ./
25+ @chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
26 @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
27 @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
28 @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
29diff --git a/unix/tcl.m4 b/unix/tcl.m4
30index 7f5464e..cd8d929 100644
31--- a/unix/tcl.m4
32+++ b/unix/tcl.m4
33@@ -1378,6 +1378,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
34 # get rid of the warnings.
35 #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
36
37+ # following line added by CW for Debian GNU/Linux
38+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
39+
40 SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
41 DL_OBJS="tclLoadDl.o"
42 DL_LIBS="-ldl"
diff --git a/meta/recipes-devtools/tcltk8/tcl8/tcl-remove-hardcoded-install-path.patch b/meta/recipes-devtools/tcltk8/tcl8/tcl-remove-hardcoded-install-path.patch
new file mode 100644
index 0000000000..f2a37add7d
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/tcl-remove-hardcoded-install-path.patch
@@ -0,0 +1,31 @@
1From 6e3cbc3600ac474776e92eb9a88abcb74299c321 Mon Sep 17 00:00:00 2001
2From: "Song.Li" <Song.Li@windriver.com>
3Date: Wed, 1 Aug 2012 19:05:51 +0800
4Subject: [PATCH] tcl:install tcl to lib64 instead of lib on 64bit target
5
6Remove hardcoded library install path. Change $(prefix)/lib/ to ${libdir}.
7
8[YOCTO #2876]
9
10Upstream-Status: Inappropriate [tcl 8.x is obsolete; upstream submission should be for 9.x patches]
11
12Signed-off-by: Song.Li <Song.Li@windriver.com>
13Signed-off-by: Kai Kang <kai.kang@windriver.com>
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 unix/configure.in | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/unix/configure.in b/unix/configure.in
20index e88ec3c..8e6726b 100644
21--- a/unix/configure.in
22+++ b/unix/configure.in
23@@ -774,7 +774,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
24
25 eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
26
27-test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
28+test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
29 PRIVATE_INCLUDE_DIR='$(includedir)'
30 HTML_DIR='$(DISTDIR)/html'
31
diff --git a/meta/recipes-devtools/tcltk8/tcl8_8.6.16.bb b/meta/recipes-devtools/tcltk8/tcl8_8.6.16.bb
new file mode 100644
index 0000000000..225f04be48
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8_8.6.16.bb
@@ -0,0 +1,122 @@
1SUMMARY = "Tool Command Language"
2HOMEPAGE = "http://tcl.sourceforge.net"
3DESCRIPTION = "Tool Command Language, is an open-source multi-purpose C library which includes a powerful dynamic scripting language. Together they provide ideal cross-platform development environment for any programming project."
4SECTION = "devel/tcltk"
5
6# http://www.tcl.tk/software/tcltk/license.html
7LICENSE = "TCL & BSD-3-Clause"
8LIC_FILES_CHKSUM = "file://license.terms;md5=058f6229798281bbcac4239c788cfa38 \
9 file://compat/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
10 file://library/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
11 file://macosx/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
12 file://tests/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
13 file://win/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
14"
15
16DEPENDS = "tcl8-native zlib"
17
18BASE_SRC_URI = "${SOURCEFORGE_MIRROR}/tcl/tcl-core${PV}-src.tar.gz \
19 file://tcl-add-soname.patch"
20SRC_URI = "${BASE_SRC_URI} \
21 file://fix_non_native_build_issue.patch \
22 file://tcl-remove-hardcoded-install-path.patch \
23 file://alter-includedir.patch \
24 file://interp.patch \
25 file://run-ptest \
26 file://0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch \
27 "
28SRC_URI[sha256sum] = "3b371386a9a928eecdbf263bcab7d6a531e620ca3fbab4fdeeb3d6a9a56f38e9"
29
30SRC_URI:class-native = "${BASE_SRC_URI}"
31
32UPSTREAM_CHECK_URI = "https://www.tcl.tk/software/tcltk/download.html"
33UPSTREAM_CHECK_REGEX = "tcl(?P<pver>8(\.\d+)+)-src"
34
35S = "${UNPACKDIR}/tcl${PV}"
36
37VER = "${PV}"
38
39inherit autotools ptest binconfig
40
41AUTOTOOLS_SCRIPT_PATH = "${S}/unix"
42EXTRA_AUTORECONF = "--exclude=aclocal"
43
44EXTRA_OECONF = "--enable-threads --disable-rpath --enable-man-suffix=tcl8"
45
46# Prevent installing copy of tzdata based on tzdata installation on the build host
47# It doesn't install tzdata if one of the following files exist on the host:
48# /usr/share/zoneinfo/UTC /usr/share/zoneinfo/GMT /usr/share/lib/zoneinfo/UTC /usr/share/lib/zoneinfo/GMT /usr/lib/zoneinfo/UTC /usr/lib/zoneinfo/GMT
49# otherwise "/usr/lib/tcl8.6/tzdata" is included in tcl package
50EXTRA_OECONF += "--with-tzdata=no"
51
52do_install() {
53 autotools_do_install
54 oe_runmake 'DESTDIR=${D}' install-private-headers
55 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh8
56 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
57 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
58 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
59 install -d ${D}${bindir_crossscripts}
60 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
61 install -m 0755 tclConfig.sh ${D}${libdir}
62 for dir in compat generic unix; do
63 install -d ${D}${includedir}/tcl${VER}/$dir
64 install -m 0644 ${S}/$dir/*.h ${D}${includedir}/tcl${VER}/$dir/
65 done
66}
67
68SYSROOT_DIRS += "${bindir_crossscripts}"
69
70PACKAGES =+ "tcl8-lib"
71FILES:tcl8-lib = "${libdir}/libtcl8.6.so.*"
72FILES:${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
73FILES:${PN}-dev += "${libdir}/tcl8Config.sh ${libdir}/tcl8ooConfig.sh"
74
75# isn't getting picked up by shlibs code
76RDEPENDS:${PN} += "tcl8-lib"
77RDEPENDS:${PN}-ptest += "libgcc"
78
79BBCLASSEXTEND = "native nativesdk"
80
81do_compile_ptest() {
82 oe_runmake tcltest
83}
84
85do_install_ptest() {
86 cp ${B}/tcltest ${D}${PTEST_PATH}
87 cp -r ${S}/library ${D}${PTEST_PATH}
88 cp -r ${S}/tests ${D}${PTEST_PATH}
89 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
90}
91
92do_install_ptest:append:libc-musl () {
93 # Assumes locales other than provided by musl-locales
94 sed -i '/SKIP="$SKIP socket.*$/a # unixInit-3* is suppressed due to hardcoded locale assumptions\nSKIP="$SKIP unixInit-3\\\*"' ${D}${PTEST_PATH}/run-ptest
95}
96
97# Fix some paths that might be used by Tcl extensions
98BINCONFIG_GLOB = "*Config.sh"
99
100# Fix the path in sstate
101SSTATE_SCAN_FILES += "*Config.sh"
102
103# Cleanup host path from ${libdir}/tclConfig.sh and remove the
104# ${bindir_crossscripts}/tclConfig.sh from target
105#
106# Also rename development files which conflict with tcl 9.x to
107# have tcl8-specific filenames.
108PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
109tcl_package_preprocess() {
110 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
111 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
112 -e "s;${STAGING_INCDIR};${includedir};g" \
113 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
114 ${PKGD}${libdir}/tclConfig.sh
115
116 rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
117
118 # development files
119 mv ${PKGD}${libdir}/pkgconfig/tcl.pc ${PKGD}${libdir}/pkgconfig/tcl8.pc
120 mv ${PKGD}${libdir}/tclConfig.sh ${PKGD}${libdir}/tcl8Config.sh
121 mv ${PKGD}${libdir}/tclooConfig.sh ${PKGD}${libdir}/tcl8ooConfig.sh
122}