From 26537a435cccd7ffb2ad3639ae7a2779b3d505c1 Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 28 Mar 2025 02:57:23 +0000 Subject: [PATCH] community/tinyfugue: fix build Selectively apply _GNU_SOURCE to fix implicit function declaration errors. ``` In file included from command.c:14: command.c: In function 'handle_localecho_command': port.h:115:20: error: implicit declaration of function 'strcasecmp'; did you mean 'wcscasecmp'? [-Wimplicit-function-declaration] 115 | # define cstrcmp strcasecmp | ^~~~~~~~~~ command.c:182:14: note: in expansion of macro 'cstrcmp' 182 | else if (cstrcmp(args->data + offset, "on") == 0) local_echo(1); | ^~~~~~~ command.c: In function 'do_file_load': command.c:551:29: error: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration] 551 | *savename = strdup( file->name ); | ^~~~~~ | strcmp command.c:551:27: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 551 | *savename = strdup( file->name ); | ^ ``` --- community/tinyfugue/APKBUILD | 7 +- community/tinyfugue/gnu-source.patch | 98 ++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 community/tinyfugue/gnu-source.patch diff --git a/community/tinyfugue/APKBUILD b/community/tinyfugue/APKBUILD index b277d231a19..5a8fa90b973 100644 --- a/community/tinyfugue/APKBUILD +++ b/community/tinyfugue/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Síle Ekaterin Liszka pkgname=tinyfugue pkgver=5.1.4 -pkgrel=3 +pkgrel=4 pkgdesc="Powerful curses-based MUD client" url="https://github.com/ingwarsw/tinyfugue" arch="all" @@ -10,7 +10,9 @@ options="!check" # no testsuite license="GPL-2.0-or-later" makedepends="openssl-dev ncurses-dev pcre-dev icu-dev python3-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/ingwarsw/tinyfugue/archive/refs/tags/$pkgver.tar.gz - gcc14.patch" + gcc14.patch + gnu-source.patch + " build() { ./configure \ @@ -34,4 +36,5 @@ package() { sha512sums=" 5732b3f96bc5e09e1eadd89994a25161d765ecaa0c72e5fd1d546b12028eb873faeb178fefbe3262aa790660a509fbf5de6dc74a50c23040005ab42d4a46ae14 tinyfugue-5.1.4.tar.gz fa5bbbcb236aeff6095a9bbac2975d78e72e73abd88260c41fccddd0e7b33e5cb50a77cf5661e9efab952e2076e76792a616c59552c25d8dce9e0bb21372ad46 gcc14.patch +81f5c100b67e9147c4ff2cd01374b046da02bc039b1310ea9b31f381b6052a8a15d1cdfc31a5b915680508dca1e5431e4db9f1593bbff751a1afaabea8f1fa66 gnu-source.patch " diff --git a/community/tinyfugue/gnu-source.patch b/community/tinyfugue/gnu-source.patch new file mode 100644 index 00000000000..ec6dd27ac1a --- /dev/null +++ b/community/tinyfugue/gnu-source.patch @@ -0,0 +1,98 @@ +Define macros to fix implicit function declaration errors. +--- +--- a/src/expr.c ++++ b/src/expr.c +@@ -13,6 +13,8 @@ + * Parses and evaluates expressions. + ********************************************************************/ + ++#define _GNU_SOURCE ++ + #include "tfconfig.h" + #include + #include +--- a/src/history.c ++++ b/src/history.c +@@ -13,6 +13,8 @@ + * Handles text queuing and file I/O for logs. * + ****************************************************************/ + ++#define _GNU_SOURCE ++ + #include + #include "tfconfig.h" + #include "port.h" +--- a/src/pattern.c ++++ b/src/pattern.c +@@ -10,6 +10,8 @@ + * Regexp wrappers and glob pattern matching. + */ + ++#define _GNU_SOURCE ++ + #include "tfconfig.h" + #if HAVE_LOCALE_H + # include +--- a/src/port.h ++++ b/src/port.h +@@ -6,6 +6,8 @@ + * General Public License. See the file "COPYING" for details. + ************************************************************************/ + ++#define _GNU_SOURCE ++ + #ifndef PORT_H + #define PORT_H + +@@ -86,6 +88,7 @@ + #if STDC_HEADERS + # include + # include ++# include /* strcasecmp() */ + #else + extern void free(); + # if HAVE_MEMORY_H +--- a/src/signals.c ++++ b/src/signals.c +@@ -8,6 +8,8 @@ + + /* Signal handling, core dumps, job control, and interactive shells */ + ++#define _POSIX_C_SOURCE 199309L /* for siginfo_t */ ++ + #include "tfconfig.h" + #include + #include +--- a/src/socket.c ++++ b/src/socket.c +@@ -16,6 +16,8 @@ + * Autologin handled here. + ***************************************************************/ + ++#define _POSIX_C_SOURCE 199309L /* for siginfo_t */ ++ + #include "tfconfig.h" + #include + #if HAVE_SYS_SELECT_H +--- a/src/util.c ++++ b/src/util.c +@@ -15,6 +15,8 @@ + * Mail checker + */ + ++#define _GNU_SOURCE ++ + #include "tfconfig.h" + #if HAVE_LOCALE_H + # include +--- a/src/variable.c ++++ b/src/variable.c +@@ -10,6 +10,8 @@ + * Internal and environment variables * + **************************************/ + ++#define _GNU_SOURCE /* timercmp() */ ++ + #include "tfconfig.h" + #include "port.h" + #include "tf.h"