Added
Link Here
|
1 |
# Created by: Timothy Beyer <beyert@cs.ucr.edu> |
2 |
|
3 |
PORTNAME= libretro-mame |
4 |
PORTVERSION= 20220124 |
5 |
CATEGORIES= emulators games |
6 |
|
7 |
MAINTAINER= beyert@cs.ucr.edu |
8 |
COMMENT= MAME-current for libretro |
9 |
|
10 |
LICENSE= GPLv2 BSD2CLAUSE |
11 |
LICENSE_COMB= multi |
12 |
|
13 |
USES= compiler:c++11-lib gl gmake python:3.7,build pkgconfig |
14 |
USE_LDCONFIG= yes |
15 |
|
16 |
USE_GL= gl |
17 |
|
18 |
USE_GITHUB= yes |
19 |
GH_ACCOUNT= libretro |
20 |
GH_PROJECT= mame |
21 |
GH_TAGNAME= ec47e94 |
22 |
|
23 |
MAKEFILE= ${WRKSRC}/Makefile.libretro |
24 |
|
25 |
MAKE_ENV= LD="${CXX}" PYTHON="${PYTHON_CMD}" OPT_FLAGS="${CXXFLAGS}" \ |
26 |
CXX="${CXX}" PYTHON_EXECUTABLE="${PYTHON_CMD}" |
27 |
|
28 |
GENIE= ${WRKSRC}/3rdparty/genie |
29 |
|
30 |
MAKE_JOBS_UNSAFE= yes |
31 |
|
32 |
PLIST_FILES= lib/libretro/mame_libretro.so |
33 |
|
34 |
post-patch: |
35 |
@${RM} ${WRKSRC}/3rdparty/bx/include/compat/freebsd/dirent.h |
36 |
@${RM} ${WRKSRC}/3rdparty/bx/include/compat/freebsd/signal.h |
37 |
@${ECHO_CMD} ${MV} ${GENIE}/build/gmake.freebsd ${GENIE}/build/gmake.bsd |
38 |
@${REINPLACE_CMD} -e \ |
39 |
's|^\(CC \)|#\1| ; \ |
40 |
s|^\(CXX \)|#\1| ; \ |
41 |
s|^\(CXX:\)|#\1| ; \ |
42 |
s|^\(LD \)|#\1| ; \ |
43 |
s|^\(PYTHON \)|#\1| ; \ |
44 |
s| .(ARCH)|| ; \ |
45 |
s|FreeBSD|${OPSYS}|g' \ |
46 |
${WRKSRC}/makefile \ |
47 |
${GENIE}/build/gmake.freebsd/genie.make |
48 |
@${REINPLACE_CMD} -e 's|gcc|${CC}|; s|g++|${CXX}|' \ |
49 |
${GENIE}/src/tools/gcc.lua \ |
50 |
${GENIE}/src/tools/snc.lua \ |
51 |
${GENIE}/tests/test_gmake_cpp.lua |
52 |
@${REINPLACE_CMD} -e 's|= \"gcc|= \"${CC}|; s|= \"${CXX}|= \"c++|' \ |
53 |
-e "s|'CXX =|'#CXX =|; s|'CC =|'#CC =|; s| .(ARCH)| |g" \ |
54 |
${GENIE}/src/host/scripts.c |
55 |
# we can't fix two types of python shebangs, so do these manually |
56 |
@${REINPLACE_CMD} -i "" -e "s|/usr/bin/env python|${PYTHON_CMD}|" \ |
57 |
${WRKSRC}/scripts/build/png*.py |
58 |
@${REINPLACE_CMD} -e 's|"python"|"${PYTHON_CMD}"|' \ |
59 |
${WRKSRC}/scripts/genie.lua |
60 |
@${GREP} -rl '"png.h"' ${WRKSRC}/src | ${XARGS} ${REINPLACE_CMD} \ |
61 |
-e 's|"png.h"|"localpng.h"|' |
62 |
@${REINPLACE_CMD} -e 's|"util/png.h"|"util/localpng.h"|' \ |
63 |
${WRKSRC}/src/frontend/mame/ui/icorender.cpp |
64 |
@${MV} ${WRKSRC}/src/lib/util/png.h ${WRKSRC}/src/lib/util/localpng.h |
65 |
|
66 |
do-install: |
67 |
${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro; |
68 |
${INSTALL_LIB} ${WRKSRC}/mame_libretro.so ${STAGEDIR}/${PREFIX}/lib/libretro; |
69 |
|
70 |
.include <bsd.port.mk> |