diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2012-11-06 13:15:40 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2012-11-06 13:15:40 +0000 |
commit | e4d96b78dcf407b68ef9b2eae52b0e3de3eb429d (patch) | |
tree | 04099330d6b522ff055413ee8bcc6ea2e38df8af /games/doomlegacy | |
parent | 5da32c1697e79eec7f006df01c3613dbfb6f1193 (diff) |
Overhaul the port to make it usable and up-to-date with the reality:
- Update to version 1.44 alpha3 (unfortunately, for the sake of sane version
number, have to bump PORTEPOCH)
- Switch to unified SDL media interface (this is what all modern systems
should use) and stop building and installing no longer required stuff; now
both sound and music works as expected out of the box
- Switch from kvm(3) kernel memory interface calls to obtain memory stats to
sysctl(3) to avoid kmem group privileges (setgid bit) requirement
- Get rid of wrapper script by providing better default value of DOOMWADDIR
- Rename X86_ASM option to standard ASM (which already has nice description)
- Change USE_GL knob value from umbrella "yes" to more specific "glu"
- Adjust COMMENT and define LICENSE (GPLv2); really honor CC and CFLAGS
- Utilize PORTDOCS and PLIST_FILES and thus purge pkg-plist
- Trim Makefile header while I'm here per new world order
- Provide better and cleaner port description
Feature safe: yes
Inspired by: http://lists.freebsd.org/pipermail/freebsd-questions/2012-August/244371.html
Tested on: i386 only :(
Notes
Notes:
svn path=/head/; revision=307068
Diffstat (limited to 'games/doomlegacy')
-rw-r--r-- | games/doomlegacy/Makefile | 95 | ||||
-rw-r--r-- | games/doomlegacy/distinfo | 8 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-Makefile | 41 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-byteptr.h | 208 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-i_sound.c | 54 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-i_tcp.c | 13 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-makefile | 99 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-sdl+i_system.c | 54 | ||||
-rw-r--r-- | games/doomlegacy/files/patch-sndserv_Makefile | 12 | ||||
-rw-r--r-- | games/doomlegacy/pkg-descr | 27 |
10 files changed, 159 insertions, 452 deletions
diff --git a/games/doomlegacy/Makefile b/games/doomlegacy/Makefile index 6b8d91181496..f060a684f3d9 100644 --- a/games/doomlegacy/Makefile +++ b/games/doomlegacy/Makefile @@ -1,78 +1,71 @@ -# New ports collection makefile for: doomlegacy -# Date Created: 10 April 2002 -# Whom: Alexander G. Chetirbock <bock@bock.nnov.ru> -# +# Created by: Alexander G. Chetirbock <bock@bock.nnov.ru> # $FreeBSD$ PORTNAME= doomlegacy -PORTVERSION= 142 -PORTREVISION= 7 +DISTVERSION= 1.44_alpha3 +PORTEPOCH= 1 CATEGORIES= games -MASTER_SITES= SF/${PORTNAME}/DooM%20Legacy%20source%20code/1.42 -DISTNAME= legacy_${PORTVERSION}_src -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${WADFILE} +MASTER_SITES= http://doomlegacy.sourceforge.net/releases/ \ + http://freebsd.nsu.ru/distfiles/legacy.wad:wad +DISTNAME= ${PORTNAME}_${DISTVERSION}_src_r${SVN_REV} +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} legacy.wad:wad +DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= ports@FreeBSD.org -COMMENT= DooM Legacy: popular DooM clone! +COMMENT= Improved and extended version of Doom -EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip +LICENSE= GPLv2 -USE_GL= yes +USE_ZIP= yes +USE_GL= glu USE_GMAKE= yes USE_SDL= mixer sdl -MAKEFILE= makefile -MAKE_ENV= FREEBSD=1 FBSD_SDL=1 PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ - PTHREAD_LIBS="${PTHREAD_LIBS}" -WRKSRC= ${WRKDIR}/doomlegacy_${PORTVERSION}_src -OPTIONS_DEFINE= X86_ASM DOCS -OPTIONS_DEFAULT= X86_ASM -X86_ASM_DESC= Enable use of x86 assembly code +MAKE_ENV= OLD_DEPENDENCIES=1 # since .dep file is removed +CFLAGS+= -DSVN_REV=\\\"${SVN_REV}\\\" +WRKSRC= ${WRKDIR}/${PORTNAME}_${DISTVERSION:S/.//}/src -DATADIR= ${PREFIX}/lib/${PORTNAME} -SUB_FILES= legacy +PLIST_FILES= bin/${PORTNAME} share/doom/legacy.wad +PORTDOCS= * -WADFILE= legacy_dat.zip +SVN_REV= 845 -.include "${.CURDIR}/../doom-data/Makefile.include" +OPTIONS_DEFINE= ASM DOCS +OPTIONS_DEFAULT= ASM .include <bsd.port.pre.mk> -.if ${PORT_OPTIONS:MX86_ASM} && ${ARCH} == "i386" -BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm -MAKE_ARGS+= USEASM=1 +.if ${PORT_OPTIONS:MASM} && ${ARCH} == "i386" +BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm +MAKE_ENV+= USEASM=1 .endif -post-extract: - @${UNZIP_CMD} -q ${DISTDIR}/${WADFILE} -d ${WRKDIR}/bin - post-patch: - @${REINPLACE_CMD} -e \ - 's|-I/usr/local/include/SDL11|`${SDL_CONFIG} --cflags`|; \ - s|-lSDL-1\.1|`${SDL_CONFIG} --libs`|; \ - s|/usr/local|${LOCALBASE}|; \ - s|/usr/X11R6|${LOCALBASE}|' \ - ${WRKSRC}/${MAKEFILE} - -pre-build: - @cd ${WRKSRC}/linux_x/sndserv && ${GMAKE} clean - -post-build: - @${LN} -sf ${WRKSRC}/linux_x/sndserv/linux/llsndserv ${WRKDIR}/bin + @${REINPLACE_CMD} -e 's|<malloc|<stdlib|' ${WRKSRC}/p_setup.c \ + ${WRKSRC}/r_data.c ${WRKSRC}/w_wad.c +# Unbreak the build when using optimized assembly routines + @${REINPLACE_CMD} -e 's|dc_transmap|dc_translucentmap| ; \ + s|colormaps|reg_&|' ${WRKSRC}/tmap.nas +# 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 + @${REINPLACE_CMD} -e 's,\(doomwaddir = \)"\.",\1"${DMDIR}", ; \ + 1306,1309d' ${WRKSRC}/d_main.c +# Remove broken dependency file (wrong paths inside) and copy of GPL + @${RM} ${WRKSRC}/sdl.dep ; ${TOUCH} ${WRKSRC}/sdl.dep + @${RM} ${WRKSRC}/_doc/LICENSE.txt do-install: - ${MKDIR} ${DATADIR} - cd ${WRKDIR}/bin && ${INSTALL_PROGRAM} llsndserv r_opengl.so ${DATADIR} - ${INSTALL} -c -s -o root -g kmem -m 2555 ${WRKDIR}/bin/lsdldoom \ - ${DATADIR} - ${INSTALL_DATA} ${WRKDIR}/bin/legacy.dat ${DATADIR} - ${INSTALL_SCRIPT} ${WRKDIR}/legacy ${PREFIX}/bin/${PORTNAME} + ${INSTALL_PROGRAM} ${WRKSRC}/../bin/doomlegacy ${PREFIX}/bin + ${INSTALL_DATA} ${_DISTDIR}/legacy.wad ${DMDIR} .if ${PORT_OPTIONS:MDOCS} - ${MKDIR} ${DOCSDIR} -. for f in *.html *.txt *.cfg README_SDL copying - ${INSTALL_DATA} ${WRKSRC}/_doc/${f} ${DOCSDIR} -. endfor + @${MKDIR} ${DOCSDIR} + cd ${WRKSRC}/_doc && ${COPYTREE_SHARE} . ${DOCSDIR} .endif +.include "${.CURDIR}/../doom-data/Makefile.include" .include <bsd.port.post.mk> diff --git a/games/doomlegacy/distinfo b/games/doomlegacy/distinfo index ffcabe6a228c..700e9fb43258 100644 --- a/games/doomlegacy/distinfo +++ b/games/doomlegacy/distinfo @@ -1,4 +1,4 @@ -SHA256 (legacy_142_src.tar.gz) = f5d80aaafddb1a9525af72f118cc63f724f3542c9f58496ad5eabd334b8e2d98 -SIZE (legacy_142_src.tar.gz) = 1687954 -SHA256 (legacy_dat.zip) = 2904fb4e14f60b85aeb49b4fe046ac360156dbe79acb26b640507d00ab949dfb -SIZE (legacy_dat.zip) = 340934 +SHA256 (doomlegacy/doomlegacy_1.44_alpha3_src_r845.zip) = d5ac03ceab68f586ce7282fab1975bbbdbd83b093dd3fa55a8e5317892f61436 +SIZE (doomlegacy/doomlegacy_1.44_alpha3_src_r845.zip) = 2530660 +SHA256 (doomlegacy/legacy.wad) = 3670caff9432155487be2622b7e77ee6fe356f21fd09e8733bf95b58d2df5f5f +SIZE (doomlegacy/legacy.wad) = 952918 diff --git a/games/doomlegacy/files/patch-Makefile b/games/doomlegacy/files/patch-Makefile new file mode 100644 index 000000000000..ae4f0b13d81e --- /dev/null +++ b/games/doomlegacy/files/patch-Makefile @@ -0,0 +1,41 @@ +--- Makefile.orig ++++ Makefile +@@ -76,7 +76,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 @@ + LIBS := -lopengl32 -lglu32 -lwsock32 -lm + else + # default is Linux, for all unix SDL +- OPTS := -DLINUX ++ OPTS := -DLINUX -DFREEBSD + LDFLAGS=-L/usr/X11R6/lib +- LIBS := -lGL -lGLU -lm ++ LIBS := -lGL -lGLU -lm -lipx + # -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 @@ + + + # compiler and linker flags +-CFLAGS = $(WFLAGS) ++#CFLAGS = $(WFLAGS) + + ifdef PROFILEMODE + # build with gprof profiling information +@@ -309,7 +309,7 @@ + else + # build a normal optimized version + #CFLAGS += -O3 +- CFLAGS += $(OPTLEV) -fomit-frame-pointer ++ #CFLAGS += $(OPTLEV) -fomit-frame-pointer + endif + endif + diff --git a/games/doomlegacy/files/patch-byteptr.h b/games/doomlegacy/files/patch-byteptr.h deleted file mode 100644 index 62667ab77c63..000000000000 --- a/games/doomlegacy/files/patch-byteptr.h +++ /dev/null @@ -1,208 +0,0 @@ ---- byteptr.h.orig Sun Apr 18 18:02:24 2004 -+++ byteptr.h Wed Jun 6 20:09:36 2007 -@@ -32,109 +32,123 @@ - // - //----------------------------------------------------------------------------- - --#ifndef __BIG_ENDIAN__ --// --// Little-endian machines --// --#define writeshort(p,b) *(short*) (p) = b --#define writelong(p,b) *(long *) (p) = b --#define WRITEBYTE(p,b) *((byte *)p)++ = b --#define WRITECHAR(p,b) *((char *)p)++ = b --#define WRITESHORT(p,b) *((short *)p)++ = b --#define WRITEUSHORT(p,b) *((USHORT *)p)++ = b --#define WRITELONG(p,b) *((long *)p)++ = b --#define WRITEULONG(p,b) *((ULONG *)p)++ = b --#define WRITEFIXED(p,b) *((fixed_t*)p)++ = b --#define WRITEANGLE(p,b) *((angle_t*)p)++ = b --#define WRITESTRING(p,b) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); } while(b[tmp_i++]); } --#define WRITESTRINGN(p,b,n) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); if(!b[tmp_i]) break;tmp_i++; } while(tmp_i<n); } --#define WRITEMEM(p,s,n) memcpy(p, s, n);p+=n -+#include <assert.h> -+#include <stdint.h> - --#define readshort(p) *((short *)p) --#define readlong(p) *((long *)p) --#define READBYTE(p) *((byte *)p)++ --#define READCHAR(p) *((char *)p)++ --#define READSHORT(p) *((short *)p)++ --#define READUSHORT(p) *((USHORT *)p)++ --#define READLONG(p) *((long *)p)++ --#define READULONG(p) *((ULONG *)p)++ --#define READFIXED(p) *((fixed_t*)p)++ --#define READANGLE(p) *((angle_t*)p)++ --#define READSTRING(p,s) { int tmp_i=0; do { s[tmp_i]=READBYTE(p); } while(s[tmp_i++]); } --#define SKIPSTRING(p) while(READBYTE(p)) --#define READMEM(p,s,n) memcpy(s, p, n);p+=n --#else --// --// definitions for big-endian machines with alignment constraints. --// --// Write a value to a little-endian, unaligned destination. --// --static inline void writeshort(void * ptr, int val) -+#ifdef __BIG_ENDIAN__ -+#define ptrtole(ptr, size) endian_swap(ptr, size) -+#else -+#define ptrtole(ptr, size) -+#endif -+ -+static inline void *endian_swap(void *ptr, size_t size) - { -- char * cp = ptr; -- cp[0] = val ; val >>= 8; -- cp[1] = val ; -+ unsigned char *myptr = ptr; -+ int i, x; -+ -+ for (i = 1; i <= size / 2; i++) { -+ x = myptr[i-1]; -+ myptr[i-1] = myptr[size-i]; -+ myptr[size-i] = x; -+ } -+ -+ return (ptr); - } - --static inline void writelong(void * ptr, int val) -+static inline void *incptr(void **ptr, size_t size) - { -- char * cp = ptr; -- cp[0] = val ; val >>= 8; -- cp[1] = val ; val >>= 8; -- cp[2] = val ; val >>= 8; -- cp[3] = val ; -+ unsigned char **myptr = ptr; -+ void *oldptr = *ptr; -+ int i; -+ -+ for (i = 0; i < size; i++) -+ (*myptr)++; -+ -+ return (oldptr); - } - --#define WRITEBYTE(p,b) *((byte *)p)++ = (b) --#define WRITECHAR(p,b) *((char *)p)++ = (b) --#define WRITESHORT(p,b) writeshort(((short *)p)++, (b)) --#define WRITEUSHORT(p,b) writeshort(((u_short*)p)++, (b)) --#define WRITELONG(p,b) writelong (((long *)p)++, (b)) --#define WRITEULONG(p,b) writelong (((u_long *)p)++, (b)) --#define WRITEFIXED(p,b) writelong (((fixed_t*)p)++, (b)) --#define WRITEANGLE(p,b) writelong (((angle_t*)p)++, (long) (b)) --#define WRITESTRING(p,b) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); } while(b[tmp_i++]); } --#define WRITESTRINGN(p,b,n) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); if(!b[tmp_i]) break;tmp_i++; } while(tmp_i<n); } --#define WRITEMEM(p,s,n) memcpy(p, s, n);p+=n -+static inline intmax_t readptr(void **ptr, size_t size) -+{ -+ intmax_t res = 0; - --// Read a signed quantity from little-endian, unaligned data. --// --static inline short readshort(void * ptr) -+ // Check if it won't work -+ assert(size > 0 && size <= sizeof(intmax_t)); -+ -+ memcpy(&res, incptr(ptr, size), size); -+ ptrtole(&res, size); -+ -+ return (res); -+} -+ -+static inline intmax_t writeptr(void **dst, intmax_t src, size_t size) - { -- char *cp = ptr; -- u_char *ucp = ptr; -- return (cp[1] << 8) | ucp[0] ; -+ intmax_t res = 0; -+ -+ // Check if it won't work -+ assert(size > 0 && size <= sizeof(intmax_t)); -+ -+ memcpy(*dst, &src, size); -+ ptrtole(*dst, size); -+ memcpy(&res, *dst, size); -+ incptr(dst, size); -+ -+ return (res); - } - --static inline u_short readushort(void * ptr) -+static inline short readshort(void *ptr) - { -- u_char *ucp = ptr; -- return (ucp[1] << 8) | ucp[0] ; -+ short res = *(short *)ptr; -+ -+ ptrtole(&res, sizeof(short)); -+ -+ return (res); - } - --static inline long readlong(void * ptr) -+static inline long readlong(void *ptr) - { -- char *cp = ptr; -- u_char *ucp = ptr; -- return (cp[3] << 24) | (ucp[2] << 16) | (ucp[1] << 8) | ucp[0] ; -+ long res = *(long *)ptr; -+ -+ ptrtole(&res, sizeof(long)); -+ -+ return (res); - } - --static inline u_long readulong(void * ptr) -+static inline void writeshort(void *ptr, int val) - { -- u_char *ucp = ptr; -- return (ucp[3] << 24) | (ucp[2] << 16) | (ucp[1] << 8) | ucp[0] ; -+ short *myptr = ptr; -+ -+ *myptr = val; -+ ptrtole(myptr, sizeof(*myptr)); - } - -+static inline void writelong(void *ptr, int val) -+{ -+ long *myptr = ptr; - --#define READBYTE(p) *((byte *)p)++ --#define READCHAR(p) *((char *)p)++ --#define READSHORT(p) readshort ( ((short*) p)++) --#define READUSHORT(p) readushort(((USHORT*) p)++) --#define READLONG(p) readlong ( ((long*) p)++) --#define READULONG(p) readulong ( ((ULONG*) p)++) --#define READFIXED(p) readlong ( ((long*) p)++) --#define READANGLE(p) readulong ( ((ULONG*) p)++) -+ *myptr = val; -+ ptrtole(myptr, sizeof(*myptr)); -+} -+ -+#define WRITEBYTE(p,b) writeptr(&p, b, sizeof(byte)) -+#define WRITECHAR(p,b) writeptr(&p, b, sizeof(char)) -+#define WRITESHORT(p,b) writeptr(&p, b, sizeof(short)) -+#define WRITEUSHORT(p,b) writeptr(&p, b, sizeof(USHORT)) -+#define WRITELONG(p,b) writeptr(&p, b, sizeof(long)) -+#define WRITEULONG(p,b) writeptr(&p, b, sizeof(ULONG)) -+#define WRITEFIXED(p,b) writeptr(&p, b, sizeof(fixed_t)) -+#define WRITEANGLE(p,b) writeptr(&p, b, sizeof(angle_t)) -+#define WRITESTRING(p,b) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); } while(b[tmp_i++]); } -+#define WRITESTRINGN(p,b,n) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); if(!b[tmp_i]) break;tmp_i++; } while(tmp_i<n); } -+#define WRITEMEM(p,s,n) memcpy(p, s, n);p+=n -+ -+#define READBYTE(p) readptr(&p, sizeof(byte)) -+#define READCHAR(p) readptr(&p, sizeof(char)) -+#define READSHORT(p) readptr(&p, sizeof(short)) -+#define READUSHORT(p) readptr(&p, sizeof(USHORT)) -+#define READLONG(p) readptr(&p, sizeof(long)) -+#define READULONG(p) readptr(&p, sizeof(ULONG)) -+#define READFIXED(p) readptr(&p, sizeof(fixed_t)) -+#define READANGLE(p) readptr(&p, sizeof(angle_t)) - #define READSTRING(p,s) { int tmp_i=0; do { s[tmp_i]=READBYTE(p); } while(s[tmp_i++]); } - #define SKIPSTRING(p) while(READBYTE(p)) - #define READMEM(p,s,n) memcpy(s, p, n);p+=n --#endif //__BIG_ENDIAN__ diff --git a/games/doomlegacy/files/patch-i_sound.c b/games/doomlegacy/files/patch-i_sound.c deleted file mode 100644 index ad6b62954e46..000000000000 --- a/games/doomlegacy/files/patch-i_sound.c +++ /dev/null @@ -1,54 +0,0 @@ ---- sdl/i_sound.c.orig 2004-04-18 23:02:24.000000000 +0200 -+++ sdl/i_sound.c 2012-02-04 08:58:36.000000000 +0100 -@@ -118,7 +118,7 @@ - - #define SAMPLERATE 11025 // Hz - --static int samplecount = 512; -+static int samplecount = 1024; - - static int lengths[NUMSFX]; // The actual lengths of all sound effects. - static unsigned int channelstep[NUM_CHANNELS]; // The channel step amount... -@@ -517,12 +517,12 @@ - // Mixing channel index. - int chan; - -- extern void music_mixer(void *udata, Uint8 * stream, int len); -+ //extern void music_mixer(void *udata, Uint8 * stream, int len); - - if (nosound) - return; - // Mix in the music -- music_mixer(NULL, stream, len); -+ //music_mixer(NULL, stream, len); - - if (nosound) - return; -@@ -709,14 +709,15 @@ - /* - Should this be exposed in mixer.h? - */ -- extern void close_music(void); -+ //extern void close_music(void); - if (nomusic) - return; - - if (!musicStarted) - return; - -- close_music(); -+ //close_music(); -+ Mix_CloseAudio(); - - CONS_Printf("I_ShutdownMusic: shut down\n"); - musicStarted = false; -@@ -740,7 +741,8 @@ - if (nomusic) - return; - -- if (open_music(&audio) < 0) -+ //if (open_music(&audio) < 0) -+ if (Mix_OpenAudio (audio.freq, audio.format, audio.channels, audio.samples) < 0) - { - CONS_Printf("Unable to open music: %s\n", Mix_GetError()); - nomusic = true; diff --git a/games/doomlegacy/files/patch-i_tcp.c b/games/doomlegacy/files/patch-i_tcp.c deleted file mode 100644 index e74d43c24892..000000000000 --- a/games/doomlegacy/files/patch-i_tcp.c +++ /dev/null @@ -1,13 +0,0 @@ ---- i_tcp.c.orig Fri Jan 17 17:26:18 2003 -+++ i_tcp.c Fri Jan 17 17:27:09 2003 -@@ -219,6 +219,10 @@ - #include "doomstat.h" - #include "mserv.h" //Hurdler: support master server - -+// somewhere on the track between 4.5 and -current this one has disappered. -+#ifndef IPPORT_USERRESERVED -+ #define IPPORT_USERRESERVED 5000 -+#endif - #ifdef __WIN32__ - // some undifined under win32 - #define IPPORT_USERRESERVED 5000 diff --git a/games/doomlegacy/files/patch-makefile b/games/doomlegacy/files/patch-makefile deleted file mode 100644 index 0fc1b1128c4d..000000000000 --- a/games/doomlegacy/files/patch-makefile +++ /dev/null @@ -1,99 +0,0 @@ ---- makefile.orig Sun Apr 18 18:02:24 2004 -+++ makefile Mon Sep 19 20:44:29 2005 -@@ -260,12 +260,10 @@ - - # gcc or g++ - #CC=@gcc --CC=gcc - - #if use PGCC or EGCS - PGCC=1 - --WFLAGS=-Wall # -W -Wno-unused -Wno-sign-compare - - #uncomment if you want to use the POLL_POINTER hack - #POLL_POINTER=-DPOLL_POINTER -@@ -407,7 +405,8 @@ - - OPTS := $(OPTS) -DVID_X11 $(POLL_POINTER) -I. -I/usr/X11R6/include - LDFLAGS=-L/usr/X11R6/lib -- LIBS=-lXext -lX11 -lm -lXxf86vm -lipx -lkvm -pthread -+ LIBS=-lXext -lX11 -lm -lXxf86vm -lipx -lkvm ${PTHREAD_LIBS} -+ CFLAGS+=${PTHREAD_CFLAGS} - # name of the exefile - EXENAME=llxdoom - SFLAGS=-g $(OPTS) -@@ -418,7 +417,7 @@ - else #ifdef X - ifdef FBSD_SDL - INTERFACE=sdl -- OPTS := -DLINUX -DFREEBSD -DHWRENDER -DDIRECTFULLSCREEN -DHAVE_MIXER -DSDL -DVID_X11 $(POLL_POINTER) -I. -I/usr/local/include/SDL11 -I/usr/X11R6/include -Wall -+ OPTS := -DLINUX -DFREEBSD -DHWRENDER -DDIRECTFULLSCREEN -DHAVE_MIXER -DSDL -DVID_X11 $(POLL_POINTER) -I. -I/usr/local/include/SDL -I/usr/local/include -I/usr/X11R6/include - SFLAGS=-g $(OPTS) - OBJS=$(O)/i_video.o $(O)/dosstr.o $(O)/endtxt.o \ - $(O)/hw_bsp.o $(O)/hw_draw.o $(O)/hw_light.o $(O)/hw_main.o \ -@@ -428,7 +427,8 @@ - DEBUGLIBS=$(LIBS) - - LDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib -- LIBS=-lm -lSDL-1.1 -lSDL_mixer -lGL -lGLU -lipx -lkvm -pthread -+ LIBS=-lm -lSDL -lSDL_mixer -lGL -lGLU -lipx -lkvm ${PTHREAD_LIBS} -+ CFLAGS+=${PTHREAD_CFLAGS} - DEBUGLIBS=$(LIBS) - - # name of the exefile -@@ -533,11 +533,7 @@ - - ifndef SOLARIS - ifdef GCC30 -- M5=-march=pentium -- M4=-march=486 - else -- M5=-mpentium -- M4=-m486 - endif - endif - -@@ -555,13 +551,13 @@ - - # build a normal optimised version - ifdef PGCC -- CFLAGS = $(OPTS) $(M5) -O6 -ffast-math -fomit-frame-pointer -fwritable-strings -+ CFLAGS += $(OPTS) - # -fgcse -fcse-follow-jumps -fcse-skip-blocks -frerun-cse-after-loop -ffunction-cse \ - # -fexpensive-optimizations -fforce-mem -fstrength-reduce -fthread-jumps \ - # -fregmove -fschedule-insns -fschedule-insns2 -fmove-all-movables \ - # -fcaller-saves -finline-functions -mieee-fp -mfp-ret-in-387 -m80387 -mhard-float -finline - else -- CFLAGS = $(M4) -O3 -ffast-math -fomit-frame-pointer -fwritable-strings $(OPTS) -+ CFLAGS += $(OPTS) - endif - endif - -@@ -735,7 +731,7 @@ - - #dll - dll : $(O)/r_opengl.o $(O)/ogl_x11.o -- $(CC) $(M5) -O6 -o $(BIN)/r_opengl.so -shared -nostartfiles $(O)/r_opengl.o $(O)/ogl_x11.o -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lGL -lGLU -lm -+ $(CC) $(CFLAGS) -o $(BIN)/r_opengl.so -shared -nostartfiles $(O)/r_opengl.o $(O)/ogl_x11.o -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lGL -lGLU -lm - - musserv: - @mkdir -p $(MUSSERV)/linux -@@ -760,7 +756,7 @@ - ifdef FREEBSD - ifdef FBSD_SDL - $(O)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h -- $(CC) $(CFLAGS) $(LDFLAGS) $(WFLAGS) -I/usr/X11R6/include -c $< -o $@ -+ $(CC) -fPIC $(CFLAGS) $(LDFLAGS) $(WFLAGS) -I/usr/X11R6/include -c $< -o $@ - else #FBSD_SDL - $(O)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h - $(CC) $(M5) -O6 -o $(O)/r_opengl.o -DHWRENDER -DVID_X11 -DLINUX -DFREEBSD $(POLL_POINTER) -shared -nostartfiles -I/usr/X11R6/include -c hardware/r_opengl/r_opengl.c -@@ -777,7 +773,7 @@ - $(CC) $(M5) -O6 -o $(O)/ogl_x11.o -DHWRENDER -DVID_X11 -DLINUX $(POLL_POINTER) -shared -nostartfiles -I/usr/X11R6/include -c hardware/r_opengl/ogl_x11.c - else - $(O)/ogl_x11.o: hardware/r_opengl/ogl_x11.c hardware/r_opengl/r_opengl.h -- $(CC) $(M5) -O6 -o $(O)/ogl_x11.o -DHWRENDER -DVID_X11 -DLINUX -DFREEBSD $(POLL_POINTER) -shared -nostartfiles -I/usr/X11R6/include -c hardware/r_opengl/ogl_x11.c -+ $(CC) -fPIC $(CFLAGS) -o $(O)/ogl_x11.o -DHWRENDER -DVID_X11 -DLINUX -DFREEBSD $(POLL_POINTER) -shared -nostartfiles -I/usr/X11R6/include -c hardware/r_opengl/ogl_x11.c - endif - - diff --git a/games/doomlegacy/files/patch-sdl+i_system.c b/games/doomlegacy/files/patch-sdl+i_system.c new file mode 100644 index 000000000000..27bb24d1fd2e --- /dev/null +++ b/games/doomlegacy/files/patch-sdl+i_system.c @@ -0,0 +1,54 @@ +--- sdl/i_system.c.orig ++++ sdl/i_system.c +@@ -83,10 +83,7 @@ + # include <sys/mount.h> + /*For meminfo*/ + # include <sys/types.h> +-# include <kvm.h> +-# include <nlist.h> +-# include <sys/vmmeter.h> +-# include <fcntl.h> ++# include <sys/sysctl.h> + # endif + #endif + +@@ -832,30 +829,16 @@ uint64_t I_GetFreeMem(uint64_t *total) + // LINUX covers all the unix-type OS's. + + #ifdef FREEBSD +- struct vmmeter sum; +- kvm_t *kd; +- struct nlist namelist[]= { +-#define X_SUM 0 +- {"_cnt"}, +- { 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); ++ if (sysctlbyname("vm.stats.vm.v_page_count", &page_count, &len, NULL, 0)) + goto guess; +- +- if (kvm_nlist(kd, namelist) != 0) +- { +- kvm_close (kd); +- goto guess; +- } +- if (kvm_read(kd,namelist[X_SUM].n_value ,&sum, sizeof(sum)) != sizeof(sum)) +- { +- kvm_close (kd); +- goto guess; +- } +- kvm_close (kd); +- +- *total = sum.v_page_count * sum.v_page_size; +- return sum.v_free_count * sum.v_page_size; ++ if (sysctlbyname("vm.stats.vm.v_free_count", &free_count, &len, NULL, 0)) ++ goto guess; ++ if (sysctlbyname("hw.pagesize", &pagesize, &len, NULL, 0)) ++ goto guess; ++ *total = page_count * pagesize; ++ return free_count * pagesize; + #elif defined(SOLARIS) + goto guess; + #else diff --git a/games/doomlegacy/files/patch-sndserv_Makefile b/games/doomlegacy/files/patch-sndserv_Makefile deleted file mode 100644 index d7785de18d52..000000000000 --- a/games/doomlegacy/files/patch-sndserv_Makefile +++ /dev/null @@ -1,12 +0,0 @@ ---- linux_x/sndserv/Makefile.orig Sun Apr 18 18:02:24 2004 -+++ linux_x/sndserv/Makefile Sun Sep 18 13:09:38 2005 -@@ -26,8 +26,7 @@ - # - # - --CC=gcc --CFLAGS=-O2 -m486 -Wall -DNORMALUNIX -DLINUX -+CFLAGS=-DNORMALUNIX -DLINUX - ifdef FREEBSD - CFLAGS:=${CFLAGS} -DFREEBSD - endif diff --git a/games/doomlegacy/pkg-descr b/games/doomlegacy/pkg-descr index 23295c788153..a7734f334841 100644 --- a/games/doomlegacy/pkg-descr +++ b/games/doomlegacy/pkg-descr @@ -1,12 +1,17 @@ -DooM Legacy is a DooM port. Some of the supported features are: - * VIDEO OPTIONS MENU - * TRANSLUCENCY ON SPRITES AND WALLS - * SETUP CONTROLS MENU - * LOOK UP AND DOWN (FREELOOK) - * CHASE-CAM : also called a 'third-person' view, or 'Tomb Raider' view. - * CONSOLE - * STATUS BAR OVERLAY - * SKINS +Doom Legacy is a source port of Doom available for various operating systems +which was originally written as a fork of DOSDoom introducing lots of useful +improvements yet retaining original feel of the game. It currently features: -WWW: http://legacy.newdoom.com/ -WWW: http://sourceforge.net/projects/doomlegacy + * TCP/IP multiplayer networking (including a master server for Internet + game searches) + * Nearly complete Boom and Heretic support + * OpenGL rendering + * Higher resolutions + * Console with support for key bindings (Quake-style) + * FraggleScript for scripting + * 3D floors, water, and coloured lighting + * Mouse aim and crosshairs + * Jumping + * 32 players (including support for custom skins) + +WWW: http://doomlegacy.sourceforge.net/ |