blob: b33a78e147fb69fdb998696d80d38f61bcda2957 [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
Andrew Geissler517393d2023-01-13 08:55:19 -060032UPSTREAM_CHECK_URI = "https://www.tcl.tk/software/tcltk/download.html"
33UPSTREAM_CHECK_REGEX = "tcl(?P<pver>\d+(\.\d+)+)-src"
34
35S = "${WORKDIR}/${BPN}${PV}"
36
37VER = "${PV}"
38
39inherit autotools ptest binconfig
40
41AUTOTOOLS_SCRIPT_PATH = "${S}/unix"
42EXTRA_OECONF = "--enable-threads --disable-rpath --enable-man-suffix"
43
Andrew Geissler5082cc72023-09-11 08:41:39 -040044# Prevent installing copy of tzdata based on tzdata installation on the build host
45# It doesn't install tzdata if one of the following files exist on the host:
46# /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
47# otherwise "/usr/lib/tcl8.6/tzdata" is included in tcl package
48EXTRA_OECONF += "--with-tzdata=no"
49
Andrew Geissler517393d2023-01-13 08:55:19 -060050do_install() {
51 autotools_do_install
52 oe_runmake 'DESTDIR=${D}' install-private-headers
53 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
54 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
55 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
56 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
57 install -d ${D}${bindir_crossscripts}
58 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
59 install -m 0755 tclConfig.sh ${D}${libdir}
60 for dir in compat generic unix; do
61 install -d ${D}${includedir}/${BPN}${VER}/$dir
62 install -m 0644 ${S}/$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
63 done
64}
65
66SYSROOT_DIRS += "${bindir_crossscripts}"
67
68PACKAGES =+ "tcl-lib"
69FILES:tcl-lib = "${libdir}/libtcl8.6.so.*"
70FILES:${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
71FILES:${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
72
73# isn't getting picked up by shlibs code
74RDEPENDS:${PN} += "tcl-lib"
75RDEPENDS:${PN}-ptest += "libgcc"
76
77BBCLASSEXTEND = "native nativesdk"
78
79do_compile_ptest() {
80 oe_runmake tcltest
81}
82
83do_install_ptest() {
84 cp ${B}/tcltest ${D}${PTEST_PATH}
85 cp -r ${S}/library ${D}${PTEST_PATH}
86 cp -r ${S}/tests ${D}${PTEST_PATH}
87}
88
Andrew Geissler5082cc72023-09-11 08:41:39 -040089do_install_ptest:append:libc-musl () {
90 # Assumes locales other than provided by musl-locales
91 sed -i -e 's|SKIPPED_TESTS=|SKIPPED_TESTS="unixInit-3*"|' ${D}${PTEST_PATH}/run-ptest
92}
93
Andrew Geissler517393d2023-01-13 08:55:19 -060094# Fix some paths that might be used by Tcl extensions
95BINCONFIG_GLOB = "*Config.sh"
96
97# Fix the path in sstate
98SSTATE_SCAN_FILES += "*Config.sh"
99
100# Cleanup host path from ${libdir}/tclConfig.sh and remove the
101# ${bindir_crossscripts}/tclConfig.sh from target
102PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
103tcl_package_preprocess() {
104 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
105 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
106 -e "s;${STAGING_INCDIR};${includedir};g" \
107 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
108 ${PKGD}${libdir}/tclConfig.sh
109
110 rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
111}