pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wadgadget: Update to 0.2



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <micha%NetBSD.org@localhost>
Pushed By:	micha
Date:		Wed Jul 1 12:50:42 2026 +0200
Changeset:	d24ef057449168d8c8e9e37f70986f156a36b82b

Modified Files:
	wadgadget/COMMIT_MSG
	wadgadget/Makefile
	wadgadget/distinfo
Added Files:
	wadgadget/patches/patch-src_GNUmakefile
	wadgadget/patches/patch-src_fs_file__set.c
	wadgadget/patches/patch-src_fs_wad__file.c
	wadgadget/patches/patch-src_pager_help.c
	wadgadget/patches/patch-src_pager_pager.c
	wadgadget/patches/patch-src_stringlib.c
	wadgadget/patches/patch-src_textures_config.c
	wadgadget/patches/patch-src_textures_pnames.c
	wadgadget/patches/patch-src_textures_textures.c
Removed Files:
	wadgadget/patches/patch-GNUmakefile

Log Message:
wadgadget: Update to 0.2

New features:
- Mouse input is now suppported, and many parts of the UI can now be
  interacted with by clicking.
- A texture editor was added, making the TEXTURE browser
  feature-complete.
- A browser/editor for GENMIDI lumps was implemented, including export
  to / import from .sbi voice files.
- A new action was added to update existing WAD entries. This works
  the same as the import action but instead automatically replaces the
  contents of existing entries, rather creating new ones.
- A new action to move files between directories was added.
- Duke3D/ROTT .rts files are now recognized as WAD files, and embedded
  .voc files (found inside them) are recognized as sound effects.
- It is now possible to edit the headers of graphic lumps (useful in
  particular in order to change the X/Y offsets).
- It's now possible to import graphics from a variety of other file
  formats in addition to .png: .pcx, .lbm, .gif, .bmp, .ppm, .tiff and
  .xpm. This is accomplished using NetPBM filters.

Minor:
- Escape now only exits the program when viewing a directory, to avoid
  accidentally exiting the program prematurely. Escape time delay was
  reduced to 10ms, improving responsiveness.
- Bullet point lists in the help browser are shown with real bullet
  point characters rather than asterisks.
- In the hexdump view, the UDS-help action now jumps to the relevant
  section of the document based on the lump being viewed. Other
  documents will also be shown instead (boomref, etc.) if appropriate.
- The ^W key combo now clears search, rather than ^U.

Bugs fixed:
- A crash was fixed when creating an empty WAD file.
- A crash was fixed when deleting an entry selected in the other pane
  (thanks skynettx).
- There is no longer a "flash" of the wrong palette when exiting the
  program.
- A crash was fixed when .png files would fail to import properly.

Cleanups:
- Initial support was added for building using pdcurses.
- The codebase was tidied using clang-format and include-what-you-use.
- Various cross-platform changes were introduced, inspired by
  @skynettx's Windows port of the program. These lay the groundwork for an
  "official" Windows port in the future.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d24ef057449168d8c8e9e37f70986f156a36b82b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 wadgadget/COMMIT_MSG                            |  2 +-
 wadgadget/Makefile                              | 12 +++----
 wadgadget/distinfo                              | 16 ++++++---
 wadgadget/patches/patch-GNUmakefile             | 18 ----------
 wadgadget/patches/patch-src_GNUmakefile         | 27 ++++++++++++++
 wadgadget/patches/patch-src_fs_file__set.c      | 15 ++++++++
 wadgadget/patches/patch-src_fs_wad__file.c      | 15 ++++++++
 wadgadget/patches/patch-src_pager_help.c        | 48 +++++++++++++++++++++++++
 wadgadget/patches/patch-src_pager_pager.c       | 15 ++++++++
 wadgadget/patches/patch-src_stringlib.c         | 15 ++++++++
 wadgadget/patches/patch-src_textures_config.c   | 15 ++++++++
 wadgadget/patches/patch-src_textures_pnames.c   | 15 ++++++++
 wadgadget/patches/patch-src_textures_textures.c | 15 ++++++++
 13 files changed, 198 insertions(+), 30 deletions(-)

