1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
7 inherit cmake-utils eutils python-any-r1
8 if [[ ${PV} = *9999* ]]; then
10 EGIT_REPO_URI="https://github.com/doxygen/doxygen.git"
13 SRC_URI="https://ftp.stack.nl/pub/users/dimitri/${P}.src.tar.gz"
14 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"
17 DESCRIPTION="Documentation system for most programming languages"
18 HOMEPAGE="https://www.stack.nl/~dimitri/doxygen/"
22 IUSE="clang debug doc dot doxysearch latex qt5 sqlite userland_GNU"
24 RDEPEND="app-text/ghostscript-gpl
28 clang? ( >=sys-devel/clang-4.0.0:= )
33 doxysearch? ( dev-libs/xapian )
35 dev-texlive/texlive-bibtexextra
36 dev-texlive/texlive-fontsextra
37 dev-texlive/texlive-fontutils
38 dev-texlive/texlive-latex
39 dev-texlive/texlive-latexextra
46 sqlite? ( dev-db/sqlite:3 )
49 REQUIRED_USE="doc? ( latex )"
51 DEPEND="sys-devel/flex
53 doc? ( ${PYTHON_DEPS} )
56 # src_test() defaults to make -C testing but there is no such directory (bug #504448)
60 "${FILESDIR}/${PN}-1.8.9.1-empty-line-sigsegv.patch" #454348
61 "${FILESDIR}/${PN}-1.8.12-link_with_pthread.patch"
64 DOCS=( LANGUAGE.HOWTO README.md )
67 use doc && python-any-r1_pkg_setup
71 cmake-utils_src_prepare
73 # Ensure we link to -liconv
74 if use elibc_FreeBSD && has_version dev-libs/libiconv || use elibc_uclibc; then
76 for pro in */*.pro.in */*/*.pro.in; do
77 echo "unix:LIBS += -liconv" >> "${pro}" || die
81 # Call dot with -Teps instead of -Tps for EPS generation - bug #282150
82 sed -i -e '/addJob("ps"/ s/"ps"/"eps"/g' src/dot.cpp || die
85 sed -i.orig -e "s:g_kowal:g kowal:" \
86 doc/maintainers.txt || die
88 if is-flagq "-O3" ; then
90 ewarn "Compiling with -O3 is known to produce incorrectly"
91 ewarn "optimized code which breaks doxygen."
94 elog "Continuing with -O2 instead ..."
96 replace-flags "-O3" "-O2"
102 -Duse_libclang=$(usex clang)
103 -Dbuild_doc=$(usex doc)
104 -Dbuild_search=$(usex doxysearch)
105 -Dbuild_wizard=$(usex qt5)
106 -Duse_sqlite3=$(usex sqlite)
108 use doc && mycmakeargs+=(
109 -DDOC_INSTALL_DIR="share/doc/${P}"
112 cmake-utils_src_configure
116 cmake-utils_src_compile
119 export VARTEXFONTS="${T}/fonts" # bug #564944
122 sed -i -e "s/HAVE_DOT = YES/HAVE_DOT = NO/" \
123 {Doxyfile,doc/Doxyfile} \
124 || die "disabling dot failed"
126 cmake-utils_src_make -C "${BUILD_DIR}" docs
131 cmake-utils_src_install