blob: efb36b32ddae84eb3c3941acb8f4143909815f64 [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"
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/${BPN}${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://no_packages.patch \
24 file://tcl-remove-hardcoded-install-path.patch \
25 file://alter-includedir.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050026 file://run-ptest \
27"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060028SRC_URI[sha256sum] = "8c0486668586672c5693d7d95817cb05a18c5ecca2f40e2836b9578064088258"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30SRC_URI_class-native = "${BASE_SRC_URI}"
31
32S = "${WORKDIR}/${BPN}${PV}/unix"
33
Andrew Geissler4c19ea12020-10-27 13:52:24 -050034PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/${BPN}${PV}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050035VER = "${PV}"
36
37inherit autotools ptest binconfig update-alternatives
38
39EXTRA_OECONF = "--enable-threads --disable-rpath --libdir=${libdir}"
40
41do_compile_prepend() {
42 echo > ${S}/../compat/fixstrtod.c
43}
44
45do_install() {
46 autotools_do_install
47 oe_runmake 'DESTDIR=${D}' install-private-headers
48 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
49 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
50 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
51 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
52 install -d ${D}${bindir_crossscripts}
53 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
54 install -m 0755 tclConfig.sh ${D}${libdir}
55 for dir in compat generic unix; do
56 install -d ${D}${includedir}/${BPN}${VER}/$dir
57 install -m 0644 ${S}/../$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
58 done
59}
60
61SYSROOT_DIRS += "${bindir_crossscripts}"
62
63PACKAGES =+ "tcl-lib"
64FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
65FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
66FILES_${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
67
68ALTERNATIVE_${PN}-doc = "Thread.3"
69ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
70
71# isn't getting picked up by shlibs code
72RDEPENDS_${PN} += "tcl-lib"
Andrew Geissler82c905d2020-04-13 13:39:40 -050073RDEPENDS_${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}