aboutsummaryrefslogtreecommitdiffstats
path: root/games/doom/Makefile
blob: 3ddc7827a44af2662ea6840d93a7cde2aee7497d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# $FreeBSD$
# Created by:   Jean-Marc Zucconi <jmz@FreeBSD.org>

PORTNAME=   doom
PORTVERSION=    1.10
PORTREVISION=   5
CATEGORIES= games
MASTER_SITES=   ${MASTER_SITE_IDSOFTWARE:S|$|source/|}
DISTNAME=   doomsrc

MAINTAINER= c.petrik.sosa@gmail.com
COMMENT=    DOOM: the game and the sound server

LICENSE=    GPLv1

NO_CDROM=   requested by IDsoftware

ONLY_FOR_ARCHS= i386

USE_GMAKE=  yes
USE_ZIP=    yes
USE_XORG=   x11 sm xextproto xext
NO_WRKSUBDIR=   yes

DATADIR=    ${DMDIR}

post-extract:
    @cd ${WRKDIR} && ${TAR} xzf linuxdoom-1.10.src.tgz && ${TAR} xzf sndserv.tgz

post-patch:
    ${REINPLACE_CMD} 's|<linux/soundcard.h>|<sys/soundcard.h>|g'\
            ${WRKSRC}/sndserv/linux.c \
            ${WRKSRC}/linuxdoom-1.10/i_sound.c
    ${REINPLACE_CMD} 's|<errnos.h>|<errno.h>|g' \
            ${WRKSRC}/linuxdoom-1.10/i_video.c
    ${REINPLACE_CMD} 's|#include  <alloca.h>|//#include  <alloca.h>|g'\
            ${WRKSRC}/linuxdoom-1.10/r_data.c
    ${REINPLACE_CMD} 's|#include <alloca.h>|//#include <alloca.h>|g'\
            ${WRKSRC}/linuxdoom-1.10/w_wad.c
    ${REINPLACE_CMD} 's|<malloc.c>|<stdlib.h>|g'\
            ${WRKSRC}/linuxdoom-1.10/w_wad.c \
            ${WRKSRC}/sndserv/soundsrv.c \
            ${WRKSRC}/sndserv/wadread.c
    ${REINPLACE_CMD} 's|<values.h>|<limits.h>|g'\
            ${WRKSRC}/linuxdoom-1.10/m_bbox.h \
            ${WRKSRC}/linuxdoom-1.10/doomtype.h
    ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g'\
            ${WRKSRC}/linuxdoom-1.10/Makefile
    @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} \
        -E -e 's|#include +<malloc.h>|#include <stdlib.h>|g'

do-build:
    @cd ${WRKDIR}/linuxdoom-1.10 && ${GMAKE} X11BASE=${LOCALBASE}
    @cd ${WRKDIR}/sndserv && ${GMAKE}

do-install:
    @${MKDIR} ${PREFIX}/libexec/doom
    @${INSTALL_PROGRAM} ${WRKDIR}/linuxdoom-1.10/linux/linuxxdoom ${PREFIX}/libexec/doom/xdoom
    @${INSTALL_PROGRAM} ${WRKDIR}/sndserv/linux/sndserver ${PREFIX}/libexec/doom/sndserver
    @(${ECHO_CMD} "#!${SH}"; ${ECHO_CMD} "cd ${PREFIX}/libexec/doom"; \
      ${ECHO_CMD} 'export PATH=.:$$PATH';${ECHO_CMD} "export DOOMWADDIR=${DATADIR}"; ${ECHO_CMD} "./xdoom $$*") > ${PREFIX}/bin/doom
    @${CHMOD} ugo+x ${PREFIX}/bin/doom

.include "${.CURDIR}/../doom-data/Makefile.include"

.include <bsd.port.mk>