aboutsummaryrefslogtreecommitdiff
path: root/games/doomlegacy/Makefile
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2012-11-06 13:15:40 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2012-11-06 13:15:40 +0000
commite4d96b78dcf407b68ef9b2eae52b0e3de3eb429d (patch)
tree04099330d6b522ff055413ee8bcc6ea2e38df8af /games/doomlegacy/Makefile
parent5da32c1697e79eec7f006df01c3613dbfb6f1193 (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/Makefile')
-rw-r--r--games/doomlegacy/Makefile95
1 files changed, 44 insertions, 51 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>