tcl-8.6.6.ebuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools eutils flag-o-matic multilib multilib-minimal toolchain-funcs versionator
  5. MY_P="${PN}${PV}"
  6. DESCRIPTION="Tool Command Language"
  7. HOMEPAGE="http://www.tcl.tk/"
  8. SRC_URI="mirror://sourceforge/tcl/${PN}-core${PV}-src.tar.gz"
  9. LICENSE="tcltk"
  10. SLOT="0/8.6"
  11. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x86-solaris"
  12. IUSE="debug +threads"
  13. RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]"
  14. DEPEND="${RDEPEND}"
  15. SPARENT="${WORKDIR}/${MY_P}"
  16. S="${SPARENT}"/unix
  17. PATCHES=(
  18. "${FILESDIR}"/${PN}-8.5.13-multilib.patch
  19. # Bug 125971
  20. "${FILESDIR}"/${PN}-8.6.1-conf.patch
  21. )
  22. src_prepare() {
  23. find \
  24. "${SPARENT}"/compat/* \
  25. "${SPARENT}"/doc/try.n \
  26. -delete || die
  27. pushd "${SPARENT}" &>/dev/null || die
  28. default
  29. popd &>/dev/null || die
  30. # workaround stack check issues, bug #280934
  31. use hppa && append-cflags "-DTCL_NO_STACK_CHECK=1"
  32. tc-export CC
  33. sed \
  34. -e '/chmod/s:555:755:g' \
  35. -i Makefile.in || die
  36. sed \
  37. -e 's:-O[2s]\?::g' \
  38. -i tcl.m4 || die
  39. mv configure.{in,ac} || die
  40. eautoconf
  41. multilib_copy_sources
  42. }
  43. multilib_src_configure() {
  44. # We went ahead and deleted the whole compat/ subdir which means
  45. # the configure tests to detect broken versions need to pass (else
  46. # we'll fail to build). This comes up when cross-compiling, but
  47. # might as well get a minor configure speed up normally.
  48. export ac_cv_func_memcmp_working="yes"
  49. export tcl_cv_str{str,toul,tod}_unbroken="ok"
  50. export tcl_cv_strtod_buggy="no"
  51. econf \
  52. $(use_enable threads) \
  53. $(use_enable debug symbols)
  54. }
  55. multilib_src_install() {
  56. #short version number
  57. local v1=$(get_version_component_range 1-2)
  58. local mylibdir=$(get_libdir)
  59. S= default
  60. # fix the tclConfig.sh to eliminate refs to the build directory
  61. # and drop unnecessary -L inclusion to default system libdir
  62. sed \
  63. -e "/^TCL_BUILD_LIB_SPEC=/s:-L$(pwd) *::g" \
  64. -e "/^TCL_LIB_SPEC=/s:-L${EPREFIX}/usr/${mylibdir} *::g" \
  65. -e "/^TCL_SRC_DIR=/s:${SPARENT}:${EPREFIX}/usr/${mylibdir}/tcl${v1}/include:g" \
  66. -e "/^TCL_BUILD_STUB_LIB_SPEC=/s:-L$(pwd) *::g" \
  67. -e "/^TCL_STUB_LIB_SPEC=/s:-L${EPREFIX}/usr/${mylibdir} *::g" \
  68. -e "/^TCL_BUILD_STUB_LIB_PATH=/s:$(pwd):${EPREFIX}/usr/${mylibdir}:g" \
  69. -e "/^TCL_LIB_FILE=/s:'libtcl${v1}..TCL_DBGX..so':\"libtcl${v1}\$\{TCL_DBGX\}.so\":g" \
  70. -i "${ED}"/usr/${mylibdir}/tclConfig.sh || die
  71. if use prefix && [[ ${CHOST} != *-darwin* && ${CHOST} != *-mint* ]] ; then
  72. sed \
  73. -e "/^TCL_CC_SEARCH_FLAGS=/s|'$|:${EPREFIX}/usr/${mylibdir}'|g" \
  74. -e "/^TCL_LD_SEARCH_FLAGS=/s|'$|:${EPREFIX}/usr/${mylibdir}'|" \
  75. -i "${ED}"/usr/${mylibdir}/tclConfig.sh || die
  76. fi
  77. # install private headers
  78. insinto /usr/${mylibdir}/tcl${v1}/include/unix
  79. doins *.h
  80. insinto /usr/${mylibdir}/tcl${v1}/include/generic
  81. doins "${SPARENT}"/generic/*.h
  82. rm -f "${ED}"/usr/${mylibdir}/tcl${v1}/include/generic/{tcl,tclDecls,tclPlatDecls}.h || die
  83. # install symlink for libraries
  84. dosym libtcl${v1}$(get_libname) /usr/${mylibdir}/libtcl$(get_libname)
  85. dosym libtclstub${v1}.a /usr/${mylibdir}/libtclstub.a
  86. if multilib_is_native_abi; then
  87. dosym tclsh${v1} /usr/bin/tclsh
  88. dodoc "${SPARENT}"/{ChangeLog*,README,changes}
  89. fi
  90. }
  91. pkg_postinst() {
  92. for version in ${REPLACING_VERSIONS}; do
  93. if ! version_is_at_least 8.6 ${version}; then
  94. echo
  95. ewarn "You're upgrading from <${P}, you must recompile the other"
  96. ewarn "packages on your system that link with tcl after the upgrade"
  97. ewarn "completes. To perform this action, please run revdep-rebuild"
  98. ewarn "in package app-portage/gentoolkit."
  99. ewarn "If you have dev-lang/tk and dev-tcltk/tclx installed you should"
  100. ewarn "upgrade them before this recompilation, too,"
  101. echo
  102. fi
  103. done
  104. }