doxygen-9999.ebuild 3.6 KB

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