blob: 982f370edb7ba62b2f6943b819de6282247c7527 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "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 = "tcl-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://fix_issue_with_old_distro_glibc.patch \
23 file://tcl-remove-hardcoded-install-path.patch \
24 file://alter-includedir.patch \
25 file://interp.patch \
26 file://run-ptest \
27"
28SRC_URI[sha256sum] = "c61f0d6699e2bc7691f119b41963aaa8dc980f23532c4e937739832a5f4a6642"
29
30SRC_URI:class-native = "${BASE_SRC_URI}"
31
32# Upstream don't believe this is an exploitable issue
33# https://core.tcl-lang.org/tcl/info/7079e4f91601e9c7
34CVE_CHECK_IGNORE += "CVE-2021-35331"
35
36UPSTREAM_CHECK_URI = "https://www.tcl.tk/software/tcltk/download.html"
37UPSTREAM_CHECK_REGEX = "tcl(?P<pver>\d+(\.\d+)+)-src"
38
39S = "${WORKDIR}/${BPN}${PV}"
40
41VER = "${PV}"
42
43inherit autotools ptest binconfig
44
45AUTOTOOLS_SCRIPT_PATH = "${S}/unix"
46EXTRA_OECONF = "--enable-threads --disable-rpath --enable-man-suffix"
47
48do_install() {
49 autotools_do_install
50 oe_runmake 'DESTDIR=${D}' install-private-headers
51 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
52 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
53 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
54 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
55 install -d ${D}${bindir_crossscripts}
56 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
57 install -m 0755 tclConfig.sh ${D}${libdir}
58 for dir in compat generic unix; do
59 install -d ${D}${includedir}/${BPN}${VER}/$dir
60 install -m 0644 ${S}/$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
61 done
62}
63
64SYSROOT_DIRS += "${bindir_crossscripts}"
65
66PACKAGES =+ "tcl-lib"
67FILES:tcl-lib = "${libdir}/libtcl8.6.so.*"
68FILES:${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
69FILES:${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
70
71# isn't getting picked up by shlibs code
72RDEPENDS:${PN} += "tcl-lib"
73RDEPENDS:${PN}-ptest += "libgcc"
74
75BBCLASSEXTEND = "native nativesdk"
76
77do_compile_ptest() {
78 oe_runmake tcltest
79}
80
81do_install_ptest() {
82 cp ${B}/tcltest ${D}${PTEST_PATH}
83 cp -r ${S}/library ${D}${PTEST_PATH}
84 cp -r ${S}/tests ${D}${PTEST_PATH}
85}
86
87# Fix some paths that might be used by Tcl extensions
88BINCONFIG_GLOB = "*Config.sh"
89
90# Fix the path in sstate
91SSTATE_SCAN_FILES += "*Config.sh"
92
93# Cleanup host path from ${libdir}/tclConfig.sh and remove the
94# ${bindir_crossscripts}/tclConfig.sh from target
95PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
96tcl_package_preprocess() {
97 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
98 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
99 -e "s;${STAGING_INCDIR};${includedir};g" \
100 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
101 ${PKGD}${libdir}/tclConfig.sh
102
103 rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
104}