aboutsummaryrefslogtreecommitdiff
path: root/games/doomlegacy
diff options
context:
space:
mode:
authorSimon Barner <barner@FreeBSD.org>2005-11-17 11:51:51 +0000
committerSimon Barner <barner@FreeBSD.org>2005-11-17 11:51:51 +0000
commitd6b0fe210228088d71cc61ab349fef0467ec2168 (patch)
tree7243f5d356e104ad2db91389dd1438b0a5d332a8 /games/doomlegacy
parentcd71f9a949789413606cc00b5e2e2b8773d3ceaa (diff)
- Integrate with "doom-data".
- Add ONLY_FOR_ARCHS=i386 - Add OPTIONS (for x86 asm). - Make wrapper script. - Add SHA256 - Add NOPORTDOCS support and use DATADIR - Respect CC and CFLAGS PR: ports/86446 Submitted by: Alejandro Pulver <alejandro@varnet.biz> Tweaked by: barner Approved by: Maintainer timeout (2 months)
Notes
Notes: svn path=/head/; revision=148589
Diffstat (limited to 'games/doomlegacy')
-rw-r--r--games/doomlegacy/Makefile66
-rw-r--r--games/doomlegacy/distinfo2
-rw-r--r--games/doomlegacy/files/legacy.in20
-rw-r--r--games/doomlegacy/files/patch-makefile68
-rw-r--r--games/doomlegacy/files/patch-sndserv_Makefile12
-rw-r--r--games/doomlegacy/files/patch-sndserver::Makefile13
-rw-r--r--games/doomlegacy/files/wrapper.sh6
-rw-r--r--games/doomlegacy/pkg-message14
-rw-r--r--games/doomlegacy/pkg-plist13
9 files changed, 123 insertions, 91 deletions
diff --git a/games/doomlegacy/Makefile b/games/doomlegacy/Makefile
index 7b9fcd42ffd6..e0d07229c6a8 100644
--- a/games/doomlegacy/Makefile
+++ b/games/doomlegacy/Makefile
@@ -11,46 +11,35 @@ CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME= legacy_${PORTVERSION}_src
-DISTFILES= ${DIST} ${WADFILE}
-DIST= ${DISTNAME}${EXTRACT_SUFX}
-WADFILE= legacy_dat.zip
-EXTRACT_ONLY= ${DIST}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${WADFILE}
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= bock@bock.nnov.ru
COMMENT= DooM Legacy: popular DooM clone!
EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip
-BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
-USE_XLIB= yes
-USE_GMAKE= yes
+ONLY_FOR_ARCHS= i386
+
USE_GL= yes
-USE_SDL= mixer
+USE_GMAKE= yes
+USE_SDL= mixer sdl
+USE_XLIB= yes
+
+OPTIONS= X86_ASM "Enable use of x86 assembly code" on
WRKSRC= ${WRKDIR}/doomlegacy_${PORTVERSION}_src
MAKEFILE= makefile
MAKE_ENV+= FREEBSD=1 FBSD_SDL=1 PTHREAD_LIBS="${PTHREAD_LIBS}" \
PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
-# I have no ideas about build status on other platforms
-ONLY_FOR_ARCHS= i386
-
-TARGET_DIR= ${PREFIX}/${PORTNAME}
-
-DATA_FILES= ${WRKDIR}/bin/legacy.dat
-PROG_FILES= ${WRKDIR}/bin/llsndserv ${WRKDIR}/bin/r_opengl.so
-SGID_FILES= ${WRKDIR}/bin/lsdldoom
-SGID_ARGS= -c -s -o root -g kmem -m 2555
-DOC_FILES= *.html *.txt *.cfg README_SDL copying
+SUB_FILES= legacy
+WADFILE= legacy_dat.zip
+DATADIR= ${PREFIX}/lib/${PORTNAME}
post-extract:
- @${MKDIR} ${WRKDIR}/bin
${UNZIP_CMD} -q ${DISTDIR}/${WADFILE} -d ${WRKDIR}/bin
-post-patch:
- @${SED} -e "s|%%INSTALLDIR%%|${PREFIX}/${PORTNAME}|" ${FILESDIR}/wrapper.sh > \
- ${WRKDIR}/bin/wrapper.sh
-
pre-build:
cd ${WRKSRC}/linux_x/sndserv && ${GMAKE} clean
@@ -58,20 +47,29 @@ post-build:
@${LN} -s ${WRKSRC}/linux_x/sndserv/linux/llsndserv ${WRKDIR}/bin
do-install:
- ${INSTALL} -d ${TARGET_DIR}
- ${INSTALL_PROGRAM} ${PROG_FILES} ${TARGET_DIR}
- ${INSTALL} ${SGID_ARGS} ${SGID_FILES} ${TARGET_DIR}
- ${INSTALL_DATA} ${DATA_FILES} ${TARGET_DIR}
- ${INSTALL_SCRIPT} ${WRKDIR}/bin/wrapper.sh ${TARGET_DIR}/legacy.sh
- @${LN} -s ${TARGET_DIR}/legacy.sh ${PREFIX}/bin/legacy
+ ${MKDIR} ${DATADIR}
+ ${INSTALL_PROGRAM} ${WRKDIR}/bin/llsndserv ${WRKDIR}/bin/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
post-install:
.ifndef(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
-.for file in ${DOC_FILES}
- ${INSTALL_MAN} ${WRKSRC}/_doc/${file} ${DOCSDIR}
-.endfor
+. for f in *.html *.txt *.cfg README_SDL copying
+ ${INSTALL_DATA} ${WRKSRC}/_doc/${f} ${DOCSDIR}
+. endfor
+.endif
+
+.include "${.CURDIR}/../doom-data/Makefile.include"
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_X86_ASM)
+BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm
+MAKE_ARGS+= USEASM=1
.endif
- @${SED} -e "s|%%PREFIX%%|${PREFIX}|" ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/games/doomlegacy/distinfo b/games/doomlegacy/distinfo
index f978d2794e55..d5bb3a86a5e9 100644
--- a/games/doomlegacy/distinfo
+++ b/games/doomlegacy/distinfo
@@ -1,4 +1,6 @@
MD5 (legacy_142_src.tar.gz) = 62f5cdad464463038d568a53b13c22f7
+SHA256 (legacy_142_src.tar.gz) = f5d80aaafddb1a9525af72f118cc63f724f3542c9f58496ad5eabd334b8e2d98
SIZE (legacy_142_src.tar.gz) = 1687954
MD5 (legacy_dat.zip) = 8182e1aebac3696ddc7f9e0663740d9a
+SHA256 (legacy_dat.zip) = 2904fb4e14f60b85aeb49b4fe046ac360156dbe79acb26b640507d00ab949dfb
SIZE (legacy_dat.zip) = 340934
diff --git a/games/doomlegacy/files/legacy.in b/games/doomlegacy/files/legacy.in
new file mode 100644
index 000000000000..d43a1a0165d5
--- /dev/null
+++ b/games/doomlegacy/files/legacy.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# The executable needs to run from a directory with the Doom Legacy data
+# files, libraries and executables, and Doom WAD files. So we mirror the Doom
+# Legacy and Doom (WAD files) data directory to ~/.legacy, and create symlinks
+# to the data files.
+
+cd %%DATADIR%% || exit 1
+
+mkdir -p ~/.legacy
+find * -type f -exec ln -sf %%DATADIR%%/{} ~/.legacy/{} \; || exit 1
+
+cd %%DMDIR%% || exit 1
+
+find * -type d -exec mkdir -p ~/.legacy/{} \; || exit 1
+find * -type f -exec ln -sf %%DMDIR%%/{} ~/.legacy/{} \; || exit 1
+
+cd ~/.legacy || exit 1
+
+exec ./lsdldoom -nocheckwadversion $*
diff --git a/games/doomlegacy/files/patch-makefile b/games/doomlegacy/files/patch-makefile
index 70ed1fa62696..8065bec76ad6 100644
--- a/games/doomlegacy/files/patch-makefile
+++ b/games/doomlegacy/files/patch-makefile
@@ -1,15 +1,19 @@
---- makefile.orig Fri Oct 3 15:11:05 2003
-+++ makefile Sun Mar 28 17:15:39 2004
-@@ -260,7 +260,7 @@
+--- 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
-+CC?=gcc
#if use PGCC or EGCS
PGCC=1
-@@ -407,7 +407,8 @@
+
+-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
@@ -19,7 +23,16 @@
# name of the exefile
EXENAME=llxdoom
SFLAGS=-g $(OPTS)
-@@ -428,7 +429,8 @@
+@@ -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/SDL11 -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
@@ -29,37 +42,58 @@
DEBUGLIBS=$(LIBS)
# name of the exefile
-@@ -555,13 +557,13 @@
+@@ -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) -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 += -fwritable-strings $(OPTS)
++ CFLAGS += $(OPTS)
endif
endif
-@@ -735,7 +737,7 @@
+@@ -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
++ $(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
-@@ -763,7 +765,7 @@
- $(CC) $(CFLAGS) $(LDFLAGS) $(WFLAGS) -I/usr/X11R6/include -c $< -o $@
+@@ -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
-+ $(CC) ${CFLAGS} -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
- endif #FBSD_SDL
- endif #FREEBSD
+ $(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-sndserv_Makefile b/games/doomlegacy/files/patch-sndserv_Makefile
new file mode 100644
index 000000000000..d7785de18d52
--- /dev/null
+++ b/games/doomlegacy/files/patch-sndserv_Makefile
@@ -0,0 +1,12 @@
+--- 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/files/patch-sndserver::Makefile b/games/doomlegacy/files/patch-sndserver::Makefile
deleted file mode 100644
index 9e7182fd2fbd..000000000000
--- a/games/doomlegacy/files/patch-sndserver::Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
---- linux_x/sndserv/Makefile.orig Thu Oct 2 15:42:17 2003
-+++ linux_x/sndserv/Makefile Thu Oct 2 15:42:40 2003
-@@ -21,8 +21,8 @@
- #
- #
-
--CC=gcc
--CFLAGS=-O2 -m486 -Wall -DNORMALUNIX -DLINUX
-+CC?=gcc
-+CFLAGS+=-Wall -DNORMALUNIX -DLINUX
- ifdef FREEBSD
- CFLAGS:=${CFLAGS} -DFREEBSD
- endif
diff --git a/games/doomlegacy/files/wrapper.sh b/games/doomlegacy/files/wrapper.sh
deleted file mode 100644
index df444e29468d..000000000000
--- a/games/doomlegacy/files/wrapper.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# Needed to make symlinks/shortcuts work.
-# Wrap lsdldoom binary
-cd %%INSTALLDIR%%
-./lsdldoom -nocheckwadversion $*
-exit $?
diff --git a/games/doomlegacy/pkg-message b/games/doomlegacy/pkg-message
deleted file mode 100644
index 4ed076ed641f..000000000000
--- a/games/doomlegacy/pkg-message
+++ /dev/null
@@ -1,14 +0,0 @@
-
-************************************************************
-Please read docs in
-
- %%PREFIX%%/share/doc/doomlegacy
-
-before you run the application.
-************************************************************
-Copy DOOM.WAD or other id iwads into
-
- %%PREFIX%%/doomlegacy
-
-************************************************************
-
diff --git a/games/doomlegacy/pkg-plist b/games/doomlegacy/pkg-plist
index bf2a8dc0eb47..17d4b60acd32 100644
--- a/games/doomlegacy/pkg-plist
+++ b/games/doomlegacy/pkg-plist
@@ -1,9 +1,8 @@
bin/legacy
-doomlegacy/legacy.dat
-doomlegacy/legacy.sh
-doomlegacy/llsndserv
-doomlegacy/lsdldoom
-doomlegacy/r_opengl.so
+%%DATADIR%%/legacy.dat
+%%DATADIR%%/llsndserv
+%%DATADIR%%/lsdldoom
+%%DATADIR%%/r_opengl.so
%%PORTDOCS%%%%DOCSDIR%%/3dfloors.html
%%PORTDOCS%%%%DOCSDIR%%/Doublescan.txt
%%PORTDOCS%%%%DOCSDIR%%/README_SDL
@@ -24,5 +23,5 @@ doomlegacy/r_opengl.so
%%PORTDOCS%%%%DOCSDIR%%/sound.cfg
%%PORTDOCS%%%%DOCSDIR%%/source.html
%%PORTDOCS%%%%DOCSDIR%%/Whatsnew.html
-@dirrm share/doc/doomlegacy
-@dirrm doomlegacy
+@dirrm %%DOCSDIR%%
+@dirrm %%DATADIR%%