pkgsrc-WIP-changes archive

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

xu4: Update to 1.4.2 (wip)



Module Name:	pkgsrc-wip
Committed By:	Frédéric Fauberteau <triaxx%NetBSD.org@localhost>
Pushed By:	frederic
Date:		Wed Feb 12 07:07:47 2025 +0100
Changeset:	52c838c32d76dac77425c3381bf3048f4f928296

Modified Files:
	Makefile
Added Files:
	xu4/COMMIT_MSG
	xu4/DESCR
	xu4/MESSAGE
	xu4/Makefile
	xu4/PLIST
	xu4/commit.msg
	xu4/distinfo
	xu4/patches/patch-Makefile
	xu4/patches/patch-src_Makefile.common
	xu4/patches/patch-src_screen__sdl.cpp
	xu4/patches/patch-src_support_cdi.c
	xu4/patches/patch-src_support_irecord.c

Log Message:
xu4: Update to 1.4.2 (wip)

Current attempts:
* SDL backend seems to be unmaintained upstream.
* devel/allegro5 seems to be broken on NetBSD.
* wip/glfw seems to be broken on NetBSD.

TODO:
* Try package glv as a "last change" backend or
  try to fix another SDL, allegro5 or glfw
* Package games/ultima-data

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

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

diffstat:
 Makefile                                |  1 +
 xu4/COMMIT_MSG                          |  3 ++
 xu4/DESCR                               | 14 +++++++
 xu4/MESSAGE                             |  8 ++++
 xu4/Makefile                            | 65 +++++++++++++++++++++++++++++++++
 xu4/PLIST                               |  9 +++++
 xu4/commit.msg                          | 11 ++++++
 xu4/distinfo                            | 13 +++++++
 xu4/patches/patch-Makefile              | 36 ++++++++++++++++++
 xu4/patches/patch-src_Makefile.common   | 17 +++++++++
 xu4/patches/patch-src_screen__sdl.cpp   | 15 ++++++++
 xu4/patches/patch-src_support_cdi.c     | 18 +++++++++
 xu4/patches/patch-src_support_irecord.c | 17 +++++++++
 13 files changed, 227 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 56d0f593f4..48fcf97e18 100644
--- a/Makefile
+++ b/Makefile
@@ -6081,6 +6081,7 @@ SUBDIR+=	xtraceroute
 SUBDIR+=	xtreemfs-client
 SUBDIR+=	xtreemfs-server
 SUBDIR+=	xtrkcad
+SUBDIR+=	xu4
 SUBDIR+=	xwallpaper
 SUBDIR+=	xwax
 SUBDIR+=	xwelltris
