pkgsrc-WIP-changes archive

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

qzdoom: Patch some things, still does not work



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <micha%NetBSD.org@localhost>
Pushed By:	micha
Date:		Mon Oct 19 17:29:35 2020 +0200
Changeset:	2f05fd8d14577280f59d4f46dd0b5ca087dc54bf

Modified Files:
	qzdoom/Makefile
	qzdoom/PLIST
	qzdoom/TODO
	qzdoom/distinfo
	qzdoom/files/INSTALL.pkgsrc
	qzdoom/patches/patch-CMakeLists.txt
Added Files:
	qzdoom/patches/patch-src_gameconfigfile.cpp
	qzdoom/patches/patch-src_version.h

Log Message:
qzdoom: Patch some things, still does not work

Segmentation fault when a map is loaded.

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

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

diffstat:
 qzdoom/Makefile                             | 27 ++++++++++++++++++++++
 qzdoom/PLIST                                | 17 ++++++++++++++
 qzdoom/TODO                                 |  6 +++++
 qzdoom/distinfo                             |  4 +++-
 qzdoom/files/INSTALL.pkgsrc                 |  2 +-
 qzdoom/patches/patch-CMakeLists.txt         | 13 ++++++++++-
 qzdoom/patches/patch-src_gameconfigfile.cpp | 35 +++++++++++++++++++++++++++++
 qzdoom/patches/patch-src_version.h          | 19 ++++++++++++++++
 8 files changed, 120 insertions(+), 3 deletions(-)

diffs:
diff --git a/qzdoom/Makefile b/qzdoom/Makefile
index 79010114fa..88f480150e 100644
--- a/qzdoom/Makefile
+++ b/qzdoom/Makefile
@@ -17,7 +17,34 @@ USE_TOOLS+=	pkg-config
 USE_CMAKE=	yes
 WRKSRC=		${WRKDIR}/${DISTNAME:S/-/-g/}
 
