1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{6,7,8} )
7 CMAKE_MAKEFILE_GENERATOR="emake"
9 inherit cmake-utils eutils python-any-r1
10 if [[ ${PV} = *9999* ]]; then
12 EGIT_REPO_URI="https://github.com/doxygen/doxygen.git"
16 SRC_URI="http://doxygen.nl/files/${P}.src.tar.gz"
17 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20 DESCRIPTION="Documentation system for most programming languages"
21 HOMEPAGE="http://www.doxygen.org"
25 IUSE="clang debug doc dot doxysearch qt5 sqlite userland_GNU"
27 RDEPEND="app-text/ghostscript-gpl
31 clang? ( >=sys-devel/clang-4.0.0:= )
37 dev-texlive/texlive-bibtexextra
38 dev-texlive/texlive-fontsextra
39 dev-texlive/texlive-fontutils
40 dev-texlive/texlive-latex
41 dev-texlive/texlive-latexextra
43 doxysearch? ( dev-libs/xapian:= )
49 sqlite? ( dev-db/sqlite:3 )
52 DEPEND="sys-devel/flex
54 doc? ( ${PYTHON_DEPS} )
57 # src_test() defaults to make -C testing but there is no such directory (bug #504448)
61 "${FILESDIR}/${PN}-1.8.9.1-empty-line-sigsegv.patch" #454348
62 "${FILESDIR}/${PN}-1.8.16-link_with_pthread.patch"
63 "${FILESDIR}/${PN}-1.8.15-llvm7.patch" #666692
64 "${FILESDIR}/${PN}-1.8.17-ensure_static_support_libraries.patch"
67 DOCS=( LANGUAGE.HOWTO README.md )
70 use doc && python-any-r1_pkg_setup
74 cmake-utils_src_prepare
76 # Ensure we link to -liconv
77 if use elibc_FreeBSD && has_version dev-libs/libiconv || use elibc_uclibc; then
79 for pro in */*.pro.in */*/*.pro.in; do
80 echo "unix:LIBS += -liconv" >> "${pro}" || die
84 # Call dot with -Teps instead of -Tps for EPS generation - bug #282150
85 sed -i -e '/addJob("ps"/ s/"ps"/"eps"/g' src/dot.cpp || die
88 sed -i.orig -e "s:g_kowal:g kowal:" \
89 doc/maintainers.txt || die
91 if is-flagq "-O3" ; then
93 ewarn "Compiling with -O3 is known to produce incorrectly"
94 ewarn "optimized code which breaks doxygen."
97 elog "Continuing with -O2 instead ..."
99 replace-flags "-O3" "-O2"
105 -Duse_libclang=$(usex clang)
106 -Dbuild_doc=$(usex doc)
107 -Dbuild_search=$(usex doxysearch)
108 -Dbuild_wizard=$(usex qt5)
109 -Duse_sqlite3=$(usex sqlite)
110 -DGIT_EXECUTABLE="false"
112 use doc && mycmakeargs+=(
113 -DDOC_INSTALL_DIR="share/doc/${P}"
116 cmake-utils_src_configure
120 cmake-utils_src_compile
123 export VARTEXFONTS="${T}/fonts" # bug #564944
126 sed -i -e "s/HAVE_DOT = YES/HAVE_DOT = NO/" \
127 {Doxyfile,doc/Doxyfile} \
128 || die "disabling dot failed"
130 cmake-utils_src_make -C "${BUILD_DIR}" docs
135 cmake-utils_src_install