aboutsummaryrefslogtreecommitdiffstats
path: root/games/retroarch/Makefile
blob: f768e4f5cb9280aa93adc016fb820d5129032d0c (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
# Created by: Yuri Victorovich <yuri@rawbw.com>
# $FreeBSD$

PORTNAME=   RetroArch
PORTVERSION=    1.3.6
DISTVERSIONPREFIX=  v
PORTREVISION=   3
CATEGORIES= games

MAINTAINER= yuri@rawbw.com
COMMENT=    Cross-platform entertainment system based on libretro API

LICENSE=    GPLv3
LICENSE_FILE=   ${WRKSRC}/COPYING

LIB_DEPENDS=    libxkbcommon.so:x11/libxkbcommon \
        libdrm.so:graphics/libdrm \
        libass.so:multimedia/libass

OPTIONS_DEFINE= FFMPEG OSS JACK PULSEAUDIO ALSA SDL OPENGL OPENAL NETPLAY PYTHON V4L FREETYPE FBO
OPTIONS_DEFAULT=FFMPEG OSS PULSEAUDIO SDL OPENGL OPENAL NETPLAY PYTHON V4L FREETYPE FBO
FFMPEG_DESC=    On-the-fly recording of gameplay with libavcodec
NETPLAY_DESC=   Peer-to-peer netplay
PYTHON_DESC=    Script support in shaders
FBO_DESC=   OpenGL render-to-texture

FFMPEG_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg
FFMPEG_CONFIGURE_ENABLE=ffmpeg
OSS_CONFIGURE_ENABLE=   oss
JACK_LIB_DEPENDS=   libjack.so:audio/jack
JACK_CONFIGURE_ENABLE=  jack
PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
PULSEAUDIO_CONFIGURE_ENABLE=    pulse
ALSA_LIB_DEPENDS=   libasound.so:audio/alsa-lib
ALSA_CONFIGURE_ENABLE=  alsa
SDL_USE=        SDL=sdl2 image2
SDL_CONFIGURE_ON=   --disable-sdl --enable-sdl2
SDL_CONFIGURE_OFF=  --disable-sdl --disable-sdl2
OPENGL_USE=     GL=gl,egl,gbm
OPENGL_CONFIGURE_ENABLE=opengl
OPENAL_USES=        openal:soft
OPENAL_CONFIGURE_ENABLE=al
NETPLAY_CONFIGURE_ENABLE=   netplay
PYTHON_CONFIGURE_ENABLE=python
PYTHON_USES=        python:3
V4L_LIB_DEPENDS=    libv4l2.so:multimedia/libv4l
V4L_BUILD_DEPENDS=  v4l_compat>0:multimedia/v4l_compat
V4L_CONFIGURE_ENABLE=   v4l2
FREETYPE_LIB_DEPENDS=   libfreetype.so:print/freetype2
FREETYPE_CONFIGURE_ENABLE=  freetype
FBO_CONFIGURE_ENABLE=   fbo

CFLAGS+=    -pthread
LDFLAGS+=   -pthread
CONFIGURE_ARGS+=--enable-threads
CONFIGURE_ENV+= MAN_DIR=${MANPREFIX}/man

USE_GITHUB= yes
GH_ACCOUNT= libretro

SUB_FILES=  pkg-message
GNU_CONFIGURE=  yes
CONFIGURE_ARGS+=--global-config-dir=${LOCALBASE}/etc
USES=       compiler:c++11-lib gmake pkgconfig
USE_XORG=   x11 xcb xext xinerama xv xxf86vm

post-patch:
    @${REINPLACE_CMD} -e 's|<malloc.h>|<stdlib.h>|' \
        ${WRKSRC}/camera/drivers/video4linux2.c \
        ${WRKSRC}/gfx/drivers/*.c \
        ${WRKSRC}/libretro-common/libco/armeabi.c \
        ${WRKSRC}/memory/wii/mem2_manager.c
    @${REINPLACE_CMD} -e 's|<asm/types.h>|<sys/types.h>|' \
        ${WRKSRC}/camera/drivers/video4linux2.c
    @${REINPLACE_CMD} -e '/^add_define_make DYLIB_LIB/s|$$|;\
        add_include_dirs ${LOCALBASE}/include;\
        add_library_dirs ${LOCALBASE}/lib| ; \
        /^check_lib OSS_LIB/d' \
        ${WRKSRC}/qb/config.libs.sh

post-install:
    @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/retroarch
    @${REINPLACE_CMD} -e 's|# libretro_directory =|libretro_directory = "${PREFIX}/libexec/libretro"|' \
        ${STAGEDIR}${PREFIX}/etc/retroarch.cfg

.include <bsd.port.mk>