Date: Tue, 6 Nov 2012 13:15:40 +0000 (UTC) From: Alexey Dokuchaev <danfe@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r307068 - in head/games/doomlegacy: . files Message-ID: <201211061315.qA6DFeLG066907@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: danfe Date: Tue Nov 6 13:15:40 2012 New Revision: 307068 URL: http://svnweb.freebsd.org/changeset/ports/307068 Log: 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 :( Added: head/games/doomlegacy/files/patch-Makefile (contents, props changed) head/games/doomlegacy/files/patch-sdl+i_system.c (contents, props changed) Deleted: head/games/doomlegacy/files/patch-byteptr.h head/games/doomlegacy/files/patch-i_sound.c head/games/doomlegacy/files/patch-i_tcp.c head/games/doomlegacy/files/patch-makefile head/games/doomlegacy/files/patch-sndserv_Makefile Modified: head/games/doomlegacy/Makefile head/games/doomlegacy/distinfo head/games/doomlegacy/pkg-descr Modified: head/games/doomlegacy/Makefile ============================================================================== --- head/games/doomlegacy/Makefile Tue Nov 6 12:49:10 2012 (r307067) +++ head/games/doomlegacy/Makefile Tue Nov 6 13:15:40 2012 (r307068) @@ -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 -DATADIR= ${PREFIX}/lib/${PORTNAME} -SUB_FILES= legacy +MAKE_ENV= OLD_DEPENDENCIES=1 # since .dep file is removed +CFLAGS+= -DSVN_REV=\\\"${SVN_REV}\\\" +WRKSRC= ${WRKDIR}/${PORTNAME}_${DISTVERSION:S/.//}/src -WADFILE= legacy_dat.zip +PLIST_FILES= bin/${PORTNAME} share/doom/legacy.wad +PORTDOCS= * -.include "${.CURDIR}/../doom-data/Makefile.include" +SVN_REV= 845 + +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> Modified: head/games/doomlegacy/distinfo ============================================================================== --- head/games/doomlegacy/distinfo Tue Nov 6 12:49:10 2012 (r307067) +++ head/games/doomlegacy/distinfo Tue Nov 6 13:15:40 2012 (r307068) @@ -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 Added: head/games/doomlegacy/files/patch-Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/doomlegacy/files/patch-Makefile Tue Nov 6 13:15:40 2012 (r307068) @@ -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 + Added: head/games/doomlegacy/files/patch-sdl+i_system.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/doomlegacy/files/patch-sdl+i_system.c Tue Nov 6 13:15:40 2012 (r307068) @@ -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 Modified: head/games/doomlegacy/pkg-descr ============================================================================== --- head/games/doomlegacy/pkg-descr Tue Nov 6 12:49:10 2012 (r307067) +++ head/games/doomlegacy/pkg-descr Tue Nov 6 13:15:40 2012 (r307068) @@ -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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211061315.qA6DFeLG066907>