+# DOOMWADDIR is intentionally shared with other Doom packages
+DOOMWADDIR=		share/doom
+INSTALLATION_DIRS+=	share/doc/qzdoom
+
+# Add DOOMWADDIR to search path
+SUBST_CLASSES+=		waddir
+SUBST_STAGE.waddir=	pre-configure
+SUBST_MESSAGE.waddir=	Preparing gameconfigfile.cpp file ...
+SUBST_FILES.waddir=	src/gameconfigfile.cpp
+SUBST_SED.waddir=	-e 's,PKGSRC_PREFIX,${PREFIX},'
+SUBST_SED.waddir+=	-e 's,PKGSRC_DOOMWADDIR,${DOOMWADDIR},'
+
+pre-configure:
+	${CP} ${FILESDIR}/INSTALL.pkgsrc ${WRKDIR}
+
+# Keep the gzdoom namespace clean (for a potential future package of gzdoom)
+# - Rename binary to qzdoom
+# - Rename documentation directory to qzdoom
+post-install:
+	${INSTALL_DATA} ${WRKDIR}/INSTALL.pkgsrc \
+		${DESTDIR}${PREFIX}/share/doc/qzdoom/INSTALL.pkgsrc
+	${MV} ${DESTDIR}${PREFIX}/bin/gzdoom ${DESTDIR}${PREFIX}/bin/qzdoom
+	${MV} ${DESTDIR}${PREFIX}/share/doc/gzdoom/* \
+		${DESTDIR}${PREFIX}/share/doc/qzdoom
+
 .include "../../archivers/bzip2/buildlink3.mk"
+BUILDLINK_API_DEPENDS.fluidsynth+=	fluidsynth>=2.1.4nb1
+.include "../../audio/fluidsynth/buildlink3.mk"
 .include "../../devel/SDL2/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/jpeg.buildlink3.mk"
diff --git a/qzdoom/PLIST b/qzdoom/PLIST
index 3923944c07..2666e9890a 100644
--- a/qzdoom/PLIST
+++ b/qzdoom/PLIST
@@ -1,2 +1,19 @@
 @comment $NetBSD$
 bin/qzdoom
+share/doc/qzdoom/INSTALL.pkgsrc
+share/doc/qzdoom/console.css
+share/doc/qzdoom/console.html
+share/doc/qzdoom/licenses/README.TXT
+share/doc/qzdoom/licenses/bsd.txt
+share/doc/qzdoom/licenses/bzip2.txt
+share/doc/qzdoom/licenses/dumb.txt
+share/doc/qzdoom/licenses/fxaa.txt
+share/doc/qzdoom/licenses/gdtoa.txt
+share/doc/qzdoom/licenses/gpl.txt
+share/doc/qzdoom/licenses/lgpl.txt
+share/doc/qzdoom/rh-log.txt
+share/doc/qzdoom/skins.txt
+share/doom/qzdoom/brightmaps.pk3
+share/doom/qzdoom/game_support.pk3
+share/doom/qzdoom/gzdoom.pk3
+share/doom/qzdoom/lights.pk3
diff --git a/qzdoom/TODO b/qzdoom/TODO
index 53a9b199b8..01daaa27a7 100644
--- a/qzdoom/TODO
+++ b/qzdoom/TODO
@@ -1 +1,7 @@
 [X] Package ZMusic dependency
+[ ] The patch for fts_set() is ugly
+[X] Add pkgsrc locations to search paths
+[X] Do not use GZDoom namespace
+[X] Add fluidsynth dependency (loaded at runtime)
+
+Crash with segmentation fault.
diff --git a/qzdoom/distinfo b/qzdoom/distinfo
index cb4c450d88..228120b98a 100644
--- a/qzdoom/distinfo
+++ b/qzdoom/distinfo
@@ -4,4 +4,6 @@ SHA1 (qzdoom-4.4.2.tar.gz) = 167618be5c2f2fb59fc14139492194a2341e431b
 RMD160 (qzdoom-4.4.2.tar.gz) = 15e4d3982b12732bdd1ba81810803b2ad4327dfa
 SHA512 (qzdoom-4.4.2.tar.gz) = 552b612a84db4dbb181406f633a2d8102f0b23e75fed1ac240ba05ae2953a5bca7c460ffeb52b6d1408171fad74b26260ec4d64745300b6186bbb546bac20fc4
 Size (qzdoom-4.4.2.tar.gz) = 12613887 bytes
-SHA1 (patch-CMakeLists.txt) = f76aeda76718398f10872ecbe1f6f3175111be6b
+SHA1 (patch-CMakeLists.txt) = 21e52cd278aab5a5c3278696e2c8803f5fa8574d
+SHA1 (patch-src_gameconfigfile.cpp) = 5c88ddafbc2f19dd9d9de56e6537b67e96a16c35
+SHA1 (patch-src_version.h) = b6082d7c84651ffe84c1fe69ef9056f46831b85d
diff --git a/qzdoom/files/INSTALL.pkgsrc b/qzdoom/files/INSTALL.pkgsrc
index d077a196a0..48a4d3b0df 100644
--- a/qzdoom/files/INSTALL.pkgsrc
+++ b/qzdoom/files/INSTALL.pkgsrc
@@ -1,4 +1,4 @@
-The location of the crispy-doom WAD directory has been set to:
+The location of the qzdoom WAD directory has been set to:
 
    DOOMWADDIR
 
diff --git a/qzdoom/patches/patch-CMakeLists.txt b/qzdoom/patches/patch-CMakeLists.txt
index 4cbdc816d7..a02e1fd46b 100644
--- a/qzdoom/patches/patch-CMakeLists.txt
+++ b/qzdoom/patches/patch-CMakeLists.txt
@@ -1,10 +1,21 @@
 $NetBSD$
 
-fts_set is not detected because NetBSD has renamed the symbol.
+Install game data to ${PREFIX}/share/doom/qzdoom
+
+fts_set() is not detected because NetBSD has renamed the symbol.
 Remove the check and assume it is available.
 
 --- CMakeLists.txt.orig	2020-06-16 17:19:13.000000000 +0000
 +++ CMakeLists.txt
+@@ -93,7 +93,7 @@ function( add_pk3 PK3_NAME PK3_DIR )
+ 	if( WIN32 )
+ 		set( INSTALL_PK3_PATH . CACHE STRING "Directory where zdoom.pk3 will be placed during install." )
+ 	else()
+-		set( INSTALL_PK3_PATH share/games/doom CACHE STRING "Directory where zdoom.pk3 will be placed during install." )
++		set( INSTALL_PK3_PATH share/doom/qzdoom CACHE STRING "Directory where zdoom.pk3 will be placed during install." )
+ 	endif()
+ 	install(FILES "${PROJECT_BINARY_DIR}/${PK3_NAME}"
+ 			DESTINATION ${INSTALL_PK3_PATH}
 @@ -247,19 +247,19 @@ else()
  		set( ALL_C_FLAGS "-ffp-contract=off -DHAVE_SOFTPOLY" )
  	endif()
diff --git a/qzdoom/patches/patch-src_gameconfigfile.cpp b/qzdoom/patches/patch-src_gameconfigfile.cpp
new file mode 100644
index 0000000000..d033800087
--- /dev/null
+++ b/qzdoom/patches/patch-src_gameconfigfile.cpp
@@ -0,0 +1,35 @@
+$NetBSD$
+
+Add pkgsrc paths to WAD/game/soundfont file search paths.
+
+--- src/gameconfigfile.cpp.orig	2020-06-16 17:19:13.000000000 +0000
++++ src/gameconfigfile.cpp
+@@ -96,6 +96,9 @@ FGameConfigFile::FGameConfigFile ()
+ 		SetSection ("IWADSearch.Directories", true);
+ 		SetValueForKey ("Path", ".", true);
+ 		SetValueForKey ("Path", "$DOOMWADDIR", true);
++		// For pkgsrc
++		SetValueForKey ("Path", "PKGSRC_PREFIX/PKGSRC_DOOMWADDIR/qzdoom", true);
++		SetValueForKey ("Path", "PKGSRC_PREFIX/PKGSRC_DOOMWADDIR", true);
+ #ifdef __APPLE__
+ 		SetValueForKey ("Path", user_docs, true);
+ 		SetValueForKey ("Path", user_app_support, true);
+@@ -120,6 +123,9 @@ FGameConfigFile::FGameConfigFile ()
+ 	if (!SetSection ("FileSearch.Directories"))
+ 	{
+ 		SetSection ("FileSearch.Directories", true);
++		// For pkgsrc
++		SetValueForKey ("Path", "PKGSRC_PREFIX/PKGSRC_DOOMWADDIR/qzdoom", true);
++		SetValueForKey ("Path", "PKGSRC_PREFIX/PKGSRC_DOOMWADDIR", true);
+ #ifdef __APPLE__
+ 		SetValueForKey ("Path", user_docs, true);
+ 		SetValueForKey ("Path", user_app_support, true);
+@@ -142,6 +148,8 @@ FGameConfigFile::FGameConfigFile ()
+ 	if (!SetSection("SoundfontSearch.Directories"))
+ 	{
+ 		SetSection("SoundfontSearch.Directories", true);
++		// For pkgsrc
++		SetValueForKey("Path", "PKGSRC_PREFIX/PKGSRC_DOOMWADDIR/soundfonts", true);
+ #ifdef __APPLE__
+ 		SetValueForKey("Path", user_docs + "/soundfonts", true);
+ 		SetValueForKey("Path", user_docs + "/fm_banks", true);
diff --git a/qzdoom/patches/patch-src_version.h b/qzdoom/patches/patch-src_version.h
new file mode 100644
index 0000000000..242e81e95f
--- /dev/null
+++ b/qzdoom/patches/patch-src_version.h
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Set QZDoom for game name.
+
+--- src/version.h.orig	2020-06-16 17:19:13.000000000 +0000
++++ src/version.h
+@@ -98,9 +98,9 @@ const char *GetVersionString();
+ #define VR3D_ENABLED
+ 
+ // More stuff that needs to be different for derivatives.
+-#define GAMENAME "GZDoom"
+-#define WGAMENAME L"GZDoom"
+-#define GAMENAMELOWERCASE "gzdoom"
++#define GAMENAME "QZDoom"
++#define WGAMENAME L"QZDoom"
++#define GAMENAMELOWERCASE "qzdoom"
+ #define FORUM_URL "http://forum.zdoom.org/";
+ #define BUGS_FORUM_URL	"http://forum.zdoom.org/viewforum.php?f=2";
+ 


Home | Main Index | Thread Index | Old Index