tcl-8.5.17.ebuild 3.6 KB

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