summaryrefslogtreecommitdiff
path: root/dev-games/t4k-common
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
commitbfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch)
tree0d7a74b4463ee387f9cf9368ceb1b757f694f72a /dev-games/t4k-common
parentf716a9fe6455d39eef01e718aae68dae61c19704 (diff)
downloadbaldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'dev-games/t4k-common')
-rw-r--r--dev-games/t4k-common/Manifest1
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-ICONV_CONST.patch10
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-bool.patch33
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-fix-declaration.patch10
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-fno-common.patch11
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-gcc14-build-fix.patch76
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-libpng.patch18
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-missing-text.patch14
-rw-r--r--dev-games/t4k-common/files/t4k-common-0.1.1-svg-libxml2.patch73
-rw-r--r--dev-games/t4k-common/metadata.xml11
-rw-r--r--dev-games/t4k-common/t4k-common-0.1.1-r4.ebuild66
11 files changed, 323 insertions, 0 deletions
diff --git a/dev-games/t4k-common/Manifest b/dev-games/t4k-common/Manifest
new file mode 100644
index 000000000000..6d4292f4cbb9
--- /dev/null
+++ b/dev-games/t4k-common/Manifest
@@ -0,0 +1 @@
+DIST t4k-common-0.1.1.tar.gz 622239 BLAKE2B f2ddbb3b8815ad05001f99b8cfd49fda3c1f59e9dc340bf9739c2072e9f4a2faf069bf9f774f95818a0cb59302e557d3d6408530e8ff82adb6b9fd84b36e2641 SHA512 d7fdb469452637187adcb4b5d2907c05687765b1b75cd3a28b75222b2a0358f1962e1a245d88129b4dbede845fde8ff718cf9a7b0f97a12cb21a8791073fbe3d
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-ICONV_CONST.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-ICONV_CONST.patch
new file mode 100644
index 000000000000..037d2acd292b
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-ICONV_CONST.patch
@@ -0,0 +1,10 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -39,6 +39,7 @@
+ AC_PROG_MKDIR_P
+ AC_PROG_YACC
+ AC_PROG_LIBTOOL
++AM_ICONV
+
+
+ # -----------------------------------------------------------------------
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-bool.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-bool.patch
new file mode 100644
index 000000000000..202facfd63da
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-bool.patch
@@ -0,0 +1,33 @@
+Double-wrap bool in case it's a keyword, not macro, for C23.
+As typedef enum bool was guarded before and downstream user
+tuxmath package takes care to use bool type only internally,
+without exposing it over the network or to filesystem,
+I act under presumption that this is ok to do in this
+installable header.
+https://bugs.gentoo.org/943953
+--- a/src/t4k_common.h
++++ b/src/t4k_common.h
+@@ -55,6 +55,7 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <stdbool.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <dirent.h>
+@@ -124,6 +125,7 @@
+ // #define _(String) gettext (String)
+
+ #ifndef bool
++#if __STDC_VERSION__ <= 201710L
+ typedef enum
+ {
+ false,
+@@ -131,6 +133,7 @@
+ }
+ bool;
++#endif
+ #endif
+
+ // Debug macros
+ #define DEBUGCODE(mask) if((mask) & debug_status)
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-fix-declaration.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-fix-declaration.patch
new file mode 100644
index 000000000000..8b1188039f42
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-fix-declaration.patch
@@ -0,0 +1,10 @@
+https://bugs.gentoo.org/759574
+--- a/src/t4k_menu.c 2013-12-02 10:50:23.000000000 -0500
++++ b/src/t4k_menu.c 2021-01-04 19:49:20.561524579 -0500
+@@ -152,5 +152,5 @@
+ char* find_longest_text(MenuNode* menu, int* length);
+ int find_longest_menu_page(MenuNode* menu);
+-void set_font_size();
++void set_font_size(bool uniform);
+ void prerender_menu(MenuNode* menu);
+ int min(int a, int b);
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-fno-common.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-fno-common.patch
new file mode 100644
index 000000000000..2bdf418649c2
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-fno-common.patch
@@ -0,0 +1,11 @@
+--- a/src/t4k_common.h
++++ b/src/t4k_common.h
+@@ -239,7 +239,7 @@
+ #define MAX_LINES 128 //!< Maximum lines to wrap.
+ #define MAX_LINEWIDTH 256 //!< Maximum characters of each line.
+
+-char wrapped_lines[MAX_LINES][MAX_LINEWIDTH]; //!< Global buffer for wrapped lines.
++extern char wrapped_lines[MAX_LINES][MAX_LINEWIDTH]; //!< Global buffer for wrapped lines.
+
+ //TODO separate headers for different areas a la SDL?
+
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/files/t4k-common-0.1.1-libpng.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-libpng.patch
new file mode 100644
index 000000000000..fad91de2d205
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-libpng.patch
@@ -0,0 +1,18 @@
+--- a/src/t4k_loaders.c
++++ b/src/t4k_loaders.c
+@@ -1028,12 +1028,9 @@
+ {
+ png_init_io(png_ptr, fi);
+
+- info_ptr->width = surf->w;
+- info_ptr->height = surf->h;
+- info_ptr->bit_depth = 8;
+- info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+- info_ptr->interlace_type = 1;
+- info_ptr->valid = 0; /* will be updated by various png_set_FOO() functions */
++ png_set_IHDR(png_ptr, info_ptr, surf->w, surf->h, 8,
++ PNG_COLOR_TYPE_RGB_ALPHA, 1,
++ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+ png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr,
+ PNG_sRGB_INTENT_PERCEPTUAL);
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-missing-text.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-missing-text.patch
new file mode 100644
index 000000000000..72cb5372c282
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-missing-text.patch
@@ -0,0 +1,14 @@
+Fix some missing (transparent) text with libsdl-1.2.15_p20210224
+e.g. empty menus in tuxmath
+--- a/src/t4k_sdl.c
++++ b/src/t4k_sdl.c
+@@ -1401,3 +1401,3 @@
+ /* Use color key for eventual transparency: */
+- color_key = SDL_MapRGB(bg->format, 30, 30, 30);
++ color_key = SDL_MapRGBA(bg->format, 30, 30, 30, 0xff);
+ SDL_FillRect(bg, NULL, color_key);
+@@ -1448,3 +1448,3 @@
+ SDL_SetColorKey(bg, SDL_SRCCOLORKEY|SDL_RLEACCEL, color_key);
+- out = SDL_DisplayFormatAlpha(bg);
++ out = SDL_DisplayFormat(bg);
+ SDL_FreeSurface(bg);
diff --git a/dev-games/t4k-common/files/t4k-common-0.1.1-svg-libxml2.patch b/dev-games/t4k-common/files/t4k-common-0.1.1-svg-libxml2.patch
new file mode 100644
index 000000000000..590be3858de0
--- /dev/null
+++ b/dev-games/t4k-common/files/t4k-common-0.1.1-svg-libxml2.patch
@@ -0,0 +1,73 @@
+https://bugs.gentoo.org/763591
+
+https://github.com/tux4kids/t4kcommon/commit/99e9d3895b480d5998513592f6af25096c6d1c50
+From: Paul Huff <paul.huff@gmail.com>
+Date: Wed, 1 May 2019 19:56:12 -0600
+Subject: [PATCH] Use libxml2 to get info from svg files for frame counts since
+ librsvg doesn't let you access the description anymore.
+--- a/src/t4k_loaders.c
++++ b/src/t4k_loaders.c
+@@ -41,4 +41,6 @@
+ #include<librsvg/rsvg.h>
+ #include<librsvg/rsvg-cairo.h>
++#include <libxml/parser.h>
++#include <libxml/tree.h>
+ #endif
+
+@@ -49,4 +51,5 @@
+
+ #ifdef HAVE_RSVG
++int get_number_of_frames_from_svg(const char *file_name);
+ SDL_Surface* load_svg(const char* file_name, int width, int height, const char* layer_name);
+ sprite* load_svg_sprite(const char* file_name, int width, int height);
+@@ -161,4 +164,43 @@
+ #ifdef HAVE_RSVG
+
++int get_number_of_frames_from_svg(const char* file_name) {
++ xmlDocPtr svgFile;
++ xmlNodePtr svgNode = NULL, nodeIterator = NULL;
++ int number_of_frames = 0, found = 0;
++
++ svgFile = xmlReadFile(file_name, NULL, XML_PARSE_RECOVER | XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
++
++ /* If it's null something's really wrong because we're trying to load a sprite that doesn't exist */
++ if(svgFile == NULL) {
++ DEBUGMSG(debug_loaders, "get_number_of_frames_from_svg: couldn't load svgFile: %s\n", file_name);
++ return 0;
++ }
++
++ svgNode = xmlDocGetRootElement(svgFile);
++
++ /* If it's null then something's really wrong because there should be a root in every svg file... */
++ if(svgNode == NULL) {
++ DEBUGMSG(debug_loaders, "get_number_of_frames_from_svg: couldn't load the root from the svgFile: %s", file_name);
++ xmlFreeDoc(svgFile); /* be clean */
++ return 0;
++ }
++
++ nodeIterator = svgNode->children;
++ while(nodeIterator) {
++ if(xmlStrcasecmp(nodeIterator->name, (const xmlChar*)"desc") == 0) {
++ sscanf((const char*)xmlNodeGetContent(nodeIterator), "%d", &number_of_frames);
++ xmlFreeDoc(svgFile);
++ return number_of_frames;
++ }
++ nodeIterator = nodeIterator->next;
++ }
++
++ /* if we get here we had no description, which means something's really wrong */
++ DEBUGMSG(debug_loaders, "get_number_of_frames_from_svg: couldn't find the description frame number count from svgFile: %s", file_name);
++ xmlFreeDoc(svgFile);
++ return 0;
++}
++
++
+ /* Load a layer of SVG file and resize it to given dimensions.
+ If width or height is negative no resizing is applied.
+@@ -215,5 +257,5 @@
+
+ /* get number of frames from description */
+- sscanf(rsvg_handle_get_desc(file_handle), "%d", &new_sprite->num_frames);
++ new_sprite->num_frames = get_number_of_frames_from_svg(file_name);
+ DEBUGMSG(debug_loaders, "load_svg_sprite(): loading %d frames\n", new_sprite->num_frames);
+
diff --git a/dev-games/t4k-common/metadata.xml b/dev-games/t4k-common/metadata.xml
new file mode 100644
index 000000000000..b7cb48e8c0a9
--- /dev/null
+++ b/dev-games/t4k-common/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">tux4kids/t4kcommon</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-games/t4k-common/t4k-common-0.1.1-r4.ebuild b/dev-games/t4k-common/t4k-common-0.1.1-r4.ebuild
new file mode 100644
index 000000000000..640cfe66af13
--- /dev/null
+++ b/dev-games/t4k-common/t4k-common-0.1.1-r4.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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
+ "${FILESDIR}"/${P}-bool.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)
+ )
+ econf "${econfargs[@]}"
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -delete || die
+}