summaryrefslogtreecommitdiff
path: root/emulators/bsnes/Makefile
blob: 6a896a490591b0f1f2aa6e2f8d627f86f5733100 (plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# New ports collection makefile for:    bsnes
# Date created:                         2009-06-13
# Whom:                                 elbarto
#
# $FreeBSD$

PORTNAME=	bsnes
PORTVERSION=	0.88
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
DISTNAME=	${PORTNAME}_v${PORTVERSION:S/.//}-source

MAINTAINER=	cyberbotx@cyberbotx.com
COMMENT=	Super Nintendo/Super Famicom emulator

USE_XZ=		yes
USE_GMAKE=	yes
USE_GNOME=	gtk20
USE_GCC=	4.6

ONLY_FOR_ARCHS=	i386 amd64
MAKE_ENV+=	c="${CC} -std=gnu99" cpp="${CXX} -std=gnu++0x" profile="performance"
USE_LDCONFIG=	yes

OPTIONS=	GUI_GTK "Build with GTK+ GUI" on \
		GUI_QT4 "Build with QT4 GUI" off \
		VIDEO_GLX "Build GLX Video Driver" on \
		VIDEO_XV "Build Xv Video Driver" on \
		VIDEO_SDL "Build SDL Video Driver" on \
		SOUND_OPENAL "Build OpenAL Sound Driver" off \
		SOUND_OSS "Build OSS Sound Driver" on \
		SOUND_PULSE "Build Pulseaudio Sound Driver" off \
		SOUND_AO "Build AO Sound Driver" off \
		INPUT_X "Build X Input Driver" on \
		INPUT_SDL "Build SDL Input Driver" on

.include <bsd.port.options.mk>

.if defined(WITH_GUI_GTK)
MAKE_ENV+=	phoenix="gtk"
.else
USE_QT_VER=	4
QT_COMPONENTS=	corelib gui
MAKE_ENV+=	phoenix="qt"
.endif

.if defined(WITH_VIDEO_GLX)
USE_GL+=	gl
VIDEO_DRIVER+=	video.glx
.endif

.if defined(WITH_VIDEO_XV)
USE_XORG+=	xv
VIDEO_DRIVER+=	video.xv
.endif

.if defined(WITH_VIDEO_SDL)
USE_XORG+=	xv
USE_SDL+=	sdl
VIDEO_DRIVER+=	video.sdl
.endif

.if defined(WITH_SOUND_OPENAL)
USE_OPENAL=	al
AUDIO_DRIVER+=	audio.openal
.endif

.if defined(WITH_SOUND_OSS)
AUDIO_DRIVER+=	audio.oss
.endif

.if defined(WITH_SOUND_PULSE)
LIB_DEPENDS+=	pulse.0:${PORTSDIR}/audio/pulseaudio
AUDIO_DRIVER+=	audio.pulseaudio
.endif

.if defined(WITH_SOUND_AO)
LIB_DEPENDS+=	ao.4:${PORTSDIR}/audio/libao
AUDIO_DRIVER+=	audio.ao
.endif

.if defined(WITH_INPUT_X)
INPUT_DRIVER+=	input.x
.endif

.if defined(WITH_INPUT_SDL)
USE_SDL+=	sdl
INPUT_DRIVER+=	input.sdl
.endif

.if !defined(WITH_GUI_GTK) && !defined(WITH_GUI_QT4)
IGNORE=	you have to choose a GUI
.endif
.if defined(WITH_GUI_GTK) && defined(WITH_GUI_QT4)
IGNORE=	you may only choose one GUI
.endif

.if !defined(VIDEO_DRIVER)
IGNORE=	you have to choose at least one video driver
.endif

.if !defined(AUDIO_DRIVER)
IGNORE=	you have to choose at least one audio driver
.endif

.if !defined(INPUT_DRIVER)
IGNORE=	you have to choose at least one input driver
.endif

post-patch:
	${REINPLACE_CMD} -e 's|VIDEO|${VIDEO_DRIVER}|' ${WRKSRC}/bsnes/target-ui/Makefile
	${REINPLACE_CMD} -e 's|AUDIO|${AUDIO_DRIVER}|' ${WRKSRC}/bsnes/target-ui/Makefile
	${REINPLACE_CMD} -e 's|INPUT|${INPUT_DRIVER}|' ${WRKSRC}/bsnes/target-ui/Makefile

do-build:
	(cd ${WRKSRC}/bsnes && ${GMAKE} ${MAKE_ENV})
	(cd ${WRKSRC}/purify && ${GMAKE} ${MAKE_ENV})

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/bsnes/out/bsnes ${PREFIX}/bin/
	${INSTALL_PROGRAM} ${WRKSRC}/purify/purify ${PREFIX}/bin/snespurify
	${MKDIR} ${PREFIX}/share/pixmaps
	${INSTALL_DATA} ${WRKSRC}/bsnes/data/bsnes.png ${PREFIX}/share/pixmaps/
	${MKDIR} ${PREFIX}/share/applications
	${INSTALL_DATA} ${WRKSRC}/bsnes/data/bsnes.desktop ${PREFIX}/share/applications/

.include <bsd.port.mk>