From 839718038b8542e6b16ad3b915d20721418694d9 Mon Sep 17 00:00:00 2001 From: Alejandro Pulver Date: Mon, 18 Sep 2006 19:58:07 +0000 Subject: [PATCH] - Bump PORTREVISION. - Install wrapper script as PORTNAME (easier to find for users). - Rename directory from ~/.legacy to ~/.doomlegacy. - Do not use /usr/local, /usr/X11R6, /usr/local/include/SDL11 and -lSDL-1.1 directly. Use variables/command output instead. - Improve wrapper script: only create ~/.doomlegacy once, do not symlink WAD files since it looks in DOOMWADDIR (environment variable). - Remove ONLY_FOR_ARCHS=i386 (builds at least on amd64). PR: ports/103156 Approved by: maintainer (timeout) --- games/doomlegacy/Makefile | 19 ++++++++++++------- games/doomlegacy/files/legacy.in | 28 ++++++++++++++-------------- games/doomlegacy/pkg-plist | 2 +- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/games/doomlegacy/Makefile b/games/doomlegacy/Makefile index e0d07229c6a8..a474ff7ee4db 100644 --- a/games/doomlegacy/Makefile +++ b/games/doomlegacy/Makefile @@ -6,10 +6,9 @@ PORTNAME= doomlegacy PORTVERSION= 142 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= games -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= ${PORTNAME} +MASTER_SITES= SF DISTNAME= legacy_${PORTVERSION}_src DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${WADFILE} EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} @@ -19,8 +18,6 @@ COMMENT= DooM Legacy: popular DooM clone! EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip -ONLY_FOR_ARCHS= i386 - USE_GL= yes USE_GMAKE= yes USE_SDL= mixer sdl @@ -40,6 +37,14 @@ DATADIR= ${PREFIX}/lib/${PORTNAME} 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|${X11BASE}|' \ + ${WRKSRC}/${MAKEFILE} + pre-build: cd ${WRKSRC}/linux_x/sndserv && ${GMAKE} clean @@ -53,7 +58,7 @@ do-install: ${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 + ${INSTALL_SCRIPT} ${WRKDIR}/legacy ${PREFIX}/bin/${PORTNAME} post-install: .ifndef(NOPORTDOCS) @@ -67,7 +72,7 @@ post-install: .include -.if defined(WITH_X86_ASM) +.if defined(WITH_X86_ASM) && ${ARCH} == "i386" BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm MAKE_ARGS+= USEASM=1 .endif diff --git a/games/doomlegacy/files/legacy.in b/games/doomlegacy/files/legacy.in index d43a1a0165d5..731a6fde9a20 100644 --- a/games/doomlegacy/files/legacy.in +++ b/games/doomlegacy/files/legacy.in @@ -1,20 +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. +# files, libraries and executables. So we mirror the Doom Legacy data +# directory to ~/.doomlegacy, and create symlinks to the data files. -cd %%DATADIR%% || exit 1 +DOOMWADDIR="%%DMDIR%%"; export DOOMWADDIR -mkdir -p ~/.legacy -find * -type f -exec ln -sf %%DATADIR%%/{} ~/.legacy/{} \; || exit 1 +if [ -d ~/.doomlegacy ] +then + echo "Using existing ~/.doomlegacy directory." +else + echo "Creating ~/.doomlegacy directory." + cd %%DATADIR%% || exit 1 + find * -type d -exec mkdir -p ~/.doomlegacy/{} \; + find * -type f -exec ln -sf %%DATADIR%%/{} ~/.doomlegacy/{} \; +fi -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 $* +cd ~/.doomlegacy || exit 1 +exec ./lsdldoom -nocheckwadversion "$@" diff --git a/games/doomlegacy/pkg-plist b/games/doomlegacy/pkg-plist index 17d4b60acd32..6ee12a9408de 100644 --- a/games/doomlegacy/pkg-plist +++ b/games/doomlegacy/pkg-plist @@ -1,4 +1,4 @@ -bin/legacy +bin/doomlegacy %%DATADIR%%/legacy.dat %%DATADIR%%/llsndserv %%DATADIR%%/lsdldoom