diffs:
diff --git a/wadgadget/COMMIT_MSG b/wadgadget/COMMIT_MSG
index 46fcb4cab2..bbe3ec7791 100644
--- a/wadgadget/COMMIT_MSG
+++ b/wadgadget/COMMIT_MSG
@@ -1,4 +1,4 @@
-games/wadgadget: Import WadGadget 0.1
+games/wadgadget: Import WadGadget 0.2
 
 WadGadget is a console-based, interactive WAD file editor for
 Doom engine games (and others that reuse the WAD format).
diff --git a/wadgadget/Makefile b/wadgadget/Makefile
index fcbefe5ffa..92dbef2cec 100644
--- a/wadgadget/Makefile
+++ b/wadgadget/Makefile
@@ -1,6 +1,6 @@
 # $NetBSD$
 
-DISTNAME=	wadgadget-0.1
+DISTNAME=	wadgadget-0.2
 CATEGORIES=	games
 MASTER_SITES=	${MASTER_SITE_GITHUB:=fragglet/}
 GITHUB_TAG=	${DISTNAME}
@@ -16,17 +16,15 @@ LICENSE=	gnu-gpl-v2
 USE_CC_FEATURES=	c99
 USE_TOOLS+=		gmake pkg-config
 
-WRKSRC=			${WRKDIR}/WadGadget-wadgadget-0.1/src
-REPLACE_PYTHON=		help/make_help.py
+WRKSRC=			${WRKDIR}/WadGadget-wadgadget-0.2
 INSTALLATION_DIRS=	bin
 
 MAKE_FILE=		GNUmakefile
-BUILD_TARGET=		wadgadget
 
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/wadgadget ${DESTDIR}${PREFIX}/bin/
+#do-install:
+#	${INSTALL_PROGRAM} ${WRKSRC}/wadgadget ${DESTDIR}${PREFIX}/bin/
 
-PYTHON_VERSIONS_ACCEPTED=	312 311 310
+PYTHON_VERSIONS_ACCEPTED=	313 312 311 310
 .include "../../lang/python/tool.mk"
 
 .include "../../audio/libsndfile/buildlink3.mk"
diff --git a/wadgadget/distinfo b/wadgadget/distinfo
index 10e5e90d4b..76ccac6faa 100644
--- a/wadgadget/distinfo
+++ b/wadgadget/distinfo
@@ -1,6 +1,14 @@
 $NetBSD$
 
