commit: 406b2f69bdff4f078f6abba3d4e1959576de0444 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Dec 13 00:55:26 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Dec 13 00:57:59 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=406b2f69
dev-libs/libgee: update EAPI 7 -> 8, backport Vala (-> C99) fixes In this case, it appears the Vala itself was wrong, which meant the generated C was wrong, rather than the Vala being right, but valac generating junk. Bug: https://bugs.gentoo.org/915015 Closes: https://bugs.gentoo.org/894376 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-libs/libgee/files/libgee-0.20.6-c99-2.patch | 55 +++++++++++++++++++++++++ dev-libs/libgee/files/libgee-0.20.6-c99.patch | 43 +++++++++++++++++++ dev-libs/libgee/libgee-0.20.6-r1.ebuild | 40 ++++++++++++++++++ 3 files changed, 138 insertions(+) diff --git a/dev-libs/libgee/files/libgee-0.20.6-c99-2.patch b/dev-libs/libgee/files/libgee-0.20.6-c99-2.patch new file mode 100644 index 000000000000..3c55704739e3 --- /dev/null +++ b/dev-libs/libgee/files/libgee-0.20.6-c99-2.patch @@ -0,0 +1,55 @@ +https://bugs.gentoo.org/894376 +https://gitlab.gnome.org/GNOME/libgee/-/commit/2f0bbe8987e5eb1390b23ac531c971b202c2ef77 + +From 2f0bbe8987e5eb1390b23ac531c971b202c2ef77 Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz <ric...@ubuntu.com> +Date: Thu, 13 Apr 2023 23:43:03 +0200 +Subject: [PATCH] Implementations of "G List.get()" should use non-nullable + return as defined + +--- a/gee/abstractlist.vala ++++ b/gee/abstractlist.vala +@@ -39,7 +39,7 @@ public abstract class Gee.AbstractList<G> : Gee.AbstractCollection<G>, List<G> { + /** + * {@inheritDoc} + */ +- public abstract new G? get (int index); ++ public abstract new G get (int index); + + /** + * {@inheritDoc} +--- a/gee/concurrentlist.vala ++++ b/gee/concurrentlist.vala +@@ -170,7 +170,7 @@ public class Gee.ConcurrentList<G> : AbstractList<G> { + /** + * {@inheritDoc} + */ +- public override G? get (int index) { ++ public override G get (int index) { + HazardPointer.Context ctx = new HazardPointer.Context (); + Utils.Misc.unused (ctx); + assert (index >= 0); +--- a/gee/readonlylist.vala ++++ b/gee/readonlylist.vala +@@ -74,7 +74,7 @@ internal class Gee.ReadOnlyList<G> : Gee.ReadOnlyCollection<G>, List<G> { + /** + * {@inheritDoc} + */ +- public new G? get (int index) { ++ public new G get (int index) { + return ((Gee.List<G>) _collection).get (index); + } + +--- a/gee/unrolledlinkedlist.vala ++++ b/gee/unrolledlinkedlist.vala +@@ -158,7 +158,7 @@ public class Gee.UnrolledLinkedList<G> : AbstractBidirList<G>, Queue<G>, Deque<G + return new Iterator<G> (this); + } + +- public override G? get (int index) { ++ public override G get (int index) { + assert (index >= 0); + assert (index < this._size); + +-- +GitLab diff --git a/dev-libs/libgee/files/libgee-0.20.6-c99.patch b/dev-libs/libgee/files/libgee-0.20.6-c99.patch new file mode 100644 index 000000000000..99275ff821d7 --- /dev/null +++ b/dev-libs/libgee/files/libgee-0.20.6-c99.patch @@ -0,0 +1,43 @@ +https://bugs.gentoo.org/894376 +https://gitlab.gnome.org/GNOME/libgee/-/commit/b33a6627f4fc96938b6015e05849867c472160a8 + +From b33a6627f4fc96938b6015e05849867c472160a8 Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz <ric...@ubuntu.com> +Date: Sat, 8 Apr 2023 22:39:35 +0200 +Subject: [PATCH] Add more missing generic type arguments + +--- a/gee/hashmap.vala ++++ b/gee/hashmap.vala +@@ -253,7 +253,7 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> { + for (int i = 0; i < _array_size; i++) { + Node<K,V> node = (owned) _nodes[i]; + while (node != null) { +- Node next = (owned) node.next; ++ Node<K,V> next = (owned) node.next; + node.key = null; + node.value = null; + node = (owned) next; +--- a/gee/hashset.vala ++++ b/gee/hashset.vala +@@ -210,7 +210,7 @@ public class Gee.HashSet<G> : AbstractSet<G> { + for (int i = 0; i < _array_size; i++) { + Node<G> node = (owned) _nodes[i]; + while (node != null) { +- Node next = (owned) node.next; ++ Node<G> next = (owned) node.next; + node.key = null; + node = (owned) next; + } +--- a/gee/linkedlist.vala ++++ b/gee/linkedlist.vala +@@ -233,7 +233,7 @@ public class Gee.LinkedList<G> : AbstractBidirList<G>, Queue<G>, Deque<G> { + n.next.prev = n; + this._head = (owned)n; + } else { +- weak Node prev = this._head; ++ weak Node<G> prev = this._head; + for (int i = 0; i < index - 1; i++) { + prev = prev.next; + } +-- +GitLab diff --git a/dev-libs/libgee/libgee-0.20.6-r1.ebuild b/dev-libs/libgee/libgee-0.20.6-r1.ebuild new file mode 100644 index 000000000000..3c469a418ef2 --- /dev/null +++ b/dev-libs/libgee/libgee-0.20.6-r1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit gnome2 vala + +DESCRIPTION="GObject-based interfaces and classes for commonly used data structures" +HOMEPAGE="https://wiki.gnome.org/Projects/Libgee" + +LICENSE="LGPL-2.1+" +SLOT="0.8/2" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x86-linux" +IUSE="+introspection" + +# FIXME: add doc support, requires valadoc +RDEPEND=" + >=dev-libs/glib-2.36:2 + introspection? ( >=dev-libs/gobject-introspection-0.9.6:= ) +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/libgee-0.20.6-c99.patch + "${FILESDIR}"/libgee-0.20.6-c99-2.patch +) + +src_prepare() { + vala_setup + gnome2_src_prepare +} + +src_configure() { + # Commented out VALAC="$(type -P false)" for c99 patches + # We can drop all the Vala wiring and use the shipped files once + # a new release is made. + gnome2_src_configure \ + $(use_enable introspection) +}