From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1241713-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 1461413835A
	for <garchives@archives.gentoo.org>; Thu, 14 Jan 2021 18:58:17 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 230A7E0919;
	Thu, 14 Jan 2021 18:58:16 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id EB9B4E08F4
	for <gentoo-commits@lists.gentoo.org>; Thu, 14 Jan 2021 18:58:15 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 07B17340E53
	for <gentoo-commits@lists.gentoo.org>; Thu, 14 Jan 2021 18:58:14 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 7219E32B
	for <gentoo-commits@lists.gentoo.org>; Thu, 14 Jan 2021 18:58:12 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1610650208.b89f80cd9c20607ada13ec091a32cef4b44d29f3.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-doc/doxygen/, app-doc/doxygen/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-doc/doxygen/Manifest app-doc/doxygen/doxygen-1.9.1.ebuild app-doc/doxygen/files/doxygen-1.9.1-ignore-bad-encoding.patch
X-VCS-Directories: app-doc/doxygen/ app-doc/doxygen/files/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: b89f80cd9c20607ada13ec091a32cef4b44d29f3
X-VCS-Branch: master
Date: Thu, 14 Jan 2021 18:58:12 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 415e5b5e-66cf-4196-9321-2f2709d7f20b
X-Archives-Hash: 2e729113347cf5c09876b2e79b46f513

commit:     b89f80cd9c20607ada13ec091a32cef4b44d29f3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 14 18:42:37 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jan 14 18:50:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b89f80cd

app-doc/doxygen: bump to 1.9.1

* USE=doc now generates fine with the
  added dependency of dev-texlive/texlive-plaingeneric
  for listofitems.

* Add a patch to ignore files we can't decode
  when generating docs. Ideally those files
  shouldn't exist anyway when we're generating docs,
  or be ignored earlier, but this works.

Closes: https://bugs.gentoo.org/688658
Closes: https://bugs.gentoo.org/749630
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-doc/doxygen/Manifest                           |   1 +
 app-doc/doxygen/doxygen-1.9.1.ebuild               | 135 +++++++++++++++++++++
 .../files/doxygen-1.9.1-ignore-bad-encoding.patch  |  23 ++++
 3 files changed, 159 insertions(+)

diff --git a/app-doc/doxygen/Manifest b/app-doc/doxygen/Manifest
index 0f360533449..4903673007f 100644
--- a/app-doc/doxygen/Manifest
+++ b/app-doc/doxygen/Manifest
@@ -1,2 +1,3 @@
 DIST doxygen-1.8.17.src.tar.gz 5138888 BLAKE2B 79d7d64fe2104f3fc802e9ee8f5fcd13ed4f0e23fe3e8d8013d1724d917d5f4e7d8c2df672e253aa2c8d67e839a6169632ebd87bc281b8ee70d217f486e402f7 SHA512 2fd087d127e301ea48355ea52c9af4f2091df06551cf64da80df81f0758194b296efb1e8d3962867a6a6d2da5a3fc323842f7766a445748005b30097ded30a75
 DIST doxygen-1.8.20.src.tar.gz 5132703 BLAKE2B 2a9e6df833c64d7052331b52647943f7eaad8214d66962970ad55628cc2ab26883655908588bee2d4872bb2d6d85f8d18cbb03e7dabe0280f337ab53d8538ec9 SHA512 65d104d25061ee59199c74c0328f59fbeaf14f0dade755187ebd43f59008adfef243d4da448b71ae04dc325b848f9bdd109eb20e6f6092f3ed19862426d060cf
+DIST doxygen-1.9.1.src.tar.gz 5117435 BLAKE2B 28c1a1cb8390e17e2b399cea765f837782ee268a999606eef4031a5f65943c793c97bdbd2e2a25a39358ecac5df2c7a62aa4cca72753a924e4e718c512b8a9c7 SHA512 637496c549a4a150cfaeb5d4913de512262145ecd7d455d7b7f3dd68f9416e47d931a6c1efd8a17d931e4baf4a8a9f2ed21124664003b123b6f89ca4abf263ed

