aboutsummaryrefslogtreecommitdiff
path: root/emulators/bsnes/Makefile
blob: 8987326ed2323a60e085927ac3f9272e88e0f62d (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
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
# New ports collection makefile for:    bsnes
# Date created:                         2009-06-13
# Whom:                                 elbarto
#
# $FreeBSD$

PORTNAME=	bsnes
PORTVERSION=	0.70
PORTREVISION=	1
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
DISTNAME=	${PORTNAME}_v${PORTVERSION:S/.//}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Super Nintendo/Super Famicom emulator

BROKEN=		does not compile

USE_BZIP2=	yes
USE_GMAKE=	yes
USE_XORG=	videoproto xv x11
USE_QT_VER=	4
QT_COMPONENTS=	qmake_build uic_build moc_build rcc_build gui
USE_GCC=	4.4+

ONLY_FOR_ARCHS=	i386 amd64
WRKSRC=		${WRKDIR}/
MAKE_ENV+=	moc=moc-qt4 c="${CC} -std=gnu99" cpp="${CXX} -std=gnu++0x"
USE_LDCONFIG=	yes

OPTIONS=	VIDEO_GLX "Build GLX Video Driver" on \
		VIDEO_XV "Build Xv Video Driver" on \
		VIDEO_SDL "Build SDL Video Driver" on \
		VIDEO_QT "Build QtImage Video Driver" off \
		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.pre.mk>

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

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

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

.if defined(WITH_VIDEO_QT)
VIDEO_DRIVER+=	video.qtimage
.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(VIDEO_DRIVER)
IGNORE=	you have to choose at least a video driver first
.endif

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

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

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

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

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/bsnes/out/bsnes ${PREFIX}/bin/
	${MKDIR} ${PREFIX}/share/pixmaps
	${INSTALL_DATA} ${WRKSRC}/bsnes/ui-qt/data/bsnes.png ${PREFIX}/share/pixmaps/
	${MKDIR} ${PREFIX}/share/applications
	${INSTALL_DATA} ${WRKSRC}/bsnes/ui-qt/data/bsnes.desktop ${PREFIX}/share/applications/
	${INSTALL_DATA} ${WRKSRC}/snesreader/libsnesreader.so ${PREFIX}/lib/
	${INSTALL_DATA} ${WRKSRC}/snesfilter/libsnesfilter.so ${PREFIX}/lib/
	${INSTALL_DATA} ${WRKSRC}/supergameboy/libsupergameboy.so ${PREFIX}/lib/

.include <bsd.port.post.mk>