-BLAKE2s (wadgadget-0.1.tar.gz) = c5087bf6af3c9a12c9799e9086fda6e0e2a727b6c8fed72bd4a62d51e9844932
-SHA512 (wadgadget-0.1.tar.gz) = 69daa63d471739c99448765c608e416f48fc261dce3aed550c6ba6e0bf4ac1992561b6799b560693205e631bc0add350075394f51a9da647a388c608fb586973
-Size (wadgadget-0.1.tar.gz) = 402256 bytes
-SHA1 (patch-GNUmakefile) = 43e0fe57ffec847120ef0d952fcf6cb4f02a465c
+BLAKE2s (wadgadget-0.2.tar.gz) = e668a4f73d934ddc076d5a08f3ac5e70207e871cab8f96683ac69a1f94bcdd93
+SHA512 (wadgadget-0.2.tar.gz) = 6d7992e92f83f695b110139b690b9fe74a47ea209661e5aa1d0582894f92262ce2777617483d79e9bb9ee5e8aec9269f29b531ec7eb25774be2dc3c0c882f968
+Size (wadgadget-0.2.tar.gz) = 427892 bytes
+SHA1 (patch-src_GNUmakefile) = 32c59dc3120aea280000798acaeddc4273e794e5
+SHA1 (patch-src_fs_file__set.c) = 7ce3479ecce150e315de1019481ffd50902268cd
+SHA1 (patch-src_fs_wad__file.c) = 7f6f0ab5a9f8bb8204b2cbbbdfad0f1dce927c64
+SHA1 (patch-src_pager_help.c) = d4ea91c06ab068821e542f882703bbcb4dc094cf
+SHA1 (patch-src_pager_pager.c) = 54b2c18ca70653f522b398b0c44bdaa5e8769dc2
+SHA1 (patch-src_stringlib.c) = 2ff783d66f0e04d32ea9e172ceccb4502b44f39f
+SHA1 (patch-src_textures_config.c) = 24eeb8f5717fe2d20cba8d38d010a41e3ed44dea
+SHA1 (patch-src_textures_pnames.c) = eefbd3d938adacbed910e5be19e10362c1234e37
+SHA1 (patch-src_textures_textures.c) = 17e9d3e124dc2adf63f006f9fe886dfc2a434faa
diff --git a/wadgadget/patches/patch-GNUmakefile b/wadgadget/patches/patch-GNUmakefile
deleted file mode 100644
index 3020644809..0000000000
--- a/wadgadget/patches/patch-GNUmakefile
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD$
-
-Honor CFLAGS and LDFLAGS.
-
---- GNUmakefile.orig	2024-08-10 15:22:09.000000000 +0000
-+++ GNUmakefile
-@@ -14,9 +14,9 @@ NCURSES_LDFLAGS = \
-     $(shell pkg-config --silence-errors --libs ncurses || echo -lncurses)
- 
- REQUIRED_PKGS = sndfile libpng
--CFLAGS := -g -MMD -Wall -I. -O2 $(shell pkg-config --cflags $(REQUIRED_PKGS)) \
-+CFLAGS := $(CFLAGS) -MMD -Wall -I. -O2 $(shell pkg-config --cflags $(REQUIRED_PKGS)) \
-           $(LIBSIXEL_CFLAGS) $(NCURSES_CFLAGS)
--LDFLAGS := $(shell pkg-config --libs $(REQUIRED_PKGS)) \
-+LDFLAGS := $(LDFLAGS) $(shell pkg-config --libs $(REQUIRED_PKGS)) \
-            $(LIBSIXEL_LDFLAGS) $(NCURSES_LDFLAGS)
- 
- HELP_FILES =                \
diff --git a/wadgadget/patches/patch-src_GNUmakefile b/wadgadget/patches/patch-src_GNUmakefile
new file mode 100644
index 0000000000..ecc918475d
--- /dev/null
+++ b/wadgadget/patches/patch-src_GNUmakefile
@@ -0,0 +1,27 @@
+$NetBSD$
+
+Honor DESTDIR, PREFIX, CFLAGS and LDFLAGS.
+
+--- src/GNUmakefile.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/GNUmakefile
+@@ -1,6 +1,6 @@
+ 
+-DESTDIR =
+-PREFIX = /usr/local
++#DESTDIR =
++#PREFIX = /usr/local
+ 
+ LIBSIXEL_CFLAGS = \
+     $(shell pkg-config --silence-errors --cflags libsixel \
+@@ -29,9 +29,9 @@ CURSES_LDFLAGS = \
+ endif
+ 
+ REQUIRED_PKGS = sndfile libpng
+-CFLAGS := -g -MMD -Wall -I. -O2 $(shell pkg-config --cflags $(REQUIRED_PKGS)) \
++CFLAGS := $(CFLAGS) -MMD -Wall -I. -O2 $(shell pkg-config --cflags $(REQUIRED_PKGS)) \
+           $(LIBSIXEL_CFLAGS) $(CURSES_CFLAGS)
+-LDFLAGS := $(shell pkg-config --libs $(REQUIRED_PKGS)) \
++LDFLAGS := $(LDFLAGS) $(shell pkg-config --libs $(REQUIRED_PKGS)) \
+            $(LIBSIXEL_LDFLAGS) $(CURSES_LDFLAGS)
+ 
+ IWYU = iwyu
diff --git a/wadgadget/patches/patch-src_fs_file__set.c b/wadgadget/patches/patch-src_fs_file__set.c
new file mode 100644
index 0000000000..c40c935e86
--- /dev/null
+++ b/wadgadget/patches/patch-src_fs_file__set.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of tolower().
+
+--- src/fs/file_set.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/fs/file_set.c
+@@ -73,7 +73,7 @@ static bool GlobMatch(const char *patter
+ 	case '?':
+ 		return *s != '\0' && GlobMatch(pattern + 1, s + 1);
+ 	default:
+-		return tolower(*s) == tolower(*pattern) &&
++		return tolower((unsigned char) *s) == tolower((unsigned char) *pattern) &&
+ 		       GlobMatch(pattern + 1, s + 1);
+ 	}
+ }
diff --git a/wadgadget/patches/patch-src_fs_wad__file.c b/wadgadget/patches/patch-src_fs_wad__file.c
new file mode 100644
index 0000000000..6137d86523
--- /dev/null
+++ b/wadgadget/patches/patch-src_fs_wad__file.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of toupper().
+
+--- src/fs/wad_file.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/fs/wad_file.c
+@@ -316,7 +316,7 @@ void W_SetLumpName(struct wad_file *f, u
+ 	assert(!f->readonly);
+ 	assert(index < f->num_lumps);
+ 	for (i = 0; i < 8; i++) {
+-		f->directory[index].name[i] = toupper(name[i]);
++		f->directory[index].name[i] = toupper((unsigned char) name[i]);
+ 		if (name[i] == '\0') {
+ 			break;
+ 		}
diff --git a/wadgadget/patches/patch-src_pager_help.c b/wadgadget/patches/patch-src_pager_help.c
new file mode 100644
index 0000000000..78d591f4fc
--- /dev/null
+++ b/wadgadget/patches/patch-src_pager_help.c
@@ -0,0 +1,48 @@
+$NetBSD$
+
+Prevent undefined behaviour of isalnum(), tolower() and isspace().
+
+--- src/pager/help.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/pager/help.c
+@@ -136,8 +136,8 @@ static char *AnchorName(const char *line
+ 
+ 	result = checked_strdup(line);
+ 	for (p = result, q = result; *p != '\0'; ++p) {
+-		if (isalnum(*p)) {
+-			*q = tolower(*p);
++		if (isalnum((unsigned char) *p)) {
++			*q = tolower((unsigned char) *p);
+ 			++q;
+ 		} else if (*p == ' ' || *p == '-') {
+ 			*q = '-';
+@@ -431,7 +431,7 @@ static const char *DrawBoldText(WINDOW *
+ static bool IsHorizRule(const char *s)
+ {
+ 	while (*s != '\0') {
+-		if (!isspace(*s) && *s != '-') {
++		if (!isspace((unsigned char) *s) && *s != '-') {
+ 			return false;
+ 		}
+ 		++s;
+@@ -442,10 +442,10 @@ static bool IsHorizRule(const char *s)
+ 
+ static bool IsBulletPoint(const char *s)
+ {
+-	while (*s != '\0' && isspace(*s)) {
++	while (*s != '\0' && isspace((unsigned char) *s)) {
+ 		++s;
+ 	}
+-	return s[0] == '*' && isspace(s[1]);
++	return s[0] == '*' && isspace((unsigned char) s[1]);
+ }
+ 
+ static void DrawHelpLine(WINDOW *win, unsigned int lineno, void *user_data)
+@@ -482,7 +482,7 @@ static void DrawHelpLine(WINDOW *win, un
+ 	p = line;
+ 
+ 	if (IsBulletPoint(line)) {
+-		while (isspace(*p) || (p[0] == '*' && isspace(p[1]))) {
++		while (isspace((unsigned char) *p) || (p[0] == '*' && isspace((unsigned char) p[1]))) {
+ 			waddch(win, *p == '*' ? ACS_BULLET : ' ');
+ 			++p;
+ 		}
diff --git a/wadgadget/patches/patch-src_pager_pager.c b/wadgadget/patches/patch-src_pager_pager.c
new file mode 100644
index 0000000000..3fcb6fa03f
--- /dev/null
+++ b/wadgadget/patches/patch-src_pager_pager.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of tolower().
+
+--- src/pager/pager.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/pager/pager.c
+@@ -102,7 +102,7 @@ static bool LineContainsString(struct pa
+ 	for (i = 0; i < w - needle_len; i++) {
+ 		for (j = 0; needle[j] != '\0'; j++) {
+ 			int c = mvwinch(p->search_pad, 0, i + j);
+-			if (tolower(needle[j]) != tolower(c & A_CHARTEXT)) {
++			if (tolower((unsigned char) needle[j]) != tolower((unsigned char) (c & A_CHARTEXT))) {
+ 				break;
+ 			}
+ 		}
diff --git a/wadgadget/patches/patch-src_stringlib.c b/wadgadget/patches/patch-src_stringlib.c
new file mode 100644
index 0000000000..dd8ae3fa13
--- /dev/null
+++ b/wadgadget/patches/patch-src_stringlib.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of toupper().
+
+--- src/stringlib.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/stringlib.c
+@@ -232,7 +232,7 @@ void StringUpper(char *s)
+ {
+ 	char *p;
+ 	for (p = s; *p != '\0'; ++p) {
+-		*p = toupper(*p);
++		*p = toupper((unsigned char) *p);
+ 	}
+ }
+ 
diff --git a/wadgadget/patches/patch-src_textures_config.c b/wadgadget/patches/patch-src_textures_config.c
new file mode 100644
index 0000000000..28a640f0f5
--- /dev/null
+++ b/wadgadget/patches/patch-src_textures_config.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of isspacer().
+
+--- src/textures/config.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/textures/config.c
+@@ -119,7 +119,7 @@ static void StripTrailingSpaces(char *li
+ 	char *p = line + strlen(line);
+ 	while (p > line) {
+ 		--p;
+-		if (!isspace(*p)) {
++		if (!isspace((unsigned char) *p)) {
+ 			break;
+ 		}
+ 		*p = '\0';
diff --git a/wadgadget/patches/patch-src_textures_pnames.c b/wadgadget/patches/patch-src_textures_pnames.c
new file mode 100644
index 0000000000..32e65ebacd
--- /dev/null
+++ b/wadgadget/patches/patch-src_textures_pnames.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of toupper().
+
+--- src/textures/pnames.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/textures/pnames.c
+@@ -132,7 +132,7 @@ void TX_RenamePname(struct pnames *pn, u
+ 
+ 	namedest = pn->pnames[idx];
+ 	for (i = 0; i < 8; i++) {
+-		namedest[i] = toupper(name[i]);
++		namedest[i] = toupper((unsigned char) name[i]);
+ 		if (namedest[i] == '\0') {
+ 			break;
+ 		}
diff --git a/wadgadget/patches/patch-src_textures_textures.c b/wadgadget/patches/patch-src_textures_textures.c
new file mode 100644
index 0000000000..49409d4095
--- /dev/null
+++ b/wadgadget/patches/patch-src_textures_textures.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Prevent undefined behaviour of toupper().
+
+--- src/textures/textures.c.orig	2025-12-09 03:51:38.000000000 +0000
++++ src/textures/textures.c
+@@ -259,7 +259,7 @@ static void SetTextureName(struct textur
+ 	int i;
+ 
+ 	for (i = 0; i < 8; i++) {
+-		namedest[i] = toupper(name[i]);
++		namedest[i] = toupper((unsigned char) name[i]);
+ 		if (namedest[i] == '\0') {
+ 			break;
+ 		}


Home | Main Index | Thread Index | Old Index