libcaca-0.99_beta19.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. RUBY_OPTIONAL=yes
  6. USE_RUBY=ruby20
  7. inherit autotools ruby-ng eutils flag-o-matic mono-env multilib java-pkg-opt-2 python-single-r1 multilib-minimal
  8. MY_P=${P/_/.}
  9. DESCRIPTION="A library that creates colored ASCII-art graphics"
  10. HOMEPAGE="http://libcaca.zoy.org/"
  11. SRC_URI="http://libcaca.zoy.org/files/${PN}/${MY_P}.tar.gz"
  12. LICENSE="GPL-2 ISC LGPL-2.1 WTFPL-2"
  13. SLOT="0"
  14. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
  15. IUSE="cxx doc imlib java mono ncurses opengl python ruby slang static-libs test truetype X"
  16. REQUIRED_USE="
  17. python? ( ${PYTHON_REQUIRED_USE} )
  18. ruby? ( ruby_targets_${USE_RUBY} )
  19. "
  20. COMMON_DEPEND="imlib? ( >=media-libs/imlib2-1.4.6-r2[${MULTILIB_USEDEP}] )
  21. mono? ( dev-lang/mono )
  22. ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
  23. opengl? (
  24. >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
  25. >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
  26. >=media-libs/freeglut-2.8.1[${MULTILIB_USEDEP}]
  27. truetype? ( >=media-libs/ftgl-2.1.3_rc5 )
  28. )
  29. python? ( ${PYTHON_DEPS} )
  30. ruby? ( $(ruby_implementations_depend) )
  31. slang? ( >=sys-libs/slang-2.2.4-r1[${MULTILIB_USEDEP}] )
  32. X? ( >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}] )"
  33. RDEPEND="${COMMON_DEPEND}
  34. java? ( >=virtual/jre-1.5 )"
  35. DEPEND="${COMMON_DEPEND}
  36. virtual/pkgconfig
  37. doc? (
  38. app-doc/doxygen
  39. virtual/latex-base
  40. >=dev-texlive/texlive-fontsrecommended-2012
  41. >=dev-texlive/texlive-latexextra-2012
  42. dev-tex/xcolor
  43. )
  44. java? ( >=virtual/jdk-1.5 )
  45. test? ( dev-util/cppunit )"
  46. S=${WORKDIR}/${MY_P}
  47. DOCS=( AUTHORS ChangeLog NEWS NOTES README THANKS )
  48. pkg_setup() {
  49. use python && python-single-r1_pkg_setup
  50. java-pkg-opt-2_pkg_setup
  51. use mono && mono-env_pkg_setup
  52. }
  53. src_unpack() {
  54. default
  55. }
  56. src_prepare() {
  57. sed -i -e '/doxygen_tests = check-doxygen/d' test/Makefile.am || die #339962
  58. sed -i \
  59. -e 's:-g -O2 -fno-strength-reduce -fomit-frame-pointer::' \
  60. -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
  61. configure.ac || die
  62. sed -i \
  63. -e 's:$(JAVAC):$(JAVAC) $(JAVACFLAGS):' \
  64. -e 's:libcaca_java_la_CPPFLAGS =:libcaca_java_la_CPPFLAGS = -I$(top_srcdir)/caca:' \
  65. java/Makefile.am || die
  66. if ! use truetype; then
  67. sed -i -e '/PKG_CHECK_MODULES/s:ftgl:dIsAbLe&:' configure.ac || die
  68. fi
  69. if use imlib && ! use X; then
  70. append-cflags -DX_DISPLAY_MISSING
  71. fi
  72. # Removed 'has_version '>=dev-texlive/texlive-latex-2013' &&' that prefixed this
  73. # patch before wrt #517474
  74. epatch "${FILESDIR}"/${PN}-0.99_beta18-latex_hacks.patch
  75. # fix out of source tests
  76. epatch "${FILESDIR}"/${PN}-0.99_beta18-fix-tests.patch
  77. eautoreconf
  78. java-pkg-opt-2_src_prepare
  79. }
  80. multilib_src_configure() {
  81. if multilib_is_native_abi; then
  82. if use java; then
  83. export JAVACFLAGS="$(java-pkg_javac-args)"
  84. export JAVA_CFLAGS="$(java-pkg_get-jni-cflags)"
  85. fi
  86. use mono && export CSC="$(type -P gmcs)" #329651
  87. export VARTEXFONTS="${T}/fonts" #44128
  88. use ruby && use ruby_targets_${USE_RUBY} && export RUBY=$(ruby_implementation_command ${USE_RUBY})
  89. fi
  90. ECONF_SOURCE="${S}" \
  91. econf \
  92. $(use_enable static-libs static) \
  93. $(use_enable slang) \
  94. $(use_enable ncurses) \
  95. $(use_enable X x11) $(use_with X x) --x-libraries=/usr/$(get_libdir) \
  96. $(use_enable opengl gl) \
  97. $(use_enable cxx) \
  98. $(use_enable imlib imlib2) \
  99. $(use_enable test cppunit) \
  100. $(multilib_native_use_enable java) \
  101. $(multilib_native_use_enable ruby) \
  102. $(multilib_native_use_enable python) \
  103. $(multilib_native_use_enable mono csharp) \
  104. $(multilib_native_use_enable doc)
  105. }
  106. multilib_src_compile() {
  107. local _java_makeopts
  108. use java && _java_makeopts="-j1" #480864
  109. emake V=1 ${_java_makeopts}
  110. }
  111. multilib_src_test() {
  112. emake V=1 -j1 check
  113. }
  114. multilib_src_install() {
  115. emake V=1 DESTDIR="${D}" install
  116. if multilib_is_native_abi && use java; then
  117. java-pkg_newjar java/libjava.jar
  118. fi
  119. }
  120. multilib_src_install_all() {
  121. einstalldocs
  122. rm -rf "${D}"/usr/share/java
  123. prune_libtool_files --modules
  124. }