commit:     3d3061fa2f40c2897d8362a15e17d0a04ca5b26f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 17 00:51:46 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 17 02:52:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d3061fa

sys-apps/flatpak: fix compatibility with newer pyparsing

Bug: https://bugs.gentoo.org/825230
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../flatpak-1.12.2-pyparsing-3.0.2-compat.patch    |  42 ++++++++
 sys-apps/flatpak/flatpak-1.12.2-r1.ebuild          | 106 +++++++++++++++++++++
 2 files changed, 148 insertions(+)

diff --git a/sys-apps/flatpak/files/flatpak-1.12.2-pyparsing-3.0.2-compat.patch 
b/sys-apps/flatpak/files/flatpak-1.12.2-pyparsing-3.0.2-compat.patch
new file mode 100644
index 000000000000..237c659e36f8
--- /dev/null
+++ b/sys-apps/flatpak/files/flatpak-1.12.2-pyparsing-3.0.2-compat.patch
@@ -0,0 +1,42 @@
+https://gitlab.gnome.org/alexl/variant-schema-compiler/-/merge_requests/11.patch
+
+From 8850e4d0da76a85c5f9926cd40e148e0b29bddac Mon Sep 17 00:00:00 2001
+From: Phaedrus Leeds <[email protected]>
+Date: Thu, 16 Dec 2021 10:50:10 -0800
+Subject: [PATCH] Fix runtime error when using pyparsing >= 3.0.2
+
+Ever since this commit
+(https://github.com/pyparsing/pyparsing/commit/4ab17bb55)
+variant-schema-compiler has failed to execute when used by Flatpak like
+this:
+$ variant-schema-compiler/variant-schema-compiler --outfile-header
+common/flatpak-variant-private.h --outfile
+common/flatpak-variant-impl-private.h --prefix var
+./data/flatpak-variants.gv
+
+For some reason our use of leaveWhitespace() to ensure that a named type
+has a ' right before its name no longer works. But fortunately pyparsing
+has a Combine() which does exactly what we want.
+
+See https://github.com/flatpak/flatpak/issues/4534
+
+Fixes https://gitlab.gnome.org/alexl/variant-schema-compiler/-/issues/4
+---
+ variant-schema-compiler | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/subprojects/variant-schema-compiler/variant-schema-compiler
++++ b/subprojects/variant-schema-compiler/variant-schema-compiler
+@@ -1740,7 +1740,7 @@ def handleNameableType(toks):
+         add_named_type(typename_prefix + name, type)
+     return type
+ 
+-nameableType = (Optional((Suppress("'") + ident).leaveWhitespace()) + 
(arrayType ^ maybeType ^ dictType ^ 
structType)).setParseAction(handleNameableType)
++nameableType = (Optional(Combine(Suppress("'") + ident)) + (arrayType ^ 
maybeType ^ dictType ^ structType)).setParseAction(handleNameableType)
+ 
+ typeSpec <<= basicType  ^ variantType ^ namedType ^ nameableType
+ 
+-- 
+GitLab
+
+

diff --git a/sys-apps/flatpak/flatpak-1.12.2-r1.ebuild 
b/sys-apps/flatpak/flatpak-1.12.2-r1.ebuild
new file mode 100644
index 000000000000..93fb30b800bc
--- /dev/null
+++ b/sys-apps/flatpak/flatpak-1.12.2-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{8,9,10} )
+
+inherit autotools linux-info python-any-r1
+
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.xz";
+DESCRIPTION="Linux application sandboxing and distribution framework"
+HOMEPAGE="https://flatpak.org/";
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="doc gtk kde introspection policykit seccomp systemd"
+RESTRICT+=" test"
+
+RDEPEND="
+       acct-group/flatpak
+       acct-user/flatpak
+       >=app-arch/libarchive-2.8:=
+       app-arch/zstd:=
+       >=app-crypt/gpgme-1.1.8:=
+       >=dev-libs/appstream-glib-0.5.10:=
+       >=dev-libs/glib-2.56:2=
+       >=dev-libs/libxml2-2.4:=
+       dev-libs/json-glib:=
+       dev-libs/libassuan:=
+       >=dev-util/ostree-2020.8:=[gpg(+)]
+       || (
+               dev-util/ostree[curl]
+               dev-util/ostree[soup]
+       )
+       >=gnome-base/dconf-0.26:=
+       >=net-libs/libsoup-2.4:=
+       sys-apps/bubblewrap
+       sys-apps/dbus
+       >=sys-fs/fuse-2.9.9:0=
+       sys-apps/xdg-dbus-proxy
+       x11-apps/xauth
+       x11-libs/gdk-pixbuf:2=
+       x11-libs/libXau:=
+       policykit? ( >=sys-auth/polkit-0.98:= )
+       seccomp? ( sys-libs/libseccomp:= )
+       systemd? ( sys-apps/systemd:= )
+"
+
+DEPEND="${RDEPEND}"
+# pyparsing version pinned for https://bugs.gentoo.org/825230
+BDEPEND="
+       >=sys-devel/automake-1.13.4
+       >=sys-devel/gettext-0.18.2
+       virtual/pkgconfig
+       dev-util/gdbus-codegen
+       sys-devel/bison
+       introspection? ( >=dev-libs/gobject-introspection-1.40 )
+       doc? (
+               >=dev-util/gtk-doc-1.20
+               dev-libs/libxslt
+       )
+       $(python_gen_any_dep 'dev-python/pyparsing[${PYTHON_USEDEP}]')
+"
+
+PDEPEND="
+       gtk? ( sys-apps/xdg-desktop-portal-gtk )
+       kde? ( kde-plasma/xdg-desktop-portal-kde )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.12.2-pyparsing-3.0.2-compat.patch
+)
+
+python_check_deps() {
+       has_version -b "dev-python/pyparsing[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+       local CONFIG_CHECK="~USER_NS"
+       linux-info_pkg_setup
+       python-any-r1_pkg_setup
+}
+
+src_prepare() {
+       default
+       # This line fails because locales are in /usr/lib/locale/locale-archive.
+       sed -i 's:^cp -r /usr/lib/locale/C.*:#\0:' tests/make-test-runtime.sh 
|| die
+}
+
+src_configure() {
+       local myeconfargs=(
+               --enable-sandboxed-triggers
+               --enable-xauth
+               --localstatedir="${EPREFIX}"/var
+               --with-system-bubblewrap
+               --with-system-dbus-proxy
+               $(use_enable doc documentation)
+               $(use_enable doc gtk-doc)
+               $(use_enable introspection)
+               $(use_enable policykit system-helper)
+               $(use_enable seccomp)
+               $(use_with systemd)
+       )
+
+       econf "${myeconfargs[@]}"
+}

Reply via email to