aboutsummaryrefslogtreecommitdiff
path: root/emulators/mame/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/mame/Makefile')
-rw-r--r--emulators/mame/Makefile148
1 files changed, 70 insertions, 78 deletions
diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile
index 65df05fd2cb1..c523d5b4f361 100644
--- a/emulators/mame/Makefile
+++ b/emulators/mame/Makefile
@@ -1,19 +1,13 @@
# Created by: alepulver
# $FreeBSD$
-PORTNAME= mame
-PORTVERSION= 0.154${PATCHSUFFIX}
-PORTREVISION= 2
+PORTNAME?= mame
+PORTVERSION= 0.161
+PORTREVISION?= 0
CATEGORIES= emulators
-MASTER_SITES= http://mamedev.mameworld.info/releases/ \
- http://emumovies.com/aarongiles/releases/ \
- http://mamedev.org/updates/:patchsets
-DISTFILES= mame${PORTVERSION:S/.//:C/p[0-9]*$//}s.zip \
- ${UPDATE_PATCHES:C/$/.zip:patchsets/}
-DIST_SUBDIR= mame
MAINTAINER= ports@FreeBSD.org
-COMMENT= Multi Arcade Machine Emulator
+COMMENT?= Multi Arcade Machine Emulator
LIB_DEPENDS= libFLAC.so:${PORTSDIR}/audio/flac \
libjpeg.so:${PORTSDIR}/graphics/jpeg \
@@ -23,108 +17,106 @@ RUN_DEPENDS= liberation-fonts-ttf>=0:${PORTSDIR}/x11-fonts/liberation-fonts-ttf
NOT_FOR_ARCHS= ia64 powerpc sparc64
-USES= dos2unix gmake pkgconfig python:2,build shebangfix
-DOS2UNIX_FILES= src/lib/lib7z/CpuArch.h \
- src/lib/lua/luaconf.h \
- src/osd/eigccx86.h \
- src/osd/eminline.h \
- src/osd/osdcore.c \
- src/osd/sdl/osinline.h \
- src/osd/sdl/sdlsync_ntc.c \
- src/osd/sdl/sdlsync_os2.c
+USE_GITHUB= yes
+GH_ACCOUNT= mamedev
+GH_PROJECT= mame # explicit (master port)
+GH_TAGNAME= mame${PORTVERSION:S/.//}
+
+# base clang fails with signal during build (!)
+USE_GCC= yes
+
+USES= gmake pkgconfig python:2,build shebangfix
SHEBANG_FILES= src/emu/cpu/m6502/m6502make.py \
src/emu/cpu/m6809/m6809make.py \
src/emu/cpu/mcs96/mcs96make.py \
- src/emu/cpu/tms57002/tmsmake.py
-USE_XORG= xext xi xinerama xrender
+ src/emu/cpu/tms57002/tmsmake.py \
+ src/build/*.py
+USE_XORG= xext xi xinerama xrender x11
USE_GL= gl
-NO_WRKSUBDIR= yes
+USE_SDL= sdl2 ttf2
+USE_QT4= gui moc_build qmake_build
+MTARGET?= mame
+CFLAGS+= -I${LOCALBASE}/include
MAKE_ENV= NOWERROR=1 USE_NETWORK=1 \
- LD="${CXX}" PYTHON="${PYTHON_CMD}" \
+ LD="${CXX}" PYTHON="${PYTHON_CMD}" SDL_LIBVER="sdl2" \
OPT_FLAGS="${CXXFLAGS}" GCC_LDFLAGS="${LDFLAGS}" \
- TARGET="mame" FULLNAME="mame" SDL_NETWORK="pcap"
-MAKE_ARGS= TARGETOS=freebsd
+ TARGET="${MTARGET}" FULLNAME="mame" SDL_NETWORK="pcap"
+MAKE_ARGS= TARGETOS=freebsd VERBOSE=1 TOOLS=1
MAKEFILE= makefile
+GENIE= ${WRKSRC}/3rdparty/genie
+PORTDOCS= *
+PORTEXAMPLES= ${MTARGET}.ini
-SUB_FILES= pkg-message
+SUB_FILES= pkg-message target.ini
+SUB_LIST= MTARGET=${MTARGET}
-OPTIONS_DEFINE= BUILTIN_DEBUGGER DEBUG DOCS EXAMPLES SDL2
-
-BUILTIN_DEBUGGER_DESC= Builtin debugger support
-BUILTIN_DEBUGGER_USE= QT4=gui,moc_build,qmake_build
-BUILTIN_DEBUGGER_MAKE_ENV_OFF=\
- NO_DEBUGGER=1 NO_USE_QTDEBUG=1
+OPTIONS_DEFINE= DEBUG DOCS EXAMPLES
DEBUG_MAKE_ENV= DEBUG=1
-SDL2_DESC= SDL2 libraries support
-SDL2_USE= SDL=sdl2,ttf2
-SDL2_MAKE_ENV= SDL_LIBVER="sdl2"
-
-PATCHLEVEL= # none
-
-.if defined(PATCHLEVEL) && ${PATCHLEVEL}
-PATCHSUFFIX= p${PATCHLEVEL}
-UPDATE_PATCHES!= /usr/bin/jot -s " " \
- -w ${PORTVERSION:S/.//:C/\.p[0-9]*$//}u%d_diff \
- ${PATCHLEVEL} 1 ${PATCHLEVEL}
-.endif
.include <bsd.port.options.mk>
-.if empty(PORT_OPTIONS:MSDL2)
-USE_SDL= sdl ttf
-.endif
-
.if ${ARCH} == amd64
MAKE_ARGS+= PTR64=1
+EMULATOR= ${MTARGET}64
+.else
+EMULATOR= ${MTARGET}
.endif
+PLIST_SUB= EMULATOR=${EMULATOR}
-.if ${OPSYS} == DragonFly
-EXTRA_PATCHES= ${FILESDIR}/extra-patch-src_osd_osdcore.c
-.endif
-
-post-extract:
- (cd ${WRKDIR} && ${TAR} -xf mame.zip)
- @${RM} -f ${WRKDIR}/mame.zip
-# Use post-extract target to get in before dos2unix-isation
-.if defined(UPDATE_PATCHES)
-. for patch in ${UPDATE_PATCHES:S/_/./}
- @${ECHO_MSG} -n "===> Applying upstream development patch ${patch}... "
- ${PATCH} ${PATCH_ARGS} < ${WRKSRC}/${patch}
- @${ECHO_MSG} "[DONE]"
-. endfor
+.if ${OPSYS} == FreeBSD && ${OSREL:R} == 8
+BROKEN= will not build on FreeBSD 8.x
.endif
post-patch:
@${REINPLACE_CMD} -e \
- 's|^\(BUILD_EXPAT \)|#\1| ; \
- s|^\(BUILD_ZLIB \)|#\1| ; \
- s|^\(BUILD_FLAC \)|#\1| ; \
- s|^\(BUILD_JPEGLIB \)|#\1| ; \
- s|^\(CC \)|#\1| ; \
+ 's|^\(CC \)|#\1| ; \
+ s|^\(CXX \)|#\1| ; \
s|^\(LD \)|#\1| ; \
s|^\(PYTHON \)|#\1| ; \
- s|-O$$(OPTIMIZE)|| ; \
- /--warn-common/s|= -Wl,|= $$(GCC_LDFLAGS) -Wl,| ; \
- /LDFLAGS/s|-s|| ; \
- /LIBS/s|-lstdc++||' ${WRKSRC}/makefile
- @${REINPLACE_CMD} -e \
- '/-isystem/s|^|#| ; \
- /X11R6/s|^|#|' ${WRKSRC}/src/osd/sdl/sdl.mak
+ s| .(ARCH)|| ; \
+ s|FreeBSD|${OPSYS}|g' \
+ ${WRKSRC}/makefile \
+ ${GENIE}/build/gmake.bsd/genie.make
+ @${REINPLACE_CMD} -e 's|gcc|cc|; s|g++|c++|' \
+ ${GENIE}/src/actions/codelite/codelite_project.lua \
+ ${GENIE}/src/tools/gcc.lua \
+ ${GENIE}/src/tools/snc.lua \
+ ${GENIE}/tests/test_gmake_cpp.lua
+ @${REINPLACE_CMD} -e 's|= \"gcc|= \"cc|; s|= \"g++|= \"c++|' \
+ -e "s|'CXX =|'#CXX =|; s|'CC =|'#CC =|; s| .(ARCH)| |g" \
+ ${GENIE}/src/host/scripts.c
+ # we can't fix two types of python shebangs, so do these manually
+ @${REINPLACE_CMD} -i "" -e "s|/usr/bin/env python|${PYTHON_CMD}|" \
+ ${WRKSRC}/src/build/png*.py
+ @${REINPLACE_CMD} -e 's|"python"|"${PYTHON_CMD}"|' \
+ ${WRKSRC}/scripts/genie.lua
+ @${GREP} -rl '"png.h"' ${WRKSRC}/src | ${XARGS} ${REINPLACE_CMD} \
+ -e 's|"png.h"|"localpng.h"|'
+ @${MV} ${WRKSRC}/src/lib/util/png.h ${WRKSRC}/src/lib/util/localpng.h
do-install:
@${MKDIR} ${STAGEDIR}${DATADIR} \
${STAGEDIR}${DOCSDIR} \
${STAGEDIR}${EXAMPLESDIR} \
- ${STAGEDIR}${PREFIX}/libexec/mame
- ${INSTALL_PROGRAM} ${WRKSRC}/mame ${STAGEDIR}${PREFIX}/bin
+ ${STAGEDIR}${PREFIX}/libexec/${MTARGET}
+ ${INSTALL_PROGRAM} ${WRKSRC}/${EMULATOR} ${STAGEDIR}${PREFIX}/bin
+.if ${MTARGET:Mmame}
(cd ${WRKSRC} && \
${INSTALL_PROGRAM} chdman jedutil ldresample ldverify \
- romcmp testkeys unidasm ${STAGEDIR}${PREFIX}/libexec/mame)
+ romcmp testkeys unidasm \
+ ${STAGEDIR}${PREFIX}/libexec/mame)
+.endif
+.if ${MTARGET:Mmess}
+ (cd ${WRKSRC} && ${INSTALL_PROGRAM} castool chdman imgtool jedutil \
+ ldresample ldverify romcmp testkeys unidasm \
+ ${STAGEDIR}${PREFIX}/libexec/mess)
+.endif
(cd ${WRKSRC} && ${COPYTREE_SHARE} artwork ${STAGEDIR}${DATADIR})
(cd ${WRKSRC} && ${COPYTREE_SHARE} hash ${STAGEDIR}${DATADIR})
(cd ${WRKSRC}/src/osd/sdl && \
${COPYTREE_SHARE} keymaps ${STAGEDIR}${DATADIR})
(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR})
- ${INSTALL_DATA} ${FILESDIR}/mame.ini ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKDIR}/target.ini \
+ ${STAGEDIR}${EXAMPLESDIR}/${MTARGET}.ini
.include <bsd.port.mk>