1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools flag-o-matic multilib-minimal toolchain-funcs
10 DESCRIPTION="Tool Command Language"
11 HOMEPAGE="http://www.tcl.tk/"
12 SRC_URI="mirror://sourceforge/tcl/${PN}-core${PV}-src.tar.gz"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
19 RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]"
22 SPARENT="${WORKDIR}/${MY_P}"
26 "${FILESDIR}"/${PN}-8.5.13-multilib.patch
27 "${FILESDIR}"/${PN}-8.6.8-conf.patch # Bug 125971
32 "${SPARENT}"/compat/* \
33 "${SPARENT}"/doc/try.n \
36 pushd "${SPARENT}" &>/dev/null || die
38 popd &>/dev/null || die
40 # workaround stack check issues, bug #280934
41 use hppa && append-cflags "-DTCL_NO_STACK_CHECK=1"
46 -e '/chmod/s:555:755:g' \
53 mv configure.{in,ac} || die
60 multilib_src_configure() {
61 # We went ahead and deleted the whole compat/ subdir which means
62 # the configure tests to detect broken versions need to pass (else
63 # we'll fail to build). This comes up when cross-compiling, but
64 # might as well get a minor configure speed up normally.
65 export ac_cv_func_memcmp_working="yes"
66 export tcl_cv_str{str,toul,tod}_unbroken="ok"
67 export tcl_cv_strtod_buggy="no"
70 $(use_enable threads) \
71 $(use_enable debug symbols)
74 multilib_src_install() {
76 local v1=$(ver_cut 1-2)
77 local mylibdir=$(get_libdir)
80 # fix the tclConfig.sh to eliminate refs to the build directory
81 # and drop unnecessary -L inclusion to default system libdir
84 -e "/^TCL_BUILD_LIB_SPEC=/s:-L$(pwd) *::g" \
85 -e "/^TCL_LIB_SPEC=/s:-L${EPREFIX}/usr/${mylibdir} *::g" \
86 -e "/^TCL_SRC_DIR=/s:${SPARENT}:${EPREFIX}/usr/${mylibdir}/tcl${v1}/include:g" \
87 -e "/^TCL_BUILD_STUB_LIB_SPEC=/s:-L$(pwd) *::g" \
88 -e "/^TCL_STUB_LIB_SPEC=/s:-L${EPREFIX}/usr/${mylibdir} *::g" \
89 -e "/^TCL_BUILD_STUB_LIB_PATH=/s:$(pwd):${EPREFIX}/usr/${mylibdir}:g" \
90 -e "/^TCL_LIBW_FILE=/s:'libtcl${v1}..TCL_DBGX..so':\"libtcl${v1}\$\{TCL_DBGX\}.so\":g" \
91 -i "${ED}"/usr/${mylibdir}/tclConfig.sh || die
92 if use prefix && [[ ${CHOST} != *-darwin* && ${CHOST} != *-mint* ]] ; then
94 -e "/^TCL_CC_SEARCH_FLAGS=/s|'$|:${EPREFIX}/usr/${mylibdir}'|g" \
95 -e "/^TCL_LD_SEARCH_FLAGS=/s|'$|:${EPREFIX}/usr/${mylibdir}'|" \
96 -i "${ED}"/usr/${mylibdir}/tclConfig.sh || die
99 # install private headers
100 insinto /usr/${mylibdir}/tcl${v1}/include/unix
102 insinto /usr/${mylibdir}/tcl${v1}/include/generic
103 doins "${SPARENT}"/generic/*.h
104 rm -f "${ED}"/usr/${mylibdir}/tcl${v1}/include/generic/{tcl,tclDecls,tclPlatDecls}.h || die
106 # install symlink for libraries
107 dosym libtcl${v1}$(get_libname) /usr/${mylibdir}/libtcl$(get_libname)
108 dosym libtclstub${v1}.a /usr/${mylibdir}/libtclstub.a
110 if multilib_is_native_abi; then
111 dosym tclsh${v1} /usr/bin/tclsh
112 dodoc "${SPARENT}"/{ChangeLog*,README,changes}
117 for version in ${REPLACING_VERSIONS}; do
118 if ver_test 8.6 -lt ${version}; then
120 ewarn "You're upgrading from <${P}, you must recompile the other"
121 ewarn "packages on your system that link with tcl after the upgrade"
122 ewarn "completes. To perform this action, please run revdep-rebuild"
123 ewarn "in package app-portage/gentoolkit."
124 ewarn "If you have dev-lang/tk and dev-tcltk/tclx installed you should"
125 ewarn "upgrade them before this recompilation, too,"