tk-8.6.6.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 multilib multilib-minimal prefix toolchain-funcs versionator virtualx
  5. MY_P="${PN}${PV/_beta/b}"
  6. DESCRIPTION="Tk Widget Set"
  7. HOMEPAGE="http://www.tcl.tk/"
  8. SRC_URI="mirror://sourceforge/tcl/${MY_P}-src.tar.gz"
  9. LICENSE="tcltk"
  10. SLOT="0/8.6"
  11. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  12. IUSE="debug +threads truetype aqua xscreensaver"
  13. RDEPEND="
  14. !aqua? (
  15. >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}]
  16. >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
  17. >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
  18. truetype? ( >=x11-libs/libXft-2.3.1-r1[${MULTILIB_USEDEP}] )
  19. xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
  20. )
  21. ~dev-lang/tcl-${PV}:0=[${MULTILIB_USEDEP}]"
  22. DEPEND="${RDEPEND}
  23. !aqua? ( >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}] )"
  24. # Not bumped to 8.6
  25. #RESTRICT=test
  26. SPARENT="${WORKDIR}/${MY_P}"
  27. S="${SPARENT}"/unix
  28. PATCHES=(
  29. "${FILESDIR}"/${PN}-8.5.11-fedora-xft.patch \
  30. "${FILESDIR}"/${PN}-8.5.13-multilib.patch
  31. "${FILESDIR}"/${PN}-8.4.15-aqua.patch
  32. # Bug 125971
  33. "${FILESDIR}"/${PN}-8.5.14-conf.patch
  34. )
  35. src_prepare() {
  36. find \
  37. "${SPARENT}"/compat/* \
  38. -delete || die
  39. pushd "${SPARENT}" &>/dev/null || die
  40. default
  41. popd &>/dev/null || die
  42. eprefixify Makefile.in
  43. # Make sure we use the right pkg-config, and link against fontconfig
  44. # (since the code base uses Fc* functions).
  45. sed \
  46. -e 's/FT_New_Face/XftFontOpen/g' \
  47. -e "s:\<pkg-config\>:$(tc-getPKG_CONFIG):" \
  48. -e 's:xft freetype2:xft freetype2 fontconfig:' \
  49. -i configure.in || die
  50. rm configure || die
  51. tc-export CC
  52. sed \
  53. -e '/chmod/s:555:755:g' \
  54. -i Makefile.in || die
  55. sed \
  56. -e 's:-O[2s]\?::g' \
  57. -i tcl.m4 || die
  58. mv configure.{in,ac} || die
  59. eautoconf
  60. multilib_copy_sources
  61. }
  62. multilib_src_configure() {
  63. if tc-is-cross-compiler ; then
  64. export ac_cv_func_strtod=yes
  65. export tcl_cv_strtod_buggy=1
  66. fi
  67. local mylibdir=$(get_libdir)
  68. econf \
  69. --with-tcl="${EPREFIX}/usr/${mylibdir}" \
  70. $(use_enable threads) \
  71. $(use_enable aqua) \
  72. $(use_enable truetype xft) \
  73. $(use_enable xscreensaver xss) \
  74. $(use_enable debug symbols)
  75. }
  76. multilib_src_test() {
  77. virtx emake test
  78. }
  79. multilib_src_install() {
  80. #short version number
  81. local v1=$(get_version_component_range 1-2)
  82. local mylibdir=$(get_libdir)
  83. S= default
  84. # normalize $S path, bug #280766 (pkgcore)
  85. local nS="$(cd "${S}"; pwd)"
  86. # fix the tkConfig.sh to eliminate refs to the build directory
  87. # and drop unnecessary -L inclusion to default system libdir
  88. sed \
  89. -e "/^TK_BUILD_LIB_SPEC=/s:-L${S}-\w*\.\w* ::g" \
  90. -e "/^TK_LIB_SPEC=/s:-L${EPREFIX}/usr/${mylibdir} *::g" \
  91. -e "/^TK_SRC_DIR=/s:${SPARENT}:${EPREFIX}/usr/${mylibdir}/tk${v1}/include:g" \
  92. -e "/^TK_BUILD_STUB_LIB_SPEC=/s:-L${S}-\w*\.\w* *::g" \
  93. -e "/^TK_STUB_LIB_SPEC=/s:-L${EPREFIX}/usr/${mylibdir} *::g" \
  94. -e "/^TK_BUILD_STUB_LIB_PATH=/s:${S}-\w*\.\w*:${EPREFIX}/usr/${mylibdir}:g" \
  95. -e "/^TK_LIB_FILE=/s:'libtk${v1}..TK_DBGX..so':\"libk${v1}\$\{TK_DBGX\}.so\":g" \
  96. -i "${ED}"/usr/${mylibdir}/tkConfig.sh || die
  97. if use prefix && [[ ${CHOST} != *-darwin* && ${CHOST} != *-mint* ]] ; then
  98. sed \
  99. -e "/^TK_CC_SEARCH_FLAGS=/s|'$|:${EPREFIX}/usr/${mylibdir}'|g" \
  100. -e "/^TK_LD_SEARCH_FLAGS=/s|'$|:${EPREFIX}/usr/${mylibdir}'|" \
  101. -i "${ED}"/usr/${mylibdir}/tkConfig.sh || die
  102. fi
  103. # install private headers
  104. insinto /usr/${mylibdir}/tk${v1}/include/unix
  105. doins "${S}"/*.h
  106. insinto /usr/${mylibdir}/tk${v1}/include/generic
  107. doins "${SPARENT}"/generic/*.h
  108. rm -f "${ED}"/usr/${mylibdir}/tk${v1}/include/generic/{tk,tkDecls,tkPlatDecls}.h || die
  109. # install symlink for libraries
  110. dosym libtk${v1}$(get_libname) /usr/${mylibdir}/libtk$(get_libname)
  111. dosym libtkstub${v1}.a /usr/${mylibdir}/libtkstub.a
  112. if multilib_is_native_abi; then
  113. dosym wish${v1} /usr/bin/wish
  114. dodoc "${SPARENT}"/{ChangeLog*,README,changes}
  115. fi
  116. }