blob: 8d58fafeb3e99c163cff4aec9ffd999e0783b7e5 [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
30SRC_URI_class-native = "${BASE_SRC_URI}"
31
Andrew Geissler5f350902021-07-23 13:09:54 -040032UPSTREAM_CHECK_REGEX = "tcl(?P<pver>\d+(\.\d+)+)-src"
Andrew Geissler82c905d2020-04-13 13:39:40 -050033
Andrew Geissler5f350902021-07-23 13:09:54 -040034S = "${WORKDIR}/${BPN}${PV}"
35
Andrew Geissler82c905d2020-04-13 13:39:40 -050036VER = "${PV}"
37
Andrew Geissler5f350902021-07-23 13:09:54 -040038inherit autotools ptest binconfig
Andrew Geissler82c905d2020-04-13 13:39:40 -050039
Andrew Geissler5f350902021-07-23 13:09:54 -040040AUTOTOOLS_SCRIPT_PATH = "${S}/unix"
41EXTRA_OECONF = "--enable-threads --disable-rpath --enable-man-suffix"
Andrew Geissler82c905d2020-04-13 13:39:40 -050042
43do_install() {
44 autotools_do_install
45 oe_runmake 'DESTDIR=${D}' install-private-headers
46 ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
47 ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
48 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
49 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
50 install -d ${D}${bindir_crossscripts}
51 install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
52 install -m 0755 tclConfig.sh ${D}${libdir}
53 for dir in compat generic unix; do
54 install -d ${D}${includedir}/${BPN}${VER}/$dir
Andrew Geissler5f350902021-07-23 13:09:54 -040055 install -m 0644 ${S}/$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
Andrew Geissler82c905d2020-04-13 13:39:40 -050056 done
57}
58
59SYSROOT_DIRS += "${bindir_crossscripts}"
60
61PACKAGES =+ "tcl-lib"
62FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
63FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
64FILES_${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
65
Andrew Geissler82c905d2020-04-13 13:39:40 -050066# isn't getting picked up by shlibs code
67RDEPENDS_${PN} += "tcl-lib"
Andrew Geissler82c905d2020-04-13 13:39:40 -050068RDEPENDS_${PN}-ptest += "libgcc"
69
70BBCLASSEXTEND = "native nativesdk"
71
72do_compile_ptest() {
73 oe_runmake tcltest
74}
75
76do_install_ptest() {
77 cp ${B}/tcltest ${D}${PTEST_PATH}
Andrew Geissler5f350902021-07-23 13:09:54 -040078 cp -r ${S}/library ${D}${PTEST_PATH}
79 cp -r ${S}/tests ${D}${PTEST_PATH}
Andrew Geissler82c905d2020-04-13 13:39:40 -050080}
81
82# Fix some paths that might be used by Tcl extensions
83BINCONFIG_GLOB = "*Config.sh"
84
85# Fix the path in sstate
86SSTATE_SCAN_FILES += "*Config.sh"
87
88# Cleanup host path from ${libdir}/tclConfig.sh and remove the
89# ${bindir_crossscripts}/tclConfig.sh from target
90PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
91tcl_package_preprocess() {
92 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
93 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
94 -e "s;${STAGING_INCDIR};${includedir};g" \
95 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
96 ${PKGD}${libdir}/tclConfig.sh
97
98 rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
99}