diff --git a/app-doc/doxygen/doxygen-1.9.1.ebuild b/app-doc/doxygen/doxygen-1.9.1.ebuild
new file mode 100644
index 00000000000..949ef011d17
--- /dev/null
+++ b/app-doc/doxygen/doxygen-1.9.1.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+
+inherit cmake flag-o-matic llvm python-any-r1
+if [[ ${PV} = *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/doxygen/doxygen.git"
+	SRC_URI=""
+else
+	SRC_URI="http://doxygen.nl/files/${P}.src.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="Documentation system for most programming languages"
+HOMEPAGE="http://www.doxygen.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="clang debug doc dot doxysearch qt5 sqlite userland_GNU"
+
+BDEPEND="sys-devel/bison
+	sys-devel/flex
+	doc? ( ${PYTHON_DEPS} )
+"
+RDEPEND="app-text/ghostscript-gpl
+	dev-lang/perl
+	media-libs/libpng:0=
+	virtual/libiconv
+	clang? ( >=sys-devel/clang-10:= )
+	dot? (
+		media-gfx/graphviz
+		media-libs/freetype
+	)
+	doc? (
+		dev-texlive/texlive-bibtexextra
+		dev-texlive/texlive-fontsextra
+		dev-texlive/texlive-fontutils
+		dev-texlive/texlive-latex
+		dev-texlive/texlive-latexextra
+		dev-texlive/texlive-plaingeneric
+	)
+	doxysearch? ( dev-libs/xapian:= )
+	qt5? (
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+		dev-qt/qtxml:5
+	)
+	sqlite? ( dev-db/sqlite:3 )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.8.9.1-empty-line-sigsegv.patch" #454348
+	"${FILESDIR}/${PN}-1.8.16-link_with_pthread.patch"
+	"${FILESDIR}/${PN}-1.8.17-ensure_static_support_libraries.patch"
+	"${FILESDIR}/${PN}-1.9.1-ignore-bad-encoding.patch"
+)
+
+DOCS=( LANGUAGE.HOWTO README.md )
+
+pkg_setup() {
+	use clang && llvm_pkg_setup
+	use doc && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	cmake_src_prepare
+
+	# Ensure we link to -liconv
+	if use elibc_FreeBSD && has_version dev-libs/libiconv || use elibc_uclibc; then
+		local pro
+		for pro in */*.pro.in */*/*.pro.in; do
+			echo "unix:LIBS += -liconv" >> "${pro}" || die
+		done
+	fi
+
+	# Call dot with -Teps instead of -Tps for EPS generation - bug #282150
+	sed -i -e '/addJob("ps"/ s/"ps"/"eps"/g' src/dot.cpp || die
+
+	# fix pdf doc
+	sed -i.orig -e "s:g_kowal:g kowal:" \
+		doc/maintainers.txt || die
+
+	if is-flagq "-O3" ; then
+		ewarn
+		ewarn "Compiling with -O3 is known to produce incorrectly"
+		ewarn "optimized code which breaks doxygen."
+		ewarn
+		elog
+		elog "Continuing with -O2 instead ..."
+		elog
+		replace-flags "-O3" "-O2"
+	fi
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-Duse_libclang=$(usex clang)
+		-Dbuild_doc=$(usex doc)
+		-Dbuild_search=$(usex doxysearch)
+		-Dbuild_wizard=$(usex qt5)
+		-Duse_sqlite3=$(usex sqlite)
+		-DGIT_EXECUTABLE="false"
+	)
+
+	use doc && mycmakeargs+=(
+		-DDOC_INSTALL_DIR="share/doc/${P}"
+	)
+
+	cmake_src_configure
+}
+
+src_compile() {
+	if use doc; then
+		export VARTEXFONTS="${T}/fonts" # bug #564944
+
+		if ! use dot; then
+			sed -i -e "s/HAVE_DOT               = YES/HAVE_DOT    = NO/" \
+				{Doxyfile,doc/Doxyfile} \
+				|| die "disabling dot failed"
+		fi
+
+		cmake_src_compile docs
+	fi
+
+	cmake_src_compile
+}
+
+src_install() {
+	cmake_src_install
+}

diff --git a/app-doc/doxygen/files/doxygen-1.9.1-ignore-bad-encoding.patch b/app-doc/doxygen/files/doxygen-1.9.1-ignore-bad-encoding.patch
new file mode 100644
index 00000000000..5dd7578f24e
--- /dev/null
+++ b/app-doc/doxygen/files/doxygen-1.9.1-ignore-bad-encoding.patch
@@ -0,0 +1,23 @@
+Hack to avoid "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 45: invalid start byte"
+in src/._xmlgen.cpp which is binary. This doesn't seem like it should be present at the time the docs
+are generated, but this is simpler for now.
+--- a/doc/translator.py
++++ b/doc/translator.py
+@@ -1454,10 +1454,13 @@ class TrManager:
+ 
+         # Read content of the file as one string.
+         assert os.path.isfile(fname)
+-        f = xopen(fname)
+-        cont = f.read()
+-        cont = ''.join(cont.split('\n')) # otherwise the 'match' function won't work.
+-        f.close()
++        try:
++            with xopen(fname) as f:
++                cont = f.read()
++                cont = ''.join(cont.split('\n')) # otherwise the 'match' function won't work.
++        except UnicodeDecodeError:
++            print("Skipping {0} because of decoding errors".format(fname))
++            return
+ 
+         # Remove the items for identifiers that were found in the file.
+         while lst_in: