aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/zsnes/Makefile
blob: e5137028c07697041ae52f8bf060ae1d73e7003d (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# New ports collection makefile for:    zsnes
# Date created:             Fri May  4 13:10:11 CEST 2001
# Whom:                 Stijn Hoop <stijn@win.tue.nl>
#
# $FreeBSD$
#

PORTNAME=   zsnes
PORTVERSION=    1.51
PORTREVISION=   2
PORTEPOCH=  1
CATEGORIES= emulators
MASTER_SITES=   SF
DISTNAME=   zsnes${PORTVERSION:S/.//}src

MAINTAINER= stsp@stsp.in-berlin.de
COMMENT=    Intel x86 only Super Nintendo Entertainment System (SNES) Emulator

# This must be >= 0.98!
BUILD_DEPENDS=  nasm:${PORTSDIR}/devel/nasm
LIB_DEPENDS=    png.5:${PORTSDIR}/graphics/png

# non-portable, for a portable emulator see emulators/snes9x
ONLY_FOR_ARCHS= i386

WRKSRC=     ${WRKDIR}/${PORTNAME}_${PORTVERSION:S/./_/}/src

OPTIONS=    X11 "Enable X11 video driver"   on  \
        OPENGL  "Enable OpenGL video driver"    off \
        DEBUGGER    "Enable ZSNES debugger" off \
        JMA "Enable JMA support"    on

USE_BZIP2=  yes
USE_SDL=    sdl
USE_GMAKE=  yes
GNU_CONFIGURE=  yes
CONFIGURE_ARGS+=    --disable-cpucheck
CONFIGURE_ENV=  CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
CONFIGURE_TARGET=   --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

MAN1=       zsnes.1
PLIST_FILES=    bin/zsnes

CFLAGS+=    -I${LOCALBASE}/include
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 602000
IGNORE=     needs zlib >= 1.2.3 ,it is available on FreeBSD >= 6.2
.endif

.if defined(WITH_DEBUGGER)
CONFIGURE_ARGS+=--enable-debugger
.else
CONFIGURE_ARGS+=--disable-debugger
.endif

.if defined(WITH_JMA)
CONFIGURE_ARGS+=--enable-jma
.else
CONFIGURE_ARGS+=--disable-jma
.endif

.if defined(WITHOUT_X11)
CONFIGURE_ARGS+=--without-x
PKGNAMESUFFIX=  -nox11
.else
CONFIGURE_ARGS+=--with-x
CFLAGS+=    -I${X11BASE}/include
CPPFLAGS+=  -I${X11BASE}/include
LDFLAGS+=   -L${X11BASE}/lib
.endif

.if defined(WITH_OPENGL)
USE_GL=     yes
CONFIGURE_ARGS+=--enable-opengl
.else
CONFIGURE_ARGS+=--disable-opengl
.endif

post-patch:
    @${REINPLACE_CMD} -e \
        's|@CXX@ @CFLAGS@ -o|@CXX@ @CXXFLAGS@ @CPPFLAGS@ -o|g ; \
         s|@CC@ @CFLAGS@ -o|@CC@ @CFLAGS@ @CPPFLAGS@ -o|g' \
            ${WRKSRC}/Makefile.in
    @${REINPLACE_CMD} -i "" -e \
        's|-O3||g' ${WRKSRC}/${CONFIGURE_SCRIPT}

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/zsnes ${PREFIX}/bin
    ${INSTALL_MAN} ${WRKSRC}/linux/zsnes.1 ${MANPREFIX}/man/man1

.include <bsd.port.post.mk>