summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-games/libnw')
-rw-r--r--dev-games/libnw/files/libnw-1.30.02-C23.patch210
-rw-r--r--dev-games/libnw/libnw-1.30.02-r1.ebuild3
-rw-r--r--dev-games/libnw/libnw-1.30.02-r2.ebuild44
3 files changed, 255 insertions, 2 deletions
diff --git a/dev-games/libnw/files/libnw-1.30.02-C23.patch b/dev-games/libnw/files/libnw-1.30.02-C23.patch
new file mode 100644
index 000000000000..984cd10f3605
--- /dev/null
+++ b/dev-games/libnw/files/libnw-1.30.02-C23.patch
@@ -0,0 +1,210 @@
+https://bugs.gentoo.org/931876
+Fix incompatible pointer cast by pointing to hopefully correct struct
+member.
+Ordering of {.y,.c} is important so makefile doesn't try and fail to
+regenerate autogenerated file we just edited.
+--- a/libnw/mdly.y
++++ b/libnw/mdly.y
+@@ -214,7 +214,7 @@
+ dummynodeelement
+ : token_parent token_string =
+ {
+- cur_Node->parent = $2;
++ cur_Node->parent->name = $2;
+ }
+ | token_position xyz =
+ {
+@@ -247,7 +247,7 @@
+ trimeshnodeelement
+ : token_parent token_string =
+ {
+- cur_Node->parent = $2;
++ cur_Node->parent->name = $2;
+ }
+ | token_position xyz =
+ {
+@@ -359,7 +359,7 @@
+ aabbnodeelement
+ : token_parent token_string =
+ {
+- cur_Node->parent = $2;
++ cur_Node->parent->name = $2;
+ }
+ | token_ambient rgb =
+ {
+--- a/libnw/mdly.c
++++ b/libnw/mdly.c
+@@ -1142,7 +1142,7 @@
+ case 22:
+ #line 216 "mdly.y"
+ {
+- cur_Node->parent = yyvsp[0].string;
++ cur_Node->parent->name = yyvsp[0].string;
+ }
+ break;
+ case 23:
+@@ -1167,7 +1167,7 @@
+ case 30:
+ #line 249 "mdly.y"
+ {
+- cur_Node->parent = yyvsp[0].string;
++ cur_Node->parent->name = yyvsp[0].string;
+ }
+ break;
+ case 31:
+@@ -1294,7 +1294,7 @@
+ case 60:
+ #line 361 "mdly.y"
+ {
+- cur_Node->parent = yyvsp[0].string;
++ cur_Node->parent->name = yyvsp[0].string;
+ }
+ break;
+ case 61:
+Minimum amount of patching to make it compile with C23:
+_POSIX_C_SOURCE for fileno and getopt
+strings for strncasecmp
+--- a/libnw/key.c
++++ b/libnw/key.c
+@@ -9,6 +9,7 @@
+ # endif
+ # include <string.h>
+ #endif
++#include <strings.h>
+ #include "global.h"
+ #include "key.h"
+ #include "restyp.h"
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,4 +2,4 @@
+
+ EXTRA_DIST = README.tech TODO autogen.sh README.License-Torlack Doxyfile.in magic
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/itpdis/Makefile.am
++++ b/itpdis/Makefile.am
+@@ -10,4 +10,4 @@
+
+ INCLUDES = -I$(top_srcdir)/include
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/libnw/Makefile.am
++++ b/libnw/Makefile.am
+@@ -18,4 +18,4 @@
+ EXTRA_DIST = $(man_MANS) sety.h mdly.h agg_toc_load.3.in agg_toc_del.3.in \
+ agg_create.3.in bif_toc_load.3.in get_game_dir.3.in read_key.3.in
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nw2da2csv/Makefile.am
++++ b/nw2da2csv/Makefile.am
+@@ -10,4 +10,4 @@
+
+ EXTRA_DIST = $(man_MANS) nw2da2csv.1.in
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwaggext/Makefile.am
++++ b/nwaggext/Makefile.am
+@@ -10,4 +10,4 @@
+
+ INCLUDES = -I$(top_srcdir)/include
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwareamap/Makefile.am
++++ b/nwareamap/Makefile.am
+@@ -10,4 +10,4 @@
+
+ INCLUDES = -I$(top_srcdir)/include
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwmrgplc/Makefile.am
++++ b/nwmrgplc/Makefile.am
+@@ -10,4 +10,4 @@
+
+ EXTRA_DIST = $(man_MANS) nwmrgplc.1.in
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwresext/Makefile.am
++++ b/nwresext/Makefile.am
+@@ -10,4 +10,4 @@
+
+ INCLUDES = -I$(top_srcdir)/include
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwstrref/Makefile.am
++++ b/nwstrref/Makefile.am
+@@ -10,4 +10,4 @@
+
+ INCLUDES = -I$(top_srcdir)/include
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwtsfix/Makefile.am
++++ b/nwtsfix/Makefile.am
+@@ -10,4 +10,4 @@
+
+ EXTRA_DIST = $(man_MANS) nwtsfix.1.in
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwtsmerge/Makefile.am
++++ b/nwtsmerge/Makefile.am
+@@ -10,4 +10,4 @@
+
+ EXTRA_DIST = $(man_MANS) nwtsmerge.1.in
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/nwtsrefs/Makefile.am
++++ b/nwtsrefs/Makefile.am
+@@ -10,4 +10,4 @@
+
+ EXTRA_DIST = $(man_MANS) nwtsrefs.1.in
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/plistcheck/Makefile.am
++++ b/plistcheck/Makefile.am
+@@ -6,4 +6,4 @@
+
+ INCLUDES = -I$(top_srcdir)/include
+
+-AM_CFLAGS = -Wall
++AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
+--- a/itpdis/main.c
++++ b/itpdis/main.c
+@@ -12,6 +12,7 @@
+ # endif
+ # include <string.h>
+ #endif
++#include <strings.h>
+ #include "global.h"
+ #include "gamedir.h"
+ #include "itp.h"
+--- a/nwmrgplc/main.c
++++ b/nwmrgplc/main.c
+@@ -12,6 +12,7 @@
+ # endif
+ # include <string.h>
+ #endif
++#include <strings.h>
+ #include "global.h"
+ #include "gamedir.h"
+ #include "2da.h"
+--- a/nwtsrefs/main.c
++++ b/nwtsrefs/main.c
+@@ -12,6 +12,7 @@
+ # endif
+ # include <string.h>
+ #endif
++#include <strings.h>
+ #include <ctype.h>
+ #include "global.h"
+ #include "gamedir.h"
diff --git a/dev-games/libnw/libnw-1.30.02-r1.ebuild b/dev-games/libnw/libnw-1.30.02-r1.ebuild
index 70e02dd86931..138aa232ff3a 100644
--- a/dev-games/libnw/libnw-1.30.02-r1.ebuild
+++ b/dev-games/libnw/libnw-1.30.02-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -23,7 +23,6 @@ DOCS=( AUTHORS ChangeLog NEWS README README.tech TODO )
src_prepare() {
default
eautoreconf
-
}
src_configure() {
diff --git a/dev-games/libnw/libnw-1.30.02-r2.ebuild b/dev-games/libnw/libnw-1.30.02-r2.ebuild
new file mode 100644
index 000000000000..51910d3a94e7
--- /dev/null
+++ b/dev-games/libnw/libnw-1.30.02-r2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="Tools and libraries for NWN file manipulation"
+HOMEPAGE="https://sourceforge.net/projects/openknights/"
+SRC_URI="https://downloads.sourceforge.net/openknights/${P}.tar.gz"
+
+LICENSE="openknights"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="!sci-biology/newick-utils"
+BDEPEND="
+ app-alternatives/yacc
+ app-alternatives/lex"
+
+DOCS=( AUTHORS ChangeLog NEWS README README.tech TODO )
+
+PATCHES=( "${FILESDIR}/${P}-C23.patch" )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ # -Werror=strict-aliasing
+ # https://bugs.gentoo.org/855314
+ #
+ # Sourceforge software dead since 2006, no point reporting anything.
+ append-flags -fno-strict-aliasing
+ filter-lto
+
+ default
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -delete || die
+}