summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-10-31 11:15:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-12 11:19:44 +0000
commiteca49ca726c1551fbe9e0adcfdfde529133abbf9 (patch)
tree00ea5de73e15a8f62a92746467b15b9b4cb58fa5 /meta/recipes-devtools
parentb33b064b4811fd270cb77be47668357722d38f65 (diff)
downloadpoky-eca49ca726c1551fbe9e0adcfdfde529133abbf9.tar.gz
tcl8: re-add tcl 8 to support building expect
I'd be happy to remove expect from core as it has been unmaintained for years, but sadly gcc/binutils test suites are basically written in it (via dejagnu), and ltp makes use of it as well. I attempted porting expect to tcl 9, but it's a tcl extension and makes extensive use of features that have been deprecated in tcl 8 and removed in tcl 9, and even pokes into tcl internals. At some point hopefully the GNU toolchain upstreams are going to notice; for now we'll carry tcl (latest) and tcl8 recipes. tcl and tcl8 packages can be co-installed, the latter is adjusted to contain tclsh8. tcl-dev and tcl8-dev packages can also be co-installed, a few files in tcl8-dev are renamed to avoid clashes with tcl-dev (tcl.pc -> tcl8.pc, and similar for tclConfig.sh and tclooConfig.sh). (From OE-Core rev: 8ec7bfc6644aff011545dfb0f5a415e79d7b0844) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rwxr-xr-xmeta/recipes-devtools/expect/expect/run-ptest2
-rw-r--r--meta/recipes-devtools/expect/expect_5.45.4.bb4
-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.15.bb118
9 files changed, 420 insertions, 3 deletions
diff --git a/meta/recipes-devtools/expect/expect/run-ptest b/meta/recipes-devtools/expect/expect/run-ptest
index 856c314eaf..1d35ba79d3 100755
--- a/meta/recipes-devtools/expect/expect/run-ptest
+++ b/meta/recipes-devtools/expect/expect/run-ptest
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3out_put=`tclsh tests/all.tcl -verbose bpse` 3out_put=`tclsh8 tests/all.tcl -verbose bpse`
4echo 4echo
5echo "${out_put}" | awk '/PASSED|FAILED|SKIPPED/{gsub(/PASSED/,"PASS"); gsub(/FAILED/,"FAIL"); gsub(/SKIPPED/,"SKIP"); if ($NF=="PASS"){print $NF": "$(NF-1)}else{print $NF": "$2}}' | uniq 5echo "${out_put}" | awk '/PASSED|FAILED|SKIPPED/{gsub(/PASSED/,"PASS"); gsub(/FAILED/,"FAIL"); gsub(/SKIPPED/,"SKIP"); if ($NF=="PASS"){print $NF": "$(NF-1)}else{print $NF": "$2}}' | uniq
6 6
diff --git a/meta/recipes-devtools/expect/expect_5.45.4.bb b/meta/recipes-devtools/expect/expect_5.45.4.bb
index 461a2c093a..3d50a8f25a 100644
--- a/meta/recipes-devtools/expect/expect_5.45.4.bb
+++ b/meta/recipes-devtools/expect/expect_5.45.4.bb
@@ -13,8 +13,8 @@ SECTION = "devel"
13 13
14LIC_FILES_CHKSUM = "file://license.terms;md5=fbf2de7e9102505b1439db06fc36ce5c" 14LIC_FILES_CHKSUM = "file://license.terms;md5=fbf2de7e9102505b1439db06fc36ce5c"
15 15
16DEPENDS += "tcl" 16DEPENDS += "tcl8"
17RDEPENDS:${PN} = "tcl" 17RDEPENDS:${PN} = "tcl8"
18 18
19inherit autotools update-alternatives ptest 19inherit autotools update-alternatives ptest
20 20
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..bfc718cfd3
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/alter-includedir.patch
@@ -0,0 +1,75 @@
1From 3130dca60636dc12d0d12df75b002fd123349e21 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 a3b7d69..969ddb8 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 4974fb6..a72934f 100644
43--- a/unix/configure.in
44+++ b/unix/configure.in
45@@ -776,7 +776,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@@ -897,7 +897,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..7480156ce0
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/fix_non_native_build_issue.patch
@@ -0,0 +1,80 @@
1From bd512547fc002fdb20808bf5b8b9feeb848b6512 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 965f6da..a0bd63f 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..2e0dc94cff
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/interp.patch
@@ -0,0 +1,40 @@
1From 426aa2ff62dda77fd011e8f630b9d4ea17984817 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: Pending
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 d742484..fc90990 100644
17--- a/tests/interp.test
18+++ b/tests/interp.test
19@@ -3595,17 +3595,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..c485e535c7
--- /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=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..1cd4d76283
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/tcl-add-soname.patch
@@ -0,0 +1,42 @@
1From b89fd73daf9b3eb2f889f65baba5f90d8a930c82 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: Pending
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 7619afc..9dd053d 100644
15--- a/unix/Makefile.in
16+++ b/unix/Makefile.in
17@@ -904,7 +904,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 0307a06..37c4d67 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..93e7877256
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8/tcl-remove-hardcoded-install-path.patch
@@ -0,0 +1,31 @@
1From 050fc597fbfa4da2c31bd0df58c871892a490470 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: Pending
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 4f62510..4974fb6 100644
21--- a/unix/configure.in
22+++ b/unix/configure.in
23@@ -775,7 +775,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.15.bb b/meta/recipes-devtools/tcltk8/tcl8_8.6.15.bb
new file mode 100644
index 0000000000..3902b3fe76
--- /dev/null
+++ b/meta/recipes-devtools/tcltk8/tcl8_8.6.15.bb
@@ -0,0 +1,118 @@
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 "
27SRC_URI[sha256sum] = "844775491e435e34d83d6ccfbadd1342f1855f1705253233a86152df0765e78d"
28
29SRC_URI:class-native = "${BASE_SRC_URI}"
30
31UPSTREAM_CHECK_URI = "https://www.tcl.tk/software/tcltk/download.html"
32UPSTREAM_CHECK_REGEX = "tcl(?P<pver>8(\.\d+)+)-src"
33
34S = "${WORKDIR}/tcl${PV}"
35
36VER = "${PV}"
37
38inherit autotools ptest binconfig
39
40AUTOTOOLS_SCRIPT_PATH = "${S}/unix"
41EXTRA_OECONF = "--enable-threads --disable-rpath --enable-man-suffix"
42
43# Prevent installing copy of tzdata based on tzdata installation on the build host
44# It doesn't install tzdata if one of the following files exist on the host:
45# /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
46# otherwise "/usr/lib/tcl8.6/tzdata" is included in tcl package
47EXTRA_OECONF += "--with-tzdata=no"
48
49do_install() {
50 autotools_do_install
51 oe_runmake 'DESTDIR=${D}' install-private-headers
52 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh8
53 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
54 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
55 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
56 install -d ${D}${bindir_crossscripts}
57 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
58 install -m 0755 tclConfig.sh ${D}${libdir}
59 for dir in compat generic unix; do
60 install -d ${D}${includedir}/${BPN}${VER}/$dir
61 install -m 0644 ${S}/$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
62 done
63}
64
65SYSROOT_DIRS += "${bindir_crossscripts}"
66
67PACKAGES =+ "tcl8-lib"
68FILES:tcl8-lib = "${libdir}/libtcl8.6.so.*"
69FILES:${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
70FILES:${PN}-dev += "${libdir}/tcl8Config.sh ${libdir}/tcl8ooConfig.sh"
71
72# isn't getting picked up by shlibs code
73RDEPENDS:${PN} += "tcl8-lib"
74RDEPENDS:${PN}-ptest += "libgcc"
75
76BBCLASSEXTEND = "native nativesdk"
77
78do_compile_ptest() {
79 oe_runmake tcltest
80}
81
82do_install_ptest() {
83 cp ${B}/tcltest ${D}${PTEST_PATH}
84 cp -r ${S}/library ${D}${PTEST_PATH}
85 cp -r ${S}/tests ${D}${PTEST_PATH}
86}
87
88do_install_ptest:append:libc-musl () {
89 # Assumes locales other than provided by musl-locales
90 sed -i '/SKIP="$SKIP socket.*$/a # unixInit-3* is suppressed due to hardcoded locale assumptions\nSKIP="$SKIP unixInit-3\\\*"' ${D}${PTEST_PATH}/run-ptest
91}
92
93# Fix some paths that might be used by Tcl extensions
94BINCONFIG_GLOB = "*Config.sh"
95
96# Fix the path in sstate
97SSTATE_SCAN_FILES += "*Config.sh"
98
99# Cleanup host path from ${libdir}/tclConfig.sh and remove the
100# ${bindir_crossscripts}/tclConfig.sh from target
101#
102# Also rename development files which conflict with tcl 9.x to
103# have tcl8-specific filenames.
104PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
105tcl_package_preprocess() {
106 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
107 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
108 -e "s;${STAGING_INCDIR};${includedir};g" \
109 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
110 ${PKGD}${libdir}/tclConfig.sh
111
112 rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
113
114 # development files
115 mv ${PKGD}${libdir}/pkgconfig/tcl.pc ${PKGD}${libdir}/pkgconfig/tcl8.pc
116 mv ${PKGD}${libdir}/tclConfig.sh ${PKGD}${libdir}/tcl8Config.sh
117 mv ${PKGD}${libdir}/tclooConfig.sh ${PKGD}${libdir}/tcl8ooConfig.sh
118}