summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrahmajit Das <brahmajit.xyz@gmail.com>2024-02-14 20:55:21 +0530
committerSam James <sam@gentoo.org>2024-02-15 13:53:06 +0000
commitd2fb6d7c0bb2d0db870555957f6a6d1fb77ce00f (patch)
tree03095bf4b84760a20a73f7808e6562ad456ad695 /dev-games/t4k-common
parentsys-apps/bat: add myself as a maintainer (diff)
downloadgentoo-d2fb6d7c0bb2d0db870555957f6a6d1fb77ce00f.tar.gz
gentoo-d2fb6d7c0bb2d0db870555957f6a6d1fb77ce00f.tar.bz2
gentoo-d2fb6d7c0bb2d0db870555957f6a6d1fb77ce00f.zip
dev-games/t4k-common: Fix building with gcc 14
Closes: https://bugs.gentoo.org/923789 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/35241 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-games/t4k-common')
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-gcc14-build-fix.patch76
-rw-r--r--dev-games/t4k-common/t4k-common-0.1.1-r2.ebuild66
2 files changed, 142 insertions, 0 deletions
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-gcc14-build-fix.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-gcc14-build-fix.patch
new file mode 100644
index 000000000000..7c272544ea2e
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-gcc14-build-fix.patch
@@ -0,0 +1,76 @@
+https://patch-diff.githubusercontent.com/raw/tux4kids/t4kcommon/pull/16.patch
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 7 Feb 2023 16:10:36 +0100
+Subject: [PATCH 1/2] linebreak: Avoid implicit declaration of u8_mbtouc_unsafe
+ function
+
+GNULIB_UNISTR_U8_MBTOUC_UNSAFE tells the bundled unistr.h to
+provide a function prototype for u8_mbtouc_unsafe. This prevents
+build failures with future compilers which do not support implicit
+function declarations.
+
+Upstream gnulib has split the linebreak module into multiple parts;
+it is hard to tell if it still has the same issue.
+--- a/src/linebreak/linebreak.c
++++ b/src/linebreak/linebreak.c
+@@ -35,6 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ //#include "c-ctype.h"
+ #include "ctype.h"
+ #include "xsize.h"
++#define GNULIB_UNISTR_U8_MBTOUC_UNSAFE
+ #include "unistr.h"
+ #include "uniwidth.h"
+ #include "uniwidth/cjk.h"
+--
+2.43.0
+
+
+Bug: https://bugs.gentoo.org/923789
+From: Brahmajit Das <brahmajit.xyz@gmail.com>
+Date: Fri, 9 Feb 2024 11:49:53 +0530
+Subject: [PATCH 2/2] t4k_menu: Fix passing incompatible pointer type
+
+First observed under Gentoo Linux with GCC 14, probably due to
+mismatching types between child (struct _xmlAttr *) and node.children
+(struct _xmlAttr *).
+
+Resulting in build errors such as
+t4k_menu.c:254:23: error: assignment to 'xmlAttr *' {aka 'struct _xmlAttr *'} from incompatible pointer type 'struct _xmlNode *' [-Wincompatible-pointer-types]
+ 254 | for(child = node->children; child; child = child->next) {
+ | ^
+t4k_menu.c:256:62: error: passing argument 1 of 'menu_TranslateNode' from incompatible pointer type [-Wincompatible-pointer-types]
+ 256 | tnode->submenu[i++] = menu_TranslateNode(child);
+ | ^~~~~
+ | |
+ | xmlAttr * {aka struct _xmlAttr *}
+
+Please reffer Gentoo bug: https://bugs.gentoo.org/923789
+Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
+--- a/src/t4k_menu.c
++++ b/src/t4k_menu.c
+@@ -251,9 +251,10 @@ MenuNode *menu_TranslateNode(xmlNode *node) {
+ /* Now add child nodes. */
+ if(xmlStrcasecmp(node->name, "menu") == 0) {
+ i = 0;
+- for(child = node->children; child; child = child->next) {
+- if(child->type == XML_ELEMENT_NODE) {
+- tnode->submenu[i++] = menu_TranslateNode(child);
++ xmlNode *childNode = NULL;
++ for(childNode = node->children; childNode; childNode = childNode->next) {
++ if(childNode->type == XML_ELEMENT_NODE) {
++ tnode->submenu[i++] = menu_TranslateNode(childNode);
+ }
+ }
+ }
+@@ -443,7 +444,7 @@ int T4K_RunMenu(int index, bool return_choice, void (*draw_background)(), int (*
+ int click_flag = 1;
+ int using_scroll = 0;
+
+- internal_res_switch_handler(&T4K_PrerenderAll);
++ internal_res_switch_handler((ResSwitchCallback)&T4K_PrerenderAll);
+
+ for(;;) /* one loop body execution for one menu page */
+ {
+--
+2.43.0
+
diff --git a/dev-games/t4k-common/t4k-common-0.1.1-r2.ebuild b/dev-games/t4k-common/t4k-common-0.1.1-r2.ebuild
new file mode 100644
index 000000000000..291feb6ce7d4
--- /dev/null
+++ b/dev-games/t4k-common/t4k-common-0.1.1-r2.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+DESCRIPTION="Library of code shared between tuxmath and tuxtype"
+HOMEPAGE="https://github.com/tux4kids/t4kcommon"
+SRC_URI="https://github.com/tux4kids/t4kcommon/archive/upstream/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/t4kcommon-upstream-${PV}"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="svg"
+
+RDEPEND="
+ dev-libs/libxml2:2
+ media-libs/libsdl
+ media-libs/sdl-image
+ media-libs/sdl-mixer
+ media-libs/sdl-net
+ media-libs/sdl-pango
+ svg? (
+ gnome-base/librsvg:2
+ media-libs/libpng:=
+ x11-libs/cairo
+ )"
+DEPEND="${RDEPEND}"
+# need sys-devel/gettext for AM_ICONV added to configure.ac
+BDEPEND="
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-libpng.patch
+ "${FILESDIR}"/${P}-fno-common.patch
+ "${FILESDIR}"/${P}-ICONV_CONST.patch
+ "${FILESDIR}"/${P}-fix-declaration.patch
+ "${FILESDIR}"/${P}-missing-text.patch
+ "${FILESDIR}"/${P}-svg-libxml2.patch
+ "${FILESDIR}"/${P}-gcc14-build-fix.patch
+)
+
+src_prepare() {
+ default
+
+ rm m4/iconv.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ # note: sdlpango<->sdlttf breaks ABI, prefer default pango
+ local econfargs=(
+ $(usex svg '' --without-rsvg)
+ --disable-static
+ )
+ econf "${econfargs[@]}"
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -delete || die
+}