--- /dev/null
+From e097a4608cafac147546db658a4a37f8a23715ca Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <leio@gentoo.org>
+Date: Thu, 17 Jan 2019 01:16:40 +0200
+Subject: [PATCH] build: make introspection optional, not based on
+ cross-compiling
+
+This is how most other projects do it - cross-compiling that hits trouble
+can just disable it then.
+
+diff --git a/meson_options.txt b/meson_options.txt
+index 9c32a5f..58e9f8c 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -6,3 +6,5 @@ option('enable-libgcrypt', type: 'combo', choices : ['yes', 'no', 'auto'], value
+ description : 'Enable libgcrypt support.')
+ option('enable-gtk-doc', type: 'boolean', value: 'false',
+ description : 'Generate the API reference (depends on GTK-Doc)')
++option('enable-introspection', type: 'boolean', value: 'true',
++ description : 'Generate gobject-introspection bindings')
+diff --git a/plparse/meson.build b/plparse/meson.build
+index bdfde9d..ad4e344 100644
+--- a/plparse/meson.build
++++ b/plparse/meson.build
+@@ -121,7 +121,7 @@ if have_quvi
+ endif
+
+ # Introspection
+-if not meson.is_cross_build()
++if get_option('enable-introspection')
+ gnome.generate_gir(plparser_lib,
+ sources: plparser_public_headers + plparser_sources + [
+ totem_pl_parser_marshalers[1],
+--
+2.17.0
+
--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit gnome.org meson xdg
+
+DESCRIPTION="Playlist parsing library"
+HOMEPAGE="https://developer.gnome.org/totem-pl-parser/stable/"
+
+LICENSE="LGPL-2+"
+SLOT="0/18"
+IUSE="archive crypt gtk-doc +introspection +quvi test"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+
+RDEPEND="
+ >=dev-libs/glib-2.36:2
+ quvi? ( >=media-libs/libquvi-0.9.1:0= )
+ archive? ( >=app-arch/libarchive-3 )
+ dev-libs/libxml2:2
+ crypt? ( dev-libs/libgcrypt:0= )
+ introspection? ( >=dev-libs/gobject-introspection-1.54:= )
+"
+DEPEND="${RDEPEND}
+ dev-util/glib-utils
+ gtk-doc? (
+ >=dev-util/gtk-doc-1.14
+ app-text/docbook-xml-dtd:4.3 )
+ >=sys-devel/gettext-0.19.8
+ virtual/pkgconfig
+ test? (
+ gnome-base/gvfs[http]
+ sys-apps/dbus )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-optional-introspection.patch
+)
+
+src_prepare() {
+ # Disable tests requiring network access, bug #346127
+ # 3rd test fails on upgrade, not once installed
+ # Leio: I consider network tests important for ensuring full functionality, thus trying with them again */
+ #sed -e 's:\(g_test_add_func.*/parser/resolution.*\):/*\1*/:' \
+ # -e 's:\(g_test_add_func.*/parser/parsing/itms_link.*\):/*\1*/:' \
+ # -e 's:\(g_test_add_func.*/parser/parsability.*\):/*\1*/:'\
+ # -i plparse/tests/parser.c || die "sed failed"
+
+ xdg_src_prepare
+}
+
+src_configure() {
+ # uninstalled-tests is abused to switch from loading live FS helper
+ # to in-build-tree helper, check on upgrades this is not having other
+ # consequences, bug #630242
+ local emesonargs=(
+ -Denable-quvi=$(usex quvi yes no)
+ -Denable-libarchive=$(usex archive yes no)
+ -Denable-libgcrypt=$(usex crypt yes no)
+ $(meson_use gtk-doc enable-gtk-doc)
+ $(meson_use introspection enable-introspection)
+ )
+ meson_src_configure
+}
+
+src_test() {
+ # This is required as told by upstream in bgo#629542
+ GVFS_DISABLE_FUSE=1 dbus-run-session meson test -C "${BUILD_DIR}"
+}