blob: cb9e486698c55514560e8cf35cb9fe239e853c22 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Tool Command Language"
2HOMEPAGE = "http://tcl.sourceforge.net"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "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."
Andrew Geissler82c905d2020-04-13 13:39:40 -05004SECTION = "devel/tcltk"
5
6# http://www.tcl.tk/software/tcltk/license.html
7LICENSE = "tcl & BSD-3-Clause"
Andrew Geissler5f350902021-07-23 13:09:54 -04008LIC_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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050014"
15
16DEPENDS = "tcl-native zlib"
17
Andrew Geissler5f350902021-07-23 13:09:54 -040018BASE_SRC_URI = "${SOURCEFORGE_MIRROR}/tcl/tcl-core${PV}-src.tar.gz \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050023 file://tcl-remove-hardcoded-install-path.patch \
24 file://alter-includedir.patch \
Andrew Geissler5f350902021-07-23 13:09:54 -040025 file://interp.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050026 file://run-ptest \
27"
Andrew Geissler5f350902021-07-23 13:09:54 -040028SRC_URI[sha256sum] = "cfb49aab82bd179651e23eeeb69606f51b0ddc575ca55c3d35e2457469024cfa"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
Patrick Williams213cb262021-08-07 19:21:33 -050030SRC_URI:class-native = "${BASE_SRC_URI}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050031
Andrew Geissler5199d832021-09-24 16:47:35 -050032# Upstream don't believe this is an exploitable issue
33# https://core.tcl-lang.org/tcl/info/7079e4f91601e9c7
34CVE_CHECK_WHITELIST += "CVE-2021-35331"
35
Andrew Geissler5f350902021-07-23 13:09:54 -040036UPSTREAM_CHECK_REGEX = "tcl(?P<pver>\d+(\.\d+)+)-src"
Andrew Geissler82c905d2020-04-13 13:39:40 -050037
Andrew Geissler5f350902021-07-23 13:09:54 -040038S = "${WORKDIR}/${BPN}${PV}"
39
Andrew Geissler82c905d2020-04-13 13:39:40 -050040VER = "${PV}"
41
Andrew Geissler5f350902021-07-23 13:09:54 -040042inherit autotools ptest binconfig
Andrew Geissler82c905d2020-04-13 13:39:40 -050043
Andrew Geissler5f350902021-07-23 13:09:54 -040044AUTOTOOLS_SCRIPT_PATH = "${S}/unix"
45EXTRA_OECONF = "--enable-threads --disable-rpath --enable-man-suffix"
Andrew Geissler82c905d2020-04-13 13:39:40 -050046
47do_install() {
48 autotools_do_install
49 oe_runmake 'DESTDIR=${D}' install-private-headers
50 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
51 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
52 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
53 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
54 install -d ${D}${bindir_crossscripts}
55 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
56 install -m 0755 tclConfig.sh ${D}${libdir}
57 for dir in compat generic unix; do
58 install -d ${D}${includedir}/${BPN}${VER}/$dir
Andrew Geissler5f350902021-07-23 13:09:54 -040059 install -m 0644 ${S}/$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
Andrew Geissler82c905d2020-04-13 13:39:40 -050060 done
61}
62
63SYSROOT_DIRS += "${bindir_crossscripts}"
64
65PACKAGES =+ "tcl-lib"
Patrick Williams213cb262021-08-07 19:21:33 -050066FILES:tcl-lib = "${libdir}/libtcl8.6.so.*"
67FILES:${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
68FILES:${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069
Andrew Geissler82c905d2020-04-13 13:39:40 -050070# isn't getting picked up by shlibs code
Patrick Williams213cb262021-08-07 19:21:33 -050071RDEPENDS:${PN} += "tcl-lib"
72RDEPENDS:${PN}-ptest += "libgcc"
Andrew Geissler82c905d2020-04-13 13:39:40 -050073
74BBCLASSEXTEND = "native nativesdk"
75
76do_compile_ptest() {
77 oe_runmake tcltest
78}
79
80do_install_ptest() {
81 cp ${B}/tcltest ${D}${PTEST_PATH}
Andrew Geissler5f350902021-07-23 13:09:54 -040082 cp -r ${S}/library ${D}${PTEST_PATH}
83 cp -r ${S}/tests ${D}${PTEST_PATH}
Andrew Geissler82c905d2020-04-13 13:39:40 -050084}
85
86# Fix some paths that might be used by Tcl extensions
87BINCONFIG_GLOB = "*Config.sh"
88
89# Fix the path in sstate
90SSTATE_SCAN_FILES += "*Config.sh"
91
92# Cleanup host path from ${libdir}/tclConfig.sh and remove the
93# ${bindir_crossscripts}/tclConfig.sh from target
94PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
95tcl_package_preprocess() {
96 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
97 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
98 -e "s;${STAGING_INCDIR};${includedir};g" \
99 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
100 ${PKGD}${libdir}/tclConfig.sh
101
102 rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
103}