doxygen-1.8.12.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python{2_7,3_4,3_5} )
  5. inherit cmake-utils eutils fdo-mime flag-o-matic python-any-r1
  6. if [[ ${PV} = *9999* ]]; then
  7. inherit git-r3
  8. EGIT_REPO_URI="git://github.com/doxygen/doxygen.git"
  9. SRC_URI=""
  10. KEYWORDS="alpha arm hppa ia64 sparc"
  11. else
  12. SRC_URI="http://ftp.stack.nl/pub/users/dimitri/${P}.src.tar.gz"
  13. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
  14. fi
  15. SRC_URI+=" https://dev.gentoo.org/~xarthisius/distfiles/doxywizard.png"
  16. DESCRIPTION="Documentation system for most programming languages"
  17. HOMEPAGE="http://www.doxygen.org/"
  18. LICENSE="GPL-2"
  19. SLOT="0"
  20. IUSE="clang debug doc dot doxysearch latex qt5 sqlite userland_GNU"
  21. RDEPEND="app-text/ghostscript-gpl
  22. dev-lang/perl
  23. media-libs/libpng:0=
  24. virtual/libiconv
  25. clang? ( sys-devel/clang:= )
  26. dot? (
  27. media-gfx/graphviz
  28. media-libs/freetype
  29. )
  30. doxysearch? ( =dev-libs/xapian-1.2* )
  31. latex? ( app-text/texlive[extra] )
  32. qt5? (
  33. dev-qt/qtgui:5
  34. dev-qt/qtwidgets:5
  35. )
  36. sqlite? ( dev-db/sqlite:3 )
  37. "
  38. REQUIRED_USE="doc? ( latex )"
  39. DEPEND="sys-devel/flex
  40. sys-devel/bison
  41. doc? ( ${PYTHON_DEPS} )
  42. ${RDEPEND}"
  43. # src_test() defaults to make -C testing but there is no such directory (bug #504448)
  44. RESTRICT="test"
  45. PATCHES=(
  46. "${FILESDIR}/${PN}-1.8.9.1-empty-line-sigsegv.patch" #454348
  47. "${FILESDIR}/${P}-link_with_pthread.patch"
  48. )
  49. DOCS=( LANGUAGE.HOWTO README.md )
  50. pkg_setup() {
  51. use doc && python-any-r1_pkg_setup
  52. }
  53. src_prepare() {
  54. default
  55. # Ensure we link to -liconv
  56. if use elibc_FreeBSD && has_version dev-libs/libiconv || use elibc_uclibc; then
  57. local pro
  58. for pro in */*.pro.in */*/*.pro.in; do
  59. echo "unix:LIBS += -liconv" >> "${pro}" || die
  60. done
  61. fi
  62. # Call dot with -Teps instead of -Tps for EPS generation - bug #282150
  63. sed -i -e '/addJob("ps"/ s/"ps"/"eps"/g' src/dot.cpp || die
  64. # fix pdf doc
  65. sed -i.orig -e "s:g_kowal:g kowal:" \
  66. doc/maintainers.txt || die
  67. if is-flagq "-O3" ; then
  68. echo
  69. ewarn "Compiling with -O3 is known to produce incorrectly"
  70. ewarn "optimized code which breaks doxygen."
  71. echo
  72. elog "Continuing with -O2 instead ..."
  73. echo
  74. replace-flags "-O3" "-O2"
  75. fi
  76. }
  77. src_configure() {
  78. local mycmakeargs=(
  79. -DDOC_INSTALL_DIR="share/doc/${P}"
  80. -Duse_libclang=$(usex clang)
  81. -Dbuild_doc=$(usex doc)
  82. -Dbuild_search=$(usex doxysearch)
  83. -Dbuild_wizard=$(usex qt5)
  84. -Duse_sqlite3=$(usex sqlite)
  85. )
  86. cmake-utils_src_configure
  87. }
  88. src_compile() {
  89. cmake-utils_src_compile
  90. if use doc; then
  91. export VARTEXFONTS="${T}/fonts" # bug #564944
  92. if ! use dot; then
  93. sed -i -e "s/HAVE_DOT = YES/HAVE_DOT = NO/" \
  94. {Doxyfile,doc/Doxyfile} \
  95. || die "disabling dot failed"
  96. fi
  97. emake -C "${BUILD_DIR}" docs
  98. fi
  99. }
  100. src_install() {
  101. cmake-utils_src_install
  102. if use qt5; then
  103. doicon "${DISTDIR}/doxywizard.png"
  104. make_desktop_entry doxywizard "DoxyWizard ${PV}" \
  105. "/usr/share/pixmaps/doxywizard.png" \
  106. "Development"
  107. fi
  108. }
  109. pkg_postinst() {
  110. fdo-mime_desktop_database_update
  111. elog
  112. elog "For examples and other goodies, see the source tarball. For some"
  113. elog "example output, run doxygen on the doxygen source using the"
  114. elog "Doxyfile provided in the top-level source dir."
  115. elog
  116. elog "Disabling the dot USE flag will remove the GraphViz dependency,"
  117. elog "along with Doxygen's ability to generate diagrams in the docs."
  118. elog "See the Doxygen homepage for additional helper tools to parse"
  119. elog "more languages."
  120. elog
  121. }
  122. pkg_postrm() {
  123. fdo-mime_desktop_database_update
  124. }