pkgsrc-WIP-changes archive

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

doomlegacy: Cleanup



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <michael.baeuerle%stz-e.de@localhost>
Pushed By:	micha
Date:		Fri Jun 14 12:27:38 2019 +0200
Changeset:	4ab7ce68e8759d7ff5246ff83385996ad11561a4

Modified Files:
	doomlegacy/DESCR
	doomlegacy/MESSAGE.doomlegacy
	doomlegacy/Makefile
	doomlegacy/distinfo
	doomlegacy/patches/patch-Makefile
	doomlegacy/patches/patch-src_Makefile
Added Files:
	doomlegacy/README
	doomlegacy/TODO
	doomlegacy/patches/patch-src_d__main.c

Log Message:
doomlegacy: Cleanup

- Disable launcher for shareware episode
- Added README/TODO files

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

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

diffstat:
 doomlegacy/DESCR                       | 14 ++++++-------
 doomlegacy/MESSAGE.doomlegacy          |  2 +-
 doomlegacy/Makefile                    | 17 ++++++++++++----
 doomlegacy/README                      | 15 ++++++++++++++
 doomlegacy/TODO                        | 36 ++++++++++++++++++++++++++++++++++
 doomlegacy/distinfo                    |  5 +++--
 doomlegacy/patches/patch-Makefile      |  2 +-
 doomlegacy/patches/patch-src_Makefile  | 26 ++++++++++++++++++++----
 doomlegacy/patches/patch-src_d__main.c | 22 +++++++++++++++++++++
 9 files changed, 120 insertions(+), 19 deletions(-)

diffs:
diff --git a/doomlegacy/DESCR b/doomlegacy/DESCR
index ea813f3f13..9e4b7d28e8 100644
--- a/doomlegacy/DESCR
+++ b/doomlegacy/DESCR
@@ -1,6 +1,10 @@
 This is one of the most popular Doom source ports.
-It enhances Doom with things like Free Look, OpenGL renderer, Heretic support,
-TCP/IP networking and much more.
+It enhances Doom with things like:
+- Free Look
+- OpenGL renderer
+- Heretic support,
+- TCP/IP networking
+and much more.
 
 Doom Legacy can play Doom, Boom, Marine's Best Friend (MBF), and Heretic maps.
 In addition to the original games by id Software and Raven Software, there are
@@ -16,8 +20,4 @@ and the Marine's Best Friend (MBF) extensions. Legacy also has implemented
 among other things 3D floors, swimmable water and other special effects using
 extended linedef codes, and supports the FraggleScript scripting language.
 
-Note:
-This engine can be used to play the SIGIL Megawad (Doom Episode 5).
-Use SIGIL_COMPAT.wad together with doom.wad as IWAD like this:
-
-   $ doomlegacy -iwad /tmp/doom.wad -file /tmp/SIGIL_COMPAT.wad
+This package contains the SDL build of Doom Legacy.
diff --git a/doomlegacy/MESSAGE.doomlegacy b/doomlegacy/MESSAGE.doomlegacy
index 665e264622..c933680588 100644
--- a/doomlegacy/MESSAGE.doomlegacy
+++ b/doomlegacy/MESSAGE.doomlegacy
@@ -1,7 +1,7 @@
 ===========================================================================
 $NetBSD$
 
-Note: The location of the ${PKGNAME} WAD directory has been set to
+Note: The location of the ${PKGNAME} WAD directory has been set to:
 
 	${DOOMWADDIR_CONF}
 
diff --git a/doomlegacy/Makefile b/doomlegacy/Makefile
index cbb5bcc152..8183d5a746 100644
--- a/doomlegacy/Makefile
+++ b/doomlegacy/Makefile
@@ -13,8 +13,8 @@ HOMEPAGE=		http://doomlegacy.sourceforge.net/
 COMMENT=		The legacy of Doom
 LICENSE=		gnu-gpl-v2
 
-# Tested to work on Linux/ppc (Big Endian) and NetBSD/amd64 (Little Endian)
-# Source has support for the other listed OS too (may need additional work)
+# Tested on Linux/ppc (32bit Big Endian) and NetBSD/amd64 (64bit Little Endian)
+# Untested: In general the source code has support for the other listed OS too
 ONLY_FOR_PLATFORM=	Darwin-*-* DragonFly-*-* FreeBSD-*-* Linux-*-* \
 			NetBSD-*-* OpenBSD-*-* SunOS-*-*
 
@@ -37,18 +37,27 @@ MAKE_FLAGS+=		OS=LINUX
 MAKE_FLAGS+=		HAVE_MIXER=1 DEBUG=0
 
 .if ${MACHINE_ENDIAN} == "big"
+# Some compilers define this themselves (but maybe not all)
 CFLAGS+=		-D__BIG_ENDIAN__
 .endif
-CFLAGS+=		-Wno-char-subscripts
+CFLAGS+=		-Wno-char-subscripts -Wno-unused-result
 
 # DOOMWADDIR is intentionally shared with other Doom packages
-DOOMWADDIR?=		share/doom
+DOOMWADDIR=		share/doom
 INSTALLATION_DIRS=	bin share/doc/doomlegacy ${DOOMWADDIR}
 
 MESSAGE_SRC+=		MESSAGE.doomlegacy
 MESSAGE_SUBST+=		PKGNAME=${PKGNAME:C/-.*//}
 MESSAGE_SUBST+=		DOOMWADDIR_CONF="${PREFIX}/${DOOMWADDIR}"
 
+# Set LEGACYWADDIR to DOOMWADDIR
+SUBST_CLASSES+=		doomdef
+SUBST_STAGE.doomdef=	pre-configure
+SUBST_MESSAGE.doomdef=	Preparing doomdef.h file ...
+SUBST_FILES.doomdef=	src/doomdef.h
+SUBST_SED.doomdef=	-e 's,LEGACYWADDIR  "/usr/local/share/games/doomlegacy",LEGACYWADDIR  "${PREFIX}/${DOOMWADDIR}",g'
+SUBST_SED.doomdef+=	-e 's,DEFWADS01  "~/games/doomlegacy/wads",DEFWADS01  "${PREFIX}/${DOOMWADDIR}",'
+
 do-install:
 	cd ${WRKSRC} &&							\
 		${INSTALL_PROGRAM} bin/doomlegacy			\
diff --git a/doomlegacy/README b/doomlegacy/README
new file mode 100644
index 0000000000..09c08d2ec3
--- /dev/null
+++ b/doomlegacy/README
@@ -0,0 +1,15 @@
+A dependency to games/doom1 makes the Doom Shareware Episode 1 "Knee-Deep in the
+Dead" (doom1.wad) directly playable.
+Note: The demos from games/doom1 are not compatible with the Legacy engine.
+
+
+$ doomlegacy
+$ doomlegacy -iwad doom.wad
+$ doomlegacy -game doomu -iwad doom.wad -file doomu.wad
+$ doomlegacy -iwad doom.wad -file SIGIL_COMPAT.wad
+
+$ doomlegacy -iwad doom2.wad
+$ doomlegacy -iwad tnt.wad
+$ doomlegacy -iwad plutonia.wad
+
+$ doomlegacy -iwad heretic.wad
diff --git a/doomlegacy/TODO b/doomlegacy/TODO
new file mode 100644
index 0000000000..bf79b3dbd7
--- /dev/null
+++ b/doomlegacy/TODO
@@ -0,0 +1,36 @@
+[X] Patch to support NetBSD
+    FreeBSD codepath does not work for NetBSD
+    => Use statvfs()
+[X] Disable parallel make jobs
+    Build system seems to not support that
+[X] Check that Big Endian platforms work too
+    Seems to work out-of-the-box with GCC
+    => Nevertheless ensure that __BIG_ENDIAN__ is always defined if required
+[X] Test on GNU/Linux
+[X] Configure for pkgsrc DOOMWADDIR: ${PREFIX}/share/doom
+    Add Message for DOOMWADDIR location
+    => Set LEGACYWADDIR to DOOMWADDIR and install legacy.wad there
+[X] Add dependency for games/doom1
+    This provides DOOMWADDIR/doom1.wad
+    This allows to directly play Doom Episode 1 (Knee-Deep in the Dead)
+[X] Honor CFLAGS/LDFLAGS/LIBS
+[X] Check MKPIE/RELRO/USE_STACK_CHECK hardening flags on NetBSD/amd64
+[X] Check for reproducible build (PKGSRC_MKREPRO)
+[ ] Check build with clang
+    Dependency generation fails
+[ ] Analyze why MIDI music doesn't work
+[X] Check OpenGL renderer
+    Looks nice
+[ ] Send NetBSD patches to upstream
+[X] Check Doom Episode 2 (The Shores of Hell)
+[X] Check Doom Episode 3 (Inferno)
+[X] Check Ultimate Doom Episode 4 (Thy Flesh Consumed)
+[X] Check Romero's 25th anniversary Episode 5 (Sigil)
+    SIGIL_COMPAT.wad works with doom.wad as IWAD
+[X] Check Doom II (Hell on Earth)
+[X] Check Final Doom Part 1 (TNT: Evilution)
+[X] Check Final Doom Part 2 (The Plutonia Experiment)
+[X] Check Heretic
+
+
+EOF
diff --git a/doomlegacy/distinfo b/doomlegacy/distinfo
index c44c71763a..7951263d13 100644
--- a/doomlegacy/distinfo
+++ b/doomlegacy/distinfo
@@ -8,8 +8,9 @@ SHA1 (doomlegacy_1.47.2_source.tar.bz2) = afb1213eb8b228d9f131e4c63ead97afed2f59
 RMD160 (doomlegacy_1.47.2_source.tar.bz2) = 661f0fa2bdc58a2f5f9582f36817ddd9d48df9bc
 SHA512 (doomlegacy_1.47.2_source.tar.bz2) = e2e182c18dd24c14e954f791c58e44119457bb74af4bb079c16219406176536f9fd414afd6c9fa0e956a6062b5a346bbf19ebf4c0d2d300e2e66b2eb01cf53fd
 Size (doomlegacy_1.47.2_source.tar.bz2) = 2276199 bytes
-SHA1 (patch-Makefile) = a1aea57169fc1325182dcc2afeeaa953353f2823
-SHA1 (patch-src_Makefile) = 37375b1728cd13ec55ce48b333e6817d0d974c88
+SHA1 (patch-Makefile) = 03fc2f70c4a91ab6e7e3611f594eeaee4ac78b6b
+SHA1 (patch-src_Makefile) = 1604ba5ede46c8e19db10c094155d0413652f420
+SHA1 (patch-src_d__main.c) = 89188e534d486d9cfbf2ad92f63b4eb7ab6c50f8
 SHA1 (patch-src_doomtype.h) = fefe08ca5fbe8d11325e32ca833a73d3acb36ea1
 SHA1 (patch-src_i__tcp.c) = 1c0c6017d24640217e29ed238e210850329d0e75
 SHA1 (patch-src_sdl_i__system.c) = 17524680559b81ae755d781f63f3c5d34e1f14b6
diff --git a/doomlegacy/patches/patch-Makefile b/doomlegacy/patches/patch-Makefile
index eaf5471185..d4fb954084 100644
--- a/doomlegacy/patches/patch-Makefile
+++ b/doomlegacy/patches/patch-Makefile
@@ -21,7 +21,7 @@ Add NetBSD to OS list.
 +  # Uses statvfs(5).
 +  $(info  NetBSD support is dependent upon user reports.)
 +  $(info  Please submit bug reports, and bug fixes. )
-+  FREEBSD=1
++  NETBSD=1
 +else
  ifeq ($(OS), WIN32)
    $(info  Generic Windows compile.  May or may-not work on modern Windows.)
diff --git a/doomlegacy/patches/patch-src_Makefile b/doomlegacy/patches/patch-src_Makefile
index 34d8a4917f..e1e5d065ef 100644
--- a/doomlegacy/patches/patch-src_Makefile
+++ b/doomlegacy/patches/patch-src_Makefile
@@ -13,8 +13,8 @@ Honor environment variables CFLAGS, LDFLAGS and LIBS
 +OS_LIST:=LINUX FREEBSD NETBSD WIN32 WIN7 WIN98 OS2 DOS MAC
  
 -OPTS:=
-+# Do not reset OPTS (take CFLAGS value from environment as base)
-+OPTS=$(CFLAGS)
++# Do not reset OPTS (init to CFLAGS from environment)
++OPTS:=$(CFLAGS)
  
  ifeq ($(OS), LINUX)
    LINUX=1
@@ -85,9 +85,9 @@ Honor environment variables CFLAGS, LDFLAGS and LIBS
  OPTINC:=
 -LIBS:=
 -LDFLAGS:=
-+# Do not reset LIBS (take value from environment as base)
++# Do not reset LIBS
 +#LIBS:=
-+# Do not reset LDFLAGS (take value from environment as base)
++# Do not reset LDFLAGS
 +#LDFLAGS:=
  INSTALL_SUPPL:=
  
@@ -95,3 +95,21 @@ Honor environment variables CFLAGS, LDFLAGS and LIBS
  CFLAGS:=
  # Machine architecture.
  ifdef ARCH
+@@ -597,14 +610,14 @@ ifeq ($(SMIF), SDL)
+     ifndef MAC
+       # default is Linux, for all unix SDL
+       EXENAME:=doomlegacy
+-      LDFLAGS=-L/usr/X11R6/lib
+-      LIBS:=-lGL -lGLU -lm
++      LDFLAGS +=-L/usr/X11R6/lib
++      LIBS +=-lGL -lGLU -lm
+       # -L/usr/X11R6/lib is needed by Linux 2.4 and others that still have
+       # the GLU libraries in an X11 directory.
+       # -lm is needed for pow, powf, and other MATH1 functions.
+     else
+       EXENAME:=doomlegacy
+-      LDFLAGS=-framework OpenGL
++      LDFLAGS +=-framework OpenGL
+     endif
+ 
+     SDL_CONFIG:=1
diff --git a/doomlegacy/patches/patch-src_d__main.c b/doomlegacy/patches/patch-src_d__main.c
new file mode 100644
index 0000000000..184f6d0837
--- /dev/null
+++ b/doomlegacy/patches/patch-src_d__main.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Without command line arguments the launcher menu is displayed by default.
+This is not desired because we have already prepared the shareware Episode 1
+for pkgsrc.
+
+--- src/d_main.c.orig	2018-07-25 10:14:34.000000000 +0000
++++ src/d_main.c
+@@ -2507,9 +2507,10 @@ restart_command:
+    
+     EOUT_flags = EOUT_text | EOUT_log | EOUT_con;
+ 
+-
+-#ifdef LAUNCHER   
+-    if ( fatal_error || init_sequence == 1 || (init_sequence == 0 && myargc < 2 ))
++#ifdef LAUNCHER
++    // Disable argc check for pkgsrc (shareware episode already prepared)
++    // if ( fatal_error || init_sequence == 1 || (init_sequence == 0 && myargc < 2 ))
++    if ( fatal_error || init_sequence == 1 )
+     {
+         // [WDJ] Invoke built-in launcher command line
+ #if 0


Home | Main Index | Thread Index | Old Index