ncurses-5.9-r101.ebuild 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # This version is just for the ABI .5 library
  4. EAPI="5"
  5. inherit eutils toolchain-funcs multilib-minimal multiprocessing
  6. MY_PV=${PV:0:3}
  7. MY_P=${PN}-${MY_PV}
  8. DESCRIPTION="console display library"
  9. HOMEPAGE="https://www.gnu.org/software/ncurses/ http://dickey.his.com/ncurses/"
  10. SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
  11. LICENSE="MIT"
  12. # The subslot reflects the SONAME.
  13. SLOT="5/5"
  14. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
  15. IUSE="gpm tinfo unicode"
  16. DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
  17. # Block the ncurses-5 that installs the same lib. #557472
  18. RDEPEND="${DEPEND}
  19. !<sys-libs/ncurses-6:0"
  20. S=${WORKDIR}/${MY_P}
  21. PATCHES=(
  22. "${FILESDIR}"/${PN}-5.8-gfbsd.patch
  23. "${FILESDIR}"/${PN}-5.7-nongnu.patch
  24. "${FILESDIR}"/${PN}-5.9-rxvt-unicode-9.15.patch #192083 #383871
  25. "${FILESDIR}"/${PN}-5.9-fix-clang-build.patch #417763
  26. "${FILESDIR}"/${PN}-5.9-pkg-config.patch
  27. "${FILESDIR}"/${P}-no-I-usr-include.patch #522586
  28. "${FILESDIR}"/${P}-gcc-5.patch #545114
  29. )
  30. src_prepare() {
  31. epatch "${PATCHES[@]}"
  32. }
  33. src_configure() {
  34. unset TERMINFO #115036
  35. tc-export_build_env BUILD_{CC,CPP}
  36. BUILD_CPPFLAGS+=" -D_GNU_SOURCE" #214642
  37. # Build the various variants of ncurses -- narrow, wide, and threaded. #510440
  38. # Order matters here -- we want unicode/thread versions to come last so that the
  39. # binaries in /usr/bin support both wide and narrow.
  40. # The naming is also important as we use these directly with filenames and when
  41. # checking configure flags.
  42. NCURSES_TARGETS=(
  43. ncurses
  44. $(usex unicode 'ncursesw' '')
  45. )
  46. multijob_init
  47. # When installing ncurses, we have to use a compatible version of tic.
  48. # This comes up when cross-compiling, doing multilib builds, upgrading,
  49. # or installing for the first time. Build a local copy of tic whenever
  50. # the host version isn't available. #249363 #557598
  51. if ! ROOT=/ has_version "~sys-libs/${P}" ; then
  52. # We can't re-use the multilib BUILD_DIR because we run outside of it.
  53. BUILD_DIR="${WORKDIR}" \
  54. CHOST=${CBUILD} \
  55. CFLAGS=${BUILD_CFLAGS} \
  56. CXXFLAGS=${BUILD_CXXFLAGS} \
  57. CPPFLAGS=${BUILD_CPPFLAGS} \
  58. LDFLAGS="${BUILD_LDFLAGS} -static" \
  59. multijob_child_init do_configure cross --without-shared --with-normal
  60. fi
  61. multilib-minimal_src_configure
  62. multijob_finish
  63. }
  64. multilib_src_configure() {
  65. local t
  66. for t in "${NCURSES_TARGETS[@]}" ; do
  67. multijob_child_init do_configure "${t}"
  68. done
  69. }
  70. do_configure() {
  71. local target=$1
  72. shift
  73. mkdir "${BUILD_DIR}/${target}"
  74. cd "${BUILD_DIR}/${target}" || die
  75. local conf=(
  76. # We need the basic terminfo files in /etc, bug #37026. We will
  77. # add '--with-terminfo-dirs' and then populate /etc/terminfo in
  78. # src_install() ...
  79. --with-terminfo-dirs="${EPREFIX}/etc/terminfo:${EPREFIX}/usr/share/terminfo"
  80. # Now the rest of the various standard flags.
  81. --without-hashed-db
  82. --disable-pc-files
  83. --with-shared
  84. --without-hashed-db
  85. --without-ada
  86. --without-cxx
  87. --without-cxx-binding
  88. --without-debug
  89. --without-profile
  90. # The configure script uses ldd to parse the linked output which
  91. # is flaky for cross-compiling/multilib/ldd versions/etc...
  92. $(use_with gpm gpm libgpm.so.1)
  93. --disable-termcap
  94. --enable-symlinks
  95. --with-rcs-ids
  96. --with-manpage-format=normal
  97. --enable-const
  98. --enable-colorfgbg
  99. --enable-echo
  100. --disable-warnings
  101. --without-assertions
  102. --enable-leaks
  103. --without-expanded
  104. --with-macros
  105. --without-progs
  106. --without-tests
  107. --without-trace
  108. $(use_with tinfo termlib)
  109. # The chtype/mmask-t settings below are to retain ABI compat
  110. # with ncurses-5.4 so dont change em !
  111. --with-chtype=long
  112. --with-mmask-t=long
  113. --disable-ext-colors
  114. --disable-ext-mouse
  115. --without-{pthread,reentrant}
  116. )
  117. if [[ ${target} == ncurses*w ]] ; then
  118. conf+=( --enable-widec )
  119. else
  120. conf+=( --disable-widec )
  121. fi
  122. # Make sure each variant goes in a unique location.
  123. if [[ ${target} != "ncurses" ]] ; then
  124. conf+=( --includedir="${EPREFIX}"/usr/include/${target} )
  125. fi
  126. # See comments in src_configure.
  127. if [[ ${target} != "cross" ]] ; then
  128. local cross_path="${WORKDIR}/cross"
  129. [[ -d ${cross_path} ]] && export TIC_PATH="${cross_path}/progs/tic"
  130. else
  131. conf+=( --with-progs )
  132. fi
  133. # Force bash until upstream rebuilds the configure script with a newer
  134. # version of autotools. #545532
  135. CONFIG_SHELL=/bin/bash \
  136. ECONF_SOURCE=${S} \
  137. econf "${conf[@]}" "$@"
  138. }
  139. src_compile() {
  140. # See comments in src_configure.
  141. if ! ROOT=/ has_version "~sys-libs/${P}" ; then
  142. BUILD_DIR="${WORKDIR}" \
  143. do_compile cross -C progs tic
  144. fi
  145. multilib-minimal_src_compile
  146. }
  147. multilib_src_compile() {
  148. local t
  149. for t in "${NCURSES_TARGETS[@]}" ; do
  150. do_compile "${t}"
  151. done
  152. }
  153. do_compile() {
  154. local target=$1
  155. shift
  156. cd "${BUILD_DIR}/${target}" || die
  157. # A little hack to fix parallel builds ... they break when
  158. # generating sources so if we generate the sources first (in
  159. # non-parallel), we can then build the rest of the package
  160. # in parallel. This is not really a perf hit since the source
  161. # generation is quite small.
  162. emake -j1 sources
  163. emake "$@"
  164. }
  165. multilib_src_install() {
  166. local target lib
  167. for target in "${NCURSES_TARGETS[@]}" ; do
  168. cd "${BUILD_DIR}/${target}/lib" || die
  169. for lib in *5.9 ; do
  170. newlib.so "${lib}" "${lib%%.9}"
  171. done
  172. done
  173. }