blob: efab9618ec1d9cb32236d54ab5738c8ebcb562d2 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Tool Command Language ToolKit Extension"
2HOMEPAGE = "http://tcl.sourceforge.net"
3SECTION = "devel/tcltk"
4
5# http://www.tcl.tk/software/tcltk/license.html
Andrew Geissler9aee5002022-03-30 16:27:02 +00006LICENSE = "TCL"
Brad Bishop19323692019-04-05 15:28:33 -04007LIC_FILES_CHKSUM = "file://${S}/../license.terms;md5=c88f99decec11afa967ad33d314f87fe \
8 file://${S}/../compat/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
9 file://${S}/../doc/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
10 file://${S}/../library/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
11 file://${S}/../macosx/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
12 file://${S}/../tests/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
13 file://${S}/../unix/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
14 file://${S}/../win/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
15 file://${S}/../xlib/license.terms;md5=c88f99decec11afa967ad33d314f87fe \
16"
17
18DEPENDS = "tcl virtual/libx11 libxt"
19
20SRC_URI = "\
21 ${SOURCEFORGE_MIRROR}/tcl/${BPN}${PV}-src.tar.gz \
22 file://confsearch.diff;striplevel=2 \
Brad Bishop19323692019-04-05 15:28:33 -040023 file://tkprivate.diff;striplevel=2 \
24 file://fix-xft.diff \
Brad Bishop19323692019-04-05 15:28:33 -040025"
Brad Bishope42b3e32020-01-15 22:08:42 -050026SRC_URI[md5sum] = "602a47ad9ecac7bf655ada729d140a94"
27SRC_URI[sha256sum] = "63df418a859d0a463347f95ded5cd88a3dd3aaa1ceecaeee362194bc30f3e386"
Brad Bishop19323692019-04-05 15:28:33 -040028
29S = "${WORKDIR}/${BPN}${PV}/unix"
30
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050031PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/${BPN}${PV}"
32
Brad Bishop19323692019-04-05 15:28:33 -040033# Short version format: "8.6"
34VER = "${@os.path.splitext(d.getVar('PV'))[0]}"
35
36LDFLAGS += "-Wl,-rpath,${libdir}/tcltk/${PV}/lib"
Brad Bishop8410d612019-11-25 09:40:59 -050037inherit autotools features_check
Brad Bishop19323692019-04-05 15:28:33 -040038# depends on virtual/libx11
39REQUIRED_DISTRO_FEATURES = "x11"
40
41EXTRA_OECONF = "\
42 --enable-threads \
43 --with-x \
44 --with-tcl=${STAGING_BINDIR}/crossscripts \
45 --libdir=${libdir} \
46"
47export TK_LIBRARY='${libdir}/tk${VER}'
Patrick Williams213cb262021-08-07 19:21:33 -050048do_install:append() {
Brad Bishop19323692019-04-05 15:28:33 -040049 ln -sf libtk${VER}.so ${D}${libdir}/libtk${VER}.so.0
50 oe_libinstall -so libtk${VER} ${D}${libdir}
51 ln -sf wish${VER} ${D}${bindir}/wish
52
53 sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tkConfig.sh
54 sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tkConfig.sh
55 install -d ${D}${bindir_crossscripts}
56 install -m 0755 tkConfig.sh ${D}${bindir_crossscripts}
57}
58
59PACKAGECONFIG ??= "xft"
60PACKAGECONFIG[xft] = "--enable-xft,--disable-xft,xft"
61PACKAGECONFIG[xss] = "--enable-xss,--disable-xss,libxscrnsaver libxext"
62
63PACKAGES =+ "${PN}-lib"
64
Patrick Williams213cb262021-08-07 19:21:33 -050065FILES:${PN}-lib = "${libdir}/libtk${VER}.so*"
66FILES:${PN} += "${libdir}/tk*"
Brad Bishop19323692019-04-05 15:28:33 -040067
68# isn't getting picked up by shlibs code
Patrick Williams213cb262021-08-07 19:21:33 -050069RDEPENDS:${PN} += "tk-lib"
70RDEPENDS:${PN}:class-native = ""
Brad Bishop19323692019-04-05 15:28:33 -040071
72BBCLASSEXTEND = "native nativesdk"
73
74# Fix the path in sstate
75SSTATE_SCAN_FILES += "*Config.sh"
76
77inherit binconfig
78
79SYSROOT_DIRS += "${bindir_crossscripts}"
80
81# Fix some paths that might be used by Tcl extensions
82BINCONFIG_GLOB = "*Config.sh"
83
84# Cleanup host path from ${libdir}/tclConfig.sh and remove the
85# ${bindir_crossscripts}/tclConfig.sh from target
86PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
87tcl_package_preprocess() {
88 sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
89 -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
90 -e "s;${STAGING_INCDIR};${includedir};g" \
91 -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
92 ${PKGD}${libdir}/tkConfig.sh
93
94 rm -f ${PKGD}${bindir_crossscripts}/tkConfig.sh
95}