diff --git a/xu4/COMMIT_MSG b/xu4/COMMIT_MSG
new file mode 100644
index 0000000000..03f8f33050
--- /dev/null
+++ b/xu4/COMMIT_MSG
@@ -0,0 +1,3 @@
+games/xu4: Update to 1.4.2
+
+Packaged in wip by Frédéric Fauberteau
diff --git a/xu4/DESCR b/xu4/DESCR
new file mode 100644
index 0000000000..72ed3a8a5f
--- /dev/null
+++ b/xu4/DESCR
@@ -0,0 +1,14 @@
+XU4 is a remake of the computer game Ultima IV.  The goal is to make
+it easy and convenient to play this classic on modern operating
+systems.  XU4 is primarily inspired by the much more ambitious project
+Exult.
+
+XU4 isn't a new game based on the Ultima IV story -- it is a faithful
+recreation of the old game, right up to the crappy graphics.  If you
+are looking for a game with modern gameplay and graphics, this is not
+it -- yet.  New features that improve the gameplay and keep with the
+spirit of the original game will be added.
+
+XU4 also tries to maintain strict compatibility with the original for
+its savegame files.  You can use a game saved in XU4 with the original
+and vice versa, at least in theory.
diff --git a/xu4/MESSAGE b/xu4/MESSAGE
new file mode 100644
index 0000000000..b2b27e8561
--- /dev/null
+++ b/xu4/MESSAGE
@@ -0,0 +1,8 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2012/01/08 15:52:12 wiz Exp $
+
+xu4 needs the original Ultima IV data files.
+The package ultima4-data provides them, but is not a dependency
+due to licensing reasons.
+
+===========================================================================
diff --git a/xu4/Makefile b/xu4/Makefile
new file mode 100644
index 0000000000..45ec0d357e
--- /dev/null
+++ b/xu4/Makefile
@@ -0,0 +1,65 @@
+# $NetBSD: Makefile,v 1.20 2025/01/06 21:49:19 ktnb Exp $
+
+DISTNAME=	xu4-1.4.2
+CATEGORIES=	games
+MASTER_SITES=	${MASTER_SITE_GITHUB:=xu4-engine/}
+GITHUB_PROJECT=	u4
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+DISTFILES=	${DEFAULT_DISTFILES}
+DISTFILES+=	u4upgrad.zip
+EXTRACT_ONLY=	${DEFAULT_DISTFILES}
+
+SITES.u4upgrad.zip= \
+	-http://sourceforge.net/projects/xu4/files/Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip
+
+#GLV_GITHASH=	20ab75d39ae1ab27c55f1eea09c83b3985738110
+#
+#DISTFILES=	${DEFAULT_DISTFILES}
+#DISTFILES+=	outguard-glv-${GLV_GITHASH}.zip
+#
+#SITES.outguard-glv-${GLV_GITHASH}.zip= \
+#	-https://sourceforge.net/code-snapshots/git/o/ou/outguard/glv.git/outguard-glv-${GLV_GITHASH}.zip
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://xu4.sourceforge.net/
+COMMENT=	Remake of Ultima IV
+LICENSE=	gnu-gpl-v3
+
+DEPENDS+=	timidity-[0-9]*:../../audio/timidity
+
+HAS_CONFIGURE=	yes
+USE_LANGUAGES=	c c++
+USE_TOOLS+=	bash:run gmake
+
+REPLACE_BASH=	configure
+CONFIG_SHELL=	${BASH}
+
+CONFIGURE_ARGS+=	--glfw
+
+INSTALLATION_DIRS+=	share/applications share/doc/xu4 
+INSTALLATION_DIRS+=	share/icons/hicolor/48x48/apps
+
+BORON=	${PREFIX}/bin/boron
+
+SUBST_CLASSES+=		paths
+SUBST_MESSAGE.paths=	Fixing paths of binaries
+SUBST_STAGE.paths=	pre-configure
+SUBST_FILES.paths=	Makefile
+SUBST_VARS.paths=	BORON
+
+post-extract:
+	${RUN}${CP} ${DISTDIR}/u4upgrad.zip ${WRKSRC}
+#	${RUN}${CP} -r ${WRKDIR}/outguard-glv-${GLV_GITHASH}/* ${WRKSRC}/src/glv
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/README.md ${DESTDIR}${PREFIX}/share/doc/xu4
+
+.include "../../wip/faun/buildlink3.mk"
+.include "../../wip/boron/buildlink3.mk"
+.include "../../graphics/glfw/buildlink3.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/xu4/PLIST b/xu4/PLIST
new file mode 100644
index 0000000000..191f85a7d0
--- /dev/null
+++ b/xu4/PLIST
@@ -0,0 +1,9 @@
+@comment $NetBSD$
+bin/xu4
+share/applications/xu4.desktop
+share/doc/xu4/README.md
+share/icons/hicolor/48x48/apps/xu4.png
+share/xu4/U4-Upgrade.mod
+share/xu4/Ultima-IV.mod
+share/xu4/render.pak
+share/xu4/u4upgrad.zip
diff --git a/xu4/commit.msg b/xu4/commit.msg
new file mode 100644
index 0000000000..4514908176
--- /dev/null
+++ b/xu4/commit.msg
@@ -0,0 +1,11 @@
+xu4: Update to 1.4.2 (wip)
+
+Current attempts:
+* SDL backend seems to be unmaintained upstream.
+* devel/allegro5 seems to be broken on NetBSD.
+* wip/glfw seems to be broken on NetBSD.
+
+TODO:
+* Try package glv as a "last change" backend or
+  try to fix another SDL, allegro5 or glfw
+* Package games/ultima-data
diff --git a/xu4/distinfo b/xu4/distinfo
new file mode 100644
index 0000000000..e73168a951
--- /dev/null
+++ b/xu4/distinfo
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.9 2024/02/01 09:33:08 wiz Exp $
+
+BLAKE2s (u4upgrad.zip) = fdef92af2342fec7f2636049979d757ee3b866452bfaabd5a31233b09882fdf9
+SHA512 (u4upgrad.zip) = 4832d8cfd266d3ccc5eab5184bd2b6b9acd4c0203478873fb5e11704d95104dd9285a7752bad77f873d4f8603673184ae9421964509b948ec69944a4ceadd083
+Size (u4upgrad.zip) = 632072 bytes
+BLAKE2s (xu4-1.4.2.tar.gz) = 63d292668b8ba5aa38f0ad86912b14266c9923c6e41ce554dd5675130e50a214
+SHA512 (xu4-1.4.2.tar.gz) = d2ae3fdf47809d4238f986594f182326538d2bbfcd0bacade859a70b8ad91d7b387a3f3d4561361cc3cbd715cc4d54c73c01ad61dcdf10948e715e714e5147f0
+Size (xu4-1.4.2.tar.gz) = 8069084 bytes
+SHA1 (patch-Makefile) = 44c0a9c0e34dcd7d144bdeb1630046dce117a115
+SHA1 (patch-src_Makefile.common) = c44697504a018069b08af5372fe2e4771a58a3c6
+SHA1 (patch-src_screen__sdl.cpp) = 97540d293b9ce3a72b242e6b3afe0447b26a163a
+SHA1 (patch-src_support_cdi.c) = dd39751389d6a7766d24bb5f694ac5ce4eaaf174
+SHA1 (patch-src_support_irecord.c) = ac0b560551c2dcbaa501f4d60850b5feed9730a6
diff --git a/xu4/patches/patch-Makefile b/xu4/patches/patch-Makefile
new file mode 100644
index 0000000000..1d62b6d1b1
--- /dev/null
+++ b/xu4/patches/patch-Makefile
@@ -0,0 +1,36 @@
+$NetBSD$
+
+* Don't download third-party archives.
+* Don't use non-portable option of install.
+
+--- Makefile.orig	2025-01-04 21:38:58.000000000 +0000
++++ Makefile
+@@ -11,7 +11,7 @@ endif
+ DESTDIR ?= /usr/local
+ 
+ MODULES=render.pak Ultima-IV.mod U4-Upgrade.mod
+-BORON=boron
++BORON=@BORON@
+ REND=module/render
+ 
+ 
+@@ -45,12 +45,13 @@ ultima4.zip:
+ u4upgrad.zip:
+ 	curl -sSL -o $@ http://sourceforge.net/projects/xu4/files/Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip
+ 
+-install: src/xu4 $(MODULES) u4upgrad.zip
+-	mkdir -p $(DESTDIR)/bin $(DESTDIR)/share/xu4
+-	install -m 755 -s src/xu4 $(DESTDIR)/bin/xu4
+-	install -m 644 -t $(DESTDIR)/share/xu4 $(MODULES) u4upgrad.zip
+-	install -D -m 644 icons/shield.png $(DESTDIR)/share/icons/hicolor/48x48/apps/xu4.png
+-	install -D -m 644 dist/xu4.desktop $(DESTDIR)/share/applications/xu4.desktop
++install: src/xu4 $(MODULES)
++	$(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(PREFIX)/bin
++	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(PREFIX)/share/xu4
++	$(BSD_INSTALL_PROGRAM) src/xu4 $(DESTDIR)$(PREFIX)/bin/xu4
++	$(BSD_INSTALL_DATA) $(MODULES) u4upgrad.zip $(DESTDIR)$(PREFIX)/share/xu4
++	$(BSD_INSTALL_DATA) icons/shield.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/xu4.png
++	$(BSD_INSTALL_DATA) dist/xu4.desktop $(DESTDIR)$(PREFIX)/share/applications/xu4.desktop
+ 
+ snapshot: $(MODULES)
+ 	@rm -f project.tar.gz
diff --git a/xu4/patches/patch-src_Makefile.common b/xu4/patches/patch-src_Makefile.common
new file mode 100644
index 0000000000..9cf255c725
--- /dev/null
+++ b/xu4/patches/patch-src_Makefile.common
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Fix glfw backend.
+
+--- src/Makefile.common.orig	2025-02-11 22:49:17.575727072 +0000
++++ src/Makefile.common
+@@ -77,8 +77,10 @@ CXXSRCS=\
+ ifeq ($(UI),glv)
+ 	CSRCS+=$(GLV_SRC)
+ else
++ifneq ($(UI),glfw)
+ 	CXXSRCS+=event_$(UI).cpp
+ endif
++endif
+ 
+ #ifeq ($(CONF),boron)
+ 	CSRCS+=module.c support/cdi.c
diff --git a/xu4/patches/patch-src_screen__sdl.cpp b/xu4/patches/patch-src_screen__sdl.cpp
new file mode 100644
index 0000000000..ec18a99303
--- /dev/null
+++ b/xu4/patches/patch-src_screen__sdl.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Fix SDL backend.
+
+--- src/screen_sdl.cpp.orig	2025-01-04 21:38:58.000000000 +0000
++++ src/screen_sdl.cpp
+@@ -70,7 +70,7 @@ void screenInit_sys(const Settings* sett
+ 
+     {
+     char buf[MOD_NAME_LIMIT];
+-    SDL_WM_SetCaption(settings->gameTitle(buf), NULL);
++    SDL_WM_SetCaption(xu4.config->gameTitle(buf), NULL);
+     }
+ 
+     SDL_SetGamma(settings->gamma / 100.0f, settings->gamma / 100.0f, settings->gamma / 100.0f);
diff --git a/xu4/patches/patch-src_support_cdi.c b/xu4/patches/patch-src_support_cdi.c
new file mode 100644
index 0000000000..3a75b3a830
--- /dev/null
+++ b/xu4/patches/patch-src_support_cdi.c
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- src/support/cdi.c.orig	2025-01-04 21:38:58.000000000 +0000
++++ src/support/cdi.c
+@@ -20,6 +20,11 @@
+ #ifdef __MINGW32__
+ #define bswap_16(x) __builtin_bswap16(x)
+ #define bswap_32(x) __builtin_bswap32(x)
++#elif defined(__NetBSD__)
++#include <sys/types.h>
++#include <machine/bswap.h>
++#define bswap_16(x) bswap16(x)
++#define bswap_32(x) bswap32(x)
+ #else
+ #include <byteswap.h>
+ #endif
diff --git a/xu4/patches/patch-src_support_irecord.c b/xu4/patches/patch-src_support_irecord.c
new file mode 100644
index 0000000000..6bc58bcade
--- /dev/null
+++ b/xu4/patches/patch-src_support_irecord.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- src/support/irecord.c.orig	2025-01-04 21:38:58.000000000 +0000
++++ src/support/irecord.c
+@@ -31,6 +31,10 @@ void irec_init(InputRecorder* rec)
+ #define write   _write
+ #else
+ #include <unistd.h>
++#if defined(__NetBSD__)
++#include <sys/stat.h>
++#include <fcntl.h>
++#endif
+ #endif
+ 
+ #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__


Home | Main Index | Thread Index | Old Index