x11-libs/pango: Uprev to 1.48.5

BUG=none
TEST=CQ

Change-Id: I944fc6a51d3a62c62c4731ac3456777bddb2ae6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2947159
Reviewed-by: David Riley <davidriley@chromium.org>
Tested-by: Fergus Dall <sidereal@google.com>
Commit-Queue: Fergus Dall <sidereal@google.com>
diff --git a/x11-libs/pango/Manifest b/x11-libs/pango/Manifest
index b156ec8..9208e99 100644
--- a/x11-libs/pango/Manifest
+++ b/x11-libs/pango/Manifest
@@ -1,2 +1,3 @@
 DIST pango-1.42.4-patchset.tar.xz 6040 BLAKE2B ec3f1a6a4de30e0864e7f0bf0950cb7a7b4bada8c3db496a8e5b1e770f221ae72b43167178445ea9cd0d6b88e51d2af49e7fdf27b2e792997fe7c37e55d429c1 SHA512 b7654c3493931e3c6d3cbd40ee49c5cbebaf403954bae75dea80e9f03e12dd5082548aff6a9e778821b8f935e227a7efaad4c1b980fa108e7258042221cadfc1
 DIST pango-1.42.4.tar.xz 833876 BLAKE2B 7de1094a29750b9e59ea1e5c92644fa5d6b835828d027963a53cce3f204ee1ea0042ec492e209de9136f05ca131ccda959bc477d4f6e9c72e5f620ddf4235f26 SHA512 993e97f647eba0c5ed90bcfcb8228bf67fa3f20b1f4331e4e40a30788d7c3ac55eee1209471bf21df125cb8fc6121acc8062a9da2f8a7d6cbe8e9ad13a9320dc
+DIST pango-1.48.5.tar.xz 1819476 BLAKE2B 8529e8cbcf0f33be56cf09229abe45fb3525e12a9c2a6ad7cca416ff67a92eb010abc2ce814fa4d19a924186369eede4a576efdd2f4c64b39e31c9821c5e414a SHA512 2c758e649af5b9f9fa960c26a6f4dcf5abd8035101fdfe4a02fe02cb892250b615584b02d63aaa06f3da5cbe7bb848459ac969f43437c34cec084b51bcf48cab
diff --git a/x11-libs/pango/files/1.42.4-CVE-2019-1010238.patch b/x11-libs/pango/files/1.42.4-CVE-2019-1010238.patch
deleted file mode 100644
index eaf0784..0000000
--- a/x11-libs/pango/files/1.42.4-CVE-2019-1010238.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 490f8979a260c16b1df055eab386345da18a2d54 Mon Sep 17 00:00:00 2001
-From: Matthias Clasen <mclasen@redhat.com>
-Date: Wed, 10 Jul 2019 20:26:23 -0400
-Subject: [PATCH] bidi: Be safer against bad input
-
-Don't run off the end of an array that we
-allocated to certain length.
-
-Closes: https://gitlab.gnome.org/GNOME/pango/issues/342
----
- pango/pango-bidi-type.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c
-index 3e46b66c..5c02dbbb 100644
---- a/pango/pango-bidi-type.c
-+++ b/pango/pango-bidi-type.c
-@@ -181,8 +181,11 @@ pango_log2vis_get_embedding_levels (const gchar    *text,
-   for (i = 0, p = text; p < text + length; p = g_utf8_next_char(p), i++)
-     {
-       gunichar ch = g_utf8_get_char (p);
--      FriBidiCharType char_type;
--      char_type = fribidi_get_bidi_type (ch);
-+      FriBidiCharType char_type = fribidi_get_bidi_type (ch);
-+
-+      if (i == n_chars)
-+        break;
-+
-       bidi_types[i] = char_type;
-       ored_types |= char_type;
-       if (FRIBIDI_IS_STRONG (char_type))
--- 
-2.21.0
-
diff --git a/x11-libs/pango/files/1.42.4-pango-view.1.in b/x11-libs/pango/files/1.42.4-pango-view.1.in
deleted file mode 100644
index 0b6f07a..0000000
--- a/x11-libs/pango/files/1.42.4-pango-view.1.in
+++ /dev/null
@@ -1,113 +0,0 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.6.
-.TH PANGO-VIEW "1" "August 2018" "pango-view (pango) 1.42.4" "User Commands"
-.SH NAME
-pango-view \- Pango text viewer
-.SH DESCRIPTION
-.SS "Usage:"
-.IP
-pango\-view [OPTION?] \- FILE
-.SS "Help Options:"
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-Show help options
-.TP
-\fB\-\-help\-all\fR
-Show all help options
-.TP
-\fB\-\-help\-cairo\fR
-Options understood by the cairo backend
-.SS "Cairo backend options:"
-.TP
-\fB\-\-annotate\fR=\fI\,1\/\fR or 2
-Annotate the output
-.SS "Application Options:"
-.TP
-\fB\-\-no\-auto\-dir\fR
-No layout direction according to contents
-.TP
-\fB\-\-backend\fR=\fI\,cairo\/\fR/xft/ft2
-Pango backend to use for rendering (default: cairo)
-.TP
-\fB\-\-background\fR=\fI\,red\/\fR/#rrggbb/#rrggbbaa/transparent
-Set the background color
-.TP
-\fB\-q\fR, \fB\-\-no\-display\fR
-Do not display (just write to file or whatever)
-.TP
-\fB\-\-dpi\fR=\fI\,number\/\fR
-Set the resolution
-.TP
-\fB\-\-align\fR=\fI\,left\/\fR/center/right
-Text alignment
-.TP
-\fB\-\-ellipsize\fR=\fI\,start\/\fR/middle/end
-Ellipsization mode
-.TP
-\fB\-\-font\fR=\fI\,description\/\fR
-Set the font description
-.TP
-\fB\-\-foreground\fR=\fI\,red\/\fR/#rrggbb/#rrggbbaa
-Set the text color
-.TP
-\fB\-\-gravity\fR=\fI\,south\/\fR/east/north/west/auto
-Base gravity: glyph rotation
-.TP
-\fB\-\-gravity\-hint\fR=\fI\,natural\/\fR/strong/line
-Gravity hint
-.TP
-\fB\-\-header\fR
-Display the options in the output
-.TP
-\fB\-\-height=\fR+points/\-numlines
-Height in points (positive) or number of lines (negative) for ellipsizing
-.TP
-\fB\-\-hinting\fR=\fI\,none\/\fR/auto/full
-Hinting style
-.TP
-\fB\-\-indent\fR=\fI\,points\/\fR
-Width in points to indent paragraphs
-.TP
-\fB\-\-justify\fR
-Align paragraph lines to be justified
-.TP
-\fB\-\-language\fR=\fI\,en_US\/\fR/etc
-Language to use for font selection
-.TP
-\fB\-\-margin\fR=\fI\,CSS\-style\/\fR numbers in pixels
-Set the margin on the output in pixels
-.TP
-\fB\-\-markup\fR
-Interpret text as Pango markup
-.TP
-\fB\-o\fR, \fB\-\-output\fR=\fI\,file\/\fR
-Save rendered image to output file
-.TP
-\fB\-\-pixels\fR
-Use pixel units instead of points (sets dpi to 72)
-.TP
-\fB\-\-rtl\fR
-Set base direction to right\-to\-left
-.TP
-\fB\-\-rotate\fR=\fI\,degrees\/\fR
-Angle at which to rotate results
-.TP
-\fB\-n\fR, \fB\-\-runs\fR=\fI\,integer\/\fR
-Run Pango layout engine this many times
-.TP
-\fB\-\-single\-par\fR
-Enable single\-paragraph mode
-.TP
-\fB\-t\fR, \fB\-\-text\fR=\fI\,string\/\fR
-Text to display (instead of a file)
-.TP
-\fB\-\-version\fR
-Show version numbers
-.TP
-\fB\-\-waterfall\fR
-Create a waterfall display
-.TP
-\fB\-w\fR, \fB\-\-width\fR=\fI\,points\/\fR
-Width in points to which to wrap lines or ellipsize
-.TP
-\fB\-\-wrap\fR=\fI\,word\/\fR/char/word\-char
-Text wrapping mode (needs a width to be set)
diff --git a/x11-libs/pango/metadata.xml b/x11-libs/pango/metadata.xml
index ce9f853..f669897 100644
--- a/x11-libs/pango/metadata.xml
+++ b/x11-libs/pango/metadata.xml
@@ -6,6 +6,7 @@
   <name>Gentoo GNOME Desktop</name>
 </maintainer>
 <use>
+  <flag name="sysprof">Enable profiling data capture support using <pkg>dev-util/sysprof-capture</pkg></flag>
   <flag name="X">Build and install the legacy pangoxft library</flag>
 </use>
 <upstream>
diff --git a/x11-libs/pango/pango-1.42.4-r2.ebuild b/x11-libs/pango/pango-1.42.4-r2.ebuild
deleted file mode 100644
index e67be9f..0000000
--- a/x11-libs/pango/pango-1.42.4-r2.ebuild
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-GNOME2_LA_PUNT="yes"
-
-inherit gnome2 multilib-minimal toolchain-funcs
-
-DESCRIPTION="Internationalized text layout and rendering library"
-HOMEPAGE="https://www.pango.org/"
-SRC_URI+=" https://dev.gentoo.org/~leio/distfiles/${P}-patchset.tar.xz"
-
-LICENSE="LGPL-2+ FTL"
-SLOT="0"
-KEYWORDS="*"
-
-IUSE="X +introspection test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	>=media-libs/harfbuzz-1.4.2:=[glib(+),truetype(+),${MULTILIB_USEDEP}]
-	>=dev-libs/glib-2.50.2:2[${MULTILIB_USEDEP}]
-	>=media-libs/fontconfig-2.12.92:1.0=[${MULTILIB_USEDEP}]
-	>=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}]
-	>=x11-libs/cairo-1.12.14-r4:=[X?,${MULTILIB_USEDEP}]
-	>=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
-	introspection? ( >=dev-libs/gobject-introspection-0.9.5:= )
-	X? (
-		>=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
-		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
-		>=x11-libs/libXft-2.3.1-r1[${MULTILIB_USEDEP}]
-	)
-"
-DEPEND="${RDEPEND}
-	dev-util/glib-utils
-	>=dev-util/gtk-doc-am-1.20
-	virtual/pkgconfig
-	test? ( media-fonts/cantarell )
-	X? ( x11-base/xorg-proto )
-	!<=sys-devel/autoconf-2.63:2.5
-"
-
-PATCHES=(
-	"${WORKDIR}"/patches/ # bug fix cherry-picks from master by 20190216; each patch has commit id of origin/master included and will be part of 1.43.1/1.44
-	"${FILESDIR}"/${PV}-CVE-2019-1010238.patch
-)
-
-src_prepare() {
-	gnome2_src_prepare
-	# This should be updated if next release fails to pre-generate the manpage as well, or src_prepare removed if is properly generated
-	# https://gitlab.gnome.org/GNOME/pango/issues/270
-	cp -v "${FILESDIR}"/${PV}-pango-view.1.in "${S}/utils/pango-view.1.in" || die
-}
-
-multilib_src_configure() {
-	tc-export CXX
-
-	ECONF_SOURCE=${S} \
-	gnome2_src_configure \
-		--with-cairo \
-		$(multilib_native_use_enable introspection) \
-		$(use_with X xft) \
-		"$(usex X --x-includes="${EPREFIX}/usr/include" "")" \
-		"$(usex X --x-libraries="${EPREFIX}/usr/$(get_libdir)" "")"
-
-	if multilib_is_native_abi; then
-		ln -s "${S}"/docs/html docs/html || die
-	fi
-}
-
-multilib_src_install() {
-	gnome2_src_install
-}
diff --git a/x11-libs/pango/pango-1.48.5.ebuild b/x11-libs/pango/pango-1.48.5.ebuild
new file mode 100644
index 0000000..dd2d073
--- /dev/null
+++ b/x11-libs/pango/pango-1.48.5.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit gnome2-utils meson-multilib toolchain-funcs xdg
+
+DESCRIPTION="Internationalized text layout and rendering library"
+HOMEPAGE="https://www.pango.org/"
+SRC_URI="http://ftp.gnome.org/pub/GNOME/sources/pango/$(ver_cut 1-2)/${P}.tar.xz"
+
+LICENSE="LGPL-2+ FTL"
+SLOT="0"
+KEYWORDS="*"
+
+IUSE="gtk-doc +introspection sysprof test X"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="gtk-doc? ( introspection )"
+
+RDEPEND="
+	>=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}]
+	>=dev-libs/glib-2.62.2:2[${MULTILIB_USEDEP}]
+	>=media-libs/fontconfig-2.12.92:1.0=[${MULTILIB_USEDEP}]
+	>=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}]
+	>=media-libs/harfbuzz-2.0:=[glib(+),introspection?,truetype(+),${MULTILIB_USEDEP}]
+	>=x11-libs/cairo-1.12.10:=[X?,${MULTILIB_USEDEP}]
+	introspection? ( >=dev-libs/gobject-introspection-0.9.5:= )
+	X? (
+		>=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
+		>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+		>=x11-libs/libXft-2.3.1-r1[${MULTILIB_USEDEP}]
+		x11-libs/libXrender[${MULTILIB_USEDEP}]
+	)
+"
+DEPEND="${RDEPEND}
+	sysprof? ( dev-util/sysprof-capture:4[${MULTILIB_USEDEP}] )
+	X? ( x11-base/xorg-proto )
+"
+BDEPEND="
+	dev-util/glib-utils
+	sys-apps/help2man
+	virtual/pkgconfig
+	gtk-doc? (
+		dev-util/gi-docgen
+		app-text/docbook-xml-dtd:4.2
+		app-text/docbook-xml-dtd:4.5
+	)
+"
+
+src_prepare() {
+	xdg_src_prepare
+	gnome2_environment_reset
+}
+
+multilib_src_configure() {
+	local emesonargs=(
+		# Never use gi-docgen subproject
+		--wrap-mode nofallback
+
+		$(meson_feature sysprof)
+		$(meson_feature X xft)
+		-Dcairo=enabled
+		-Dfontconfig=enabled
+		-Dfreetype=enabled
+		$(meson_native_use_bool gtk-doc gtk_doc)
+		$(meson_native_use_feature introspection)
+		-Dinstall-tests=false
+		-Dlibthai=disabled
+	)
+	meson_src_configure
+}
+
+multilib_src_install_all() {
+	if use gtk-doc; then
+		mv "${ED}"/usr/share/doc/{${PN}/reference/,${PF}/html/} || die
+		rmdir "${ED}"/usr/share/doc/${PN} || die
+	fi
+}
+
+pkg_postinst() {
+	xdg_pkg_postinst
+	gnome2_schemas_update
+}