aboutsummaryrefslogtreecommitdiff
path: root/emulators/libretro-flycast/Makefile
blob: 6b4a1454ab6c7cfc56cf476bc0411217daeb223b (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
# Created by: Timothy Beyer <beyert@cs.ucr.edu>

PORTNAME=	libretro-flycast
PORTVERSION=	0.20210608
PORTREVISION=	1
CATEGORIES=	emulators games

MAINTAINER=	beyert@cs.ucr.edu
COMMENT=	Standalone port of flycast to libretro

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/LICENSE

ONLY_FOR_ARCHS=	amd64 i386

LIB_DEPENDS+=	libao.so:audio/libao \
		libasound.so:audio/alsa-lib \
		libcurl.so:ftp/curl \
		libevdev.so:devel/libevdev \
		libpulse.so:audio/pulseaudio \
		libudev.so:devel/libudev-devd \
		libvulkan.so:graphics/vulkan-loader

USES=	compiler:c++11-lib dos2unix gl gmake pkgconfig xorg
USE_LDCONFIG=	yes

USE_GITHUB=	yes
GH_ACCOUNT=	libretro
GH_PROJECT=	flycast
GH_TAGNAME=	8e4fa54e

USE_GL+=	egl gl glew glu

CFLAGS+=	-I${LOCALBASE}/include
CXXFLAGS+=	-I${LOCALBASE}/include

.include <bsd.port.pre.mk>

DOS2UNIX_FILES=	core/hw/bba/rtl8139c.h

.if ${ARCH} == amd64
CFLAGS+=	-DLOW_END
CXXFLAGS+=	-DLOW_END
.endif

LDFLAGS+=	-L${LOCALBASE}/lib
MAKE_ARGS=	HAVE_GENERIC_JIT=0 \
		HAVE_VULKAN=0

.if ${ARCH} == amd64
MAKE_ARGS+=	WITH_DYNAREC=x86_64
.elif ${ARCH} == i386
MAKE_ARGS+=	WITH_DYNAREC=x86
USE_BINUTILS=	yes
LDFLAGS+=	-Wl,-z,notext
.endif

PLIST_FILES=	lib/libretro/flycast_libretro.so

post-patch:
	@${REINPLACE_CMD} 's|/usr/local|${PREFIX}|' \
		${WRKSRC}/Makefile

do-install:
	@${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro;
	${INSTALL_LIB} ${WRKSRC}/flycast_libretro.so \
		${STAGEDIR}/${PREFIX}/lib/libretro/flycast_libretro.so;

.include <bsd.port.post.mk>