- Update to version 1.44_alpha4

- Do not use hand-written assembly code by default: upstream says they do
  not currently maintain it, and it does not contain many new improvements
  made to rendering, nor fog effects (ticket #604)
- Fix memory reporting in I_GetFreeMem() on amd64 (reported by Ilya Arkhipov)
- Enable key auto repeat in the menu/console (ticket #587)
- Assume maintainership while hacking on it more than I originally intended

Most of the patches were submitted upstream (tickets 587, 602-610).
This commit is contained in:
Alexey Dokuchaev 2013-05-17 01:02:37 +00:00
parent 3dda040aef
commit 9030e6d8e2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=318348
4 changed files with 82 additions and 31 deletions

View file

@ -2,16 +2,18 @@
# $FreeBSD$
PORTNAME= doomlegacy
DISTVERSION= 1.44_alpha3
DISTVERSION= 1.44_alpha4
PORTEPOCH= 1
CATEGORIES= games
MASTER_SITES= http://doomlegacy.sourceforge.net/releases/ \
http://freebsd.nsu.ru/distfiles/:wad
DISTNAME= ${PORTNAME}_${DISTVERSION}_src_r${SVN_REV}
# legacy.wad is not provided by upstream and must be regenerated manually
# when needed (its contents change); luckily, it doesn't happen too often
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} legacy_wad${EXTRACT_SUFX}:wad
DIST_SUBDIR= ${PORTNAME}
MAINTAINER= ports@FreeBSD.org
MAINTAINER= danfe@FreeBSD.org
COMMENT= Improved and extended version of Doom
LICENSE= GPLv2
@ -21,24 +23,22 @@ USE_GL= glu
USE_GMAKE= yes
USE_SDL= mixer sdl
MAKE_ENV= OLD_DEPENDENCIES=1 # since .dep file is removed
CFLAGS+= -DSVN_REV=\\\"${SVN_REV}\\\"
WRKSRC= ${WRKDIR}/${PORTNAME}_${DISTVERSION:S/.//}/src
WRKSRC= ${WRKDIR}/${PORTNAME}_${DISTVERSION}/src
PLIST_FILES= bin/${PORTNAME} share/doom/legacy.wad
PORTDOCS= *
SVN_REV= 845
SVN_REV= 999
OPTIONS_DEFINE= DOCS
OPTIONS_DEFINE_i386= ASM
OPTIONS_DEFAULT_i386= ASM
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MASM}
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
MAKE_ENV+= USEASM=1
MAKE_ENV= USEASM=1 OLD_DEPENDENCIES=1
.endif
post-patch: .SILENT
@ -50,14 +50,12 @@ post-patch: .SILENT
# Ensure that gathered memory stats are printed correctly
${REINPLACE_CMD} -e 's|total, free|(int)total, (int)free|' \
${WRKSRC}/z_zone.c
# Adjust config and save games directory name to be less ambiguous
${REINPLACE_CMD} -e 's|\.legacy|.${PORTNAME}|' ${WRKSRC}/doomdef.h
# Change default value of DOOMWADDIR; better support for relative paths
${REINPLACE_CMD} -e 's|\(doomwaddir = \)"\."|\1"${DMDIR}"| ; \
1306,1309d' -e "s|s\[0\] ==[^)]*|strchr(s, '/')|" \
# Make local directory name less ambiguous; adjust default WAD search path
${REINPLACE_CMD} -e 's|\.legacy|.${PORTNAME}| ; \
/DEFWADS1/s|/.*|${DMDIR}"|' ${WRKSRC}/doomdef.h
# Provide better support for relative paths (for `-iwad' switch)
${REINPLACE_CMD} -e "s|s\[0\] ==[^)]*|strchr(s, '/')|" \
${WRKSRC}/d_main.c
# Remove broken dependency file (wrong paths inside) and a copy of GPL
${RM} ${WRKSRC}/sdl.dep ; ${TOUCH} ${WRKSRC}/sdl.dep
${RM} ${WRKSRC}/_doc/LICENSE.txt
do-install:

View file

@ -1,4 +1,4 @@
SHA256 (doomlegacy/doomlegacy_1.44_alpha3_src_r845.zip) = d5ac03ceab68f586ce7282fab1975bbbdbd83b093dd3fa55a8e5317892f61436
SIZE (doomlegacy/doomlegacy_1.44_alpha3_src_r845.zip) = 2530660
SHA256 (doomlegacy/doomlegacy_1.44_alpha4_src_r999.zip) = 51a41099168a113e13bd0bcbe0da7ed2dde1e9f23ddd3c23f6bedd911a4f4824
SIZE (doomlegacy/doomlegacy_1.44_alpha4_src_r999.zip) = 2645943
SHA256 (doomlegacy/legacy_wad.zip) = dd805018a60d3e1b54da88ad6d082ae6bb9f790447a3f8d8b8f227b9ffa22240
SIZE (doomlegacy/legacy_wad.zip) = 338333

View file

@ -1,15 +1,15 @@
--- Makefile.orig
+++ Makefile
@@ -76,7 +76,7 @@
@@ -84,7 +84,7 @@
# std=c89, does not support // commments, no inline, no asm
# gcc or g++
-CC=gcc
+CC?=gcc
# End of User tunable settings
@@ -116,9 +116,9 @@
ifdef CC_WATCOM
CC=WATCOMC
endif
@@ -135,9 +135,9 @@
LIBS := -lopengl32 -lglu32 -lwsock32 -lm
else
# default is Linux, for all unix SDL
@ -21,8 +21,8 @@
# -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.
@@ -296,7 +296,7 @@
@@ -392,7 +392,7 @@
endif
# compiler and linker flags
-CFLAGS = $(WFLAGS)
@ -30,7 +30,7 @@
ifdef PROFILEMODE
# build with gprof profiling information
@@ -309,7 +309,7 @@
@@ -405,7 +405,7 @@
else
# build a normal optimized version
#CFLAGS += -O3
@ -39,3 +39,35 @@
endif
endif
@@ -583,7 +583,7 @@
# executable
$(BIN)/$(EXENAME): $(O) $(OBJS) $(MAINOBJ) versionstring
-# @mkdir $(BIN)
+ @mkdir -p $(BIN)
@echo Linking...
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(MAINOBJ) \
-o $(BIN)/$(EXENAME) $(LIBS)
@@ -651,7 +651,7 @@
../dep/main2.dep : i*.c m*.c p*.c
../dep/main3.dep : q*.c r*.c s*.c t*.c v*.c z*.c
# none: e*.c j*.c k*.c l*.c n*.c o*.c
-../dep/hardware.dep : hardware/*.c hardware/*/*.c
+../dep/hardware.dep : hardware/*.c hardware/r_opengl/*.c
# $(INTERFACE).dep : $(INTERFACE)/*.c
../dep/djgppdos.dep : djgppdos/*.c
../dep/linux_x.dep : linux_x/*.c linux_x/musserv/*.c linux_x/sndserv/*.c
@@ -673,11 +673,10 @@
../dep :
@mkdir ../dep;
-%.dep :
+%.dep : ../dep
@echo "Making dependencies $(@F)"
- if test ! -d ../dep; then mkdir ../dep; fi
$(CC) $(CFLAGS) -MM $^ > ../dep/$(@F)
- sed --separate -e "s@^[a-zA-Z0-9_]*.o:@\$$(O)/&@" ../dep/$(@F) > sed.dep
+ sed -e "s@^[a-zA-Z0-9_]*.o:@\$$(O)/&@" ../dep/$(@F) > sed.dep
mv sed.dep ../dep/$(@F)
endif

View file

@ -1,6 +1,6 @@
--- sdl/i_system.c.orig
+++ sdl/i_system.c
@@ -83,10 +83,7 @@
@@ -84,10 +84,7 @@
# include <sys/mount.h>
/*For meminfo*/
# include <sys/types.h>
@ -12,7 +12,16 @@
# endif
#endif
@@ -832,30 +829,16 @@ uint64_t I_GetFreeMem(uint64_t *total)
@@ -516,6 +513,8 @@ void I_SysInit()
// Enable unicode key conversion
SDL_EnableUNICODE(1);
+ // Enable key auto repeat
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
// Initialize the joystick subsystem.
I_JoystickInit();
@@ -906,33 +905,19 @@ uint64_t I_GetFreeMem(uint64_t *total)
// LINUX covers all the unix-type OS's.
#ifdef FREEBSD
@ -24,8 +33,8 @@
- { NULL }
- };
- if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
+ unsigned long page_count, free_count, pagesize;
+ size_t len = sizeof(unsigned long);
+ unsigned page_count, free_count, pagesize;
+ size_t len = sizeof(unsigned);
+ if (sysctlbyname("vm.stats.vm.v_page_count", &page_count, &len, NULL, 0))
goto guess;
-
@ -47,8 +56,20 @@
+ goto guess;
+ if (sysctlbyname("hw.pagesize", &pagesize, &len, NULL, 0))
+ goto guess;
+ *total = page_count * pagesize;
+ return free_count * pagesize;
+ *total = (uint64_t)page_count * pagesize;
+ return (uint64_t)free_count * pagesize;
#elif defined(SOLARIS)
goto guess;
#else
-#else
+#endif
// Actual Linux
#define MEMINFO_FILE "/proc/meminfo"
@@ -970,7 +955,6 @@ uint64_t I_GetFreeMem(uint64_t *total)
// make a conservative guess
*total = 32 << 20;
return 32 << 20;
-#endif // Unix flavors
#elif defined(WIN32)
// windows
#if defined(WIN_LARGE_MEM) && defined( _WIN32_WINNT ) && (_WIN32_WINNT >= 0x0500)