diff options
author | John Marino <marino@FreeBSD.org> | 2014-10-05 09:37:16 +0000 |
---|---|---|
committer | John Marino <marino@FreeBSD.org> | 2014-10-05 09:37:16 +0000 |
commit | 638412fe350e07314b11b09e9a60cfeb0307a222 (patch) | |
tree | 8a34c5501131a46ce00834f03ca435f0921876c2 /emulators/mame | |
parent | - Allow staging as a regular user (diff) |
emulators/mame: clean up, remove zip dependency, support DragonFly
This port has a post-extract target that wants to use native unzip
on an extracted file. This is an issue for DragonFly, but tar can
handle the zip file just file on both platforms, so switch to that.
DragonFly still has the incomplete FILE that it inherited from FreeBSD,
which is really a pain when FILE is a parameter in c++ routines. This
adds an extra patch for DragonFly to use an alternative default logging
callbacks to all mame to finally build on this platform.
While here:
- remove use of ${PORTNAME} where "mame" is the only correct value
- use ".zip" instead of extract variable
- Unmask installation commands
- Group mkdir commands into one
- Use NOT_FOR_ARCHS instead of conditional BROKEN
- Convert to USES=python
- Remove unnecessary conversion of -lpthread => -pthread
Notes
Notes:
svn path=/head/; revision=370047
Diffstat (limited to 'emulators/mame')
-rw-r--r-- | emulators/mame/Makefile | 62 | ||||
-rw-r--r-- | emulators/mame/files/extra-patch-src_osd_osdcore.c | 63 |
2 files changed, 94 insertions, 31 deletions
diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile index 4c166fd7ec10..decd70c5ee14 100644 --- a/emulators/mame/Makefile +++ b/emulators/mame/Makefile @@ -8,9 +8,9 @@ CATEGORIES= emulators MASTER_SITES= http://mamedev.mameworld.info/releases/ \ http://emumovies.com/aarongiles/releases/ \ http://mamedev.org/updates/:patchsets -DISTFILES= ${PORTNAME}${PORTVERSION:S/.//:C/p[0-9]*$//}s${EXTRACT_SUFX} \ +DISTFILES= mame${PORTVERSION:S/.//:C/p[0-9]*$//}s.zip \ ${UPDATE_PATCHES:C/$/.zip:patchsets/} -DIST_SUBDIR= ${PORTNAME} +DIST_SUBDIR= mame MAINTAINER= ports@FreeBSD.org COMMENT= Multi Arcade Machine Emulator @@ -21,13 +21,14 @@ LIB_DEPENDS= libFLAC.so:${PORTSDIR}/audio/flac \ libfontconfig.so:${PORTSDIR}/x11-fonts/fontconfig RUN_DEPENDS= liberation-fonts-ttf>=0:${PORTSDIR}/x11-fonts/liberation-fonts-ttf -NO_WRKSUBDIR= yes +NOT_FOR_ARCHS= ia64 powerpc sparc64 -USES= dos2unix gmake pkgconfig shebangfix zip +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 @@ -37,12 +38,12 @@ SHEBANG_FILES= src/emu/cpu/m6502/m6502make.py \ src/emu/cpu/tms57002/tmsmake.py USE_XORG= xext xi xinerama xrender USE_GL= gl -USE_PYTHON_BUILD=2 +NO_WRKSUBDIR= yes MAKE_ENV= NOWERROR=1 USE_NETWORK=1 \ LD="${CXX}" PYTHON="${PYTHON_CMD}" \ OPT_FLAGS="${CXXFLAGS}" GCC_LDFLAGS="${LDFLAGS}" \ - TARGET="${PORTNAME}" FULLNAME="${PORTNAME}" \ - SDL_NETWORK="pcap" + TARGET="mame" FULLNAME="mame" SDL_NETWORK="pcap" +MAKE_ARGS= TARGETOS=freebsd MAKEFILE= makefile SUB_FILES= pkg-message @@ -73,19 +74,22 @@ UPDATE_PATCHES!= /usr/bin/jot -s " " \ USE_SDL= sdl ttf .endif -.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64" -BROKEN= Does not install on ia64, powerpc, or sparc64 +.if ${ARCH} == amd64 +MAKE_ARGS+= PTR64=1 +.endif + +.if ${OPSYS} == DragonFly +EXTRA_PATCHES= ${FILESDIR}/extra-patch-src_osd_osdcore.c .endif post-extract: - @(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} mame.zip \ - ${EXTRACT_AFTER_ARGS}) + (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} + ${PATCH} ${PATCH_ARGS} < ${WRKSRC}/${patch} @${ECHO_MSG} "[DONE]" . endfor .endif @@ -102,29 +106,25 @@ post-patch: s|-O$$(OPTIMIZE)|| ; \ /--warn-common/s|= -Wl,|= $$(GCC_LDFLAGS) -Wl,| ; \ /LDFLAGS/s|-s|| ; \ - /LIBS/s|-lstdc++|| ; \ - /LIBS/s|-lpthread|-pthread|' ${WRKSRC}/makefile + /LIBS/s|-lstdc++||' ${WRKSRC}/makefile @${REINPLACE_CMD} -e \ - '/LIBS/s|-lpthread|-pthread| ; \ - /-isystem/s|^|#| ; \ + '/-isystem/s|^|#| ; \ /X11R6/s|^|#|' ${WRKSRC}/src/osd/sdl/sdl.mak do-install: - (cd ${WRKSRC} && ${INSTALL_PROGRAM} ${PORTNAME} \ - ${STAGEDIR}${PREFIX}/bin) - @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME} -.for F in chdman jedutil ldresample ldverify romcmp testkeys unidasm - (cd ${WRKSRC} && ${INSTALL_PROGRAM} ${F} \ - ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}) -.endfor - @${MKDIR} ${STAGEDIR}${DATADIR} - @(cd ${WRKSRC} && ${COPYTREE_SHARE} artwork ${STAGEDIR}${DATADIR}) - @(cd ${WRKSRC} && ${COPYTREE_SHARE} hash ${STAGEDIR}${DATADIR}) - @(cd ${WRKSRC}/src/osd/sdl && ${COPYTREE_SHARE} keymaps \ - ${STAGEDIR}${DATADIR}) - @${MKDIR} ${STAGEDIR}${DOCSDIR} - @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}) - @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + @${MKDIR} ${STAGEDIR}${DATADIR} \ + ${STAGEDIR}${DOCSDIR} \ + ${STAGEDIR}${EXAMPLESDIR} \ + ${STAGEDIR}${PREFIX}/libexec/mame + ${INSTALL_PROGRAM} ${WRKSRC}/mame ${STAGEDIR}${PREFIX}/bin + (cd ${WRKSRC} && \ + ${INSTALL_PROGRAM} chdman jedutil ldresample ldverify \ + romcmp testkeys unidasm ${STAGEDIR}${PREFIX}/libexec/mame) + (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}) (cd ${FILESDIR} && ${INSTALL_DATA} mame.ini ${STAGEDIR}${EXAMPLESDIR}) .include <bsd.port.mk> diff --git a/emulators/mame/files/extra-patch-src_osd_osdcore.c b/emulators/mame/files/extra-patch-src_osd_osdcore.c new file mode 100644 index 000000000000..0892d35e5366 --- /dev/null +++ b/emulators/mame/files/extra-patch-src_osd_osdcore.c @@ -0,0 +1,63 @@ +--- src/osd/osdcore.c.orig 2014-10-05 09:30:10 UTC ++++ src/osd/osdcore.c +@@ -2,6 +2,10 @@ + #include "osdcore.h" + #include "portmidi/portmidi.h" + ++typedef struct __FILE_public FILEX; ++FILEX dummyval; ++FILEX * dummy = &dummyval; ++ + bool g_print_verbose = false; + + +@@ -10,9 +14,14 @@ bool g_print_verbose = false; + for file output + -------------------------------------------------*/ + +-void osd_file_output_callback(FILE *param, const char *format, va_list argptr) ++void osd_file_std_output_callback(FILEX *param, const char *format, va_list argptr) ++{ ++ vfprintf(stdout, format, argptr); ++} ++ ++void osd_file_err_output_callback(FILEX *param, const char *format, va_list argptr) + { +- vfprintf(param, format, argptr); ++ vfprintf(stderr, format, argptr); + } + + +@@ -21,7 +30,7 @@ void osd_file_output_callback(FILE *para + for no output + -------------------------------------------------*/ + +-void osd_null_output_callback(FILE *param, const char *format, va_list argptr) ++void osd_null_std_output_callback(FILEX *param, const char *format, va_list argptr) + { + } + +@@ -30,16 +39,16 @@ void osd_null_output_callback(FILE *para + /* output channels */ + static output_delegate output_cb[OSD_OUTPUT_CHANNEL_COUNT] = + { +- output_delegate(FUNC(osd_file_output_callback), stderr), // OSD_OUTPUT_CHANNEL_ERROR +- output_delegate(FUNC(osd_file_output_callback), stderr), // OSD_OUTPUT_CHANNEL_WARNING +- output_delegate(FUNC(osd_file_output_callback), stdout), // OSD_OUTPUT_CHANNEL_INFO ++ output_delegate(FUNC(osd_file_err_output_callback), dummy), // OSD_OUTPUT_CHANNEL_ERROR ++ output_delegate(FUNC(osd_file_err_output_callback), dummy), // OSD_OUTPUT_CHANNEL_WARNING ++ output_delegate(FUNC(osd_file_std_output_callback), dummy), // OSD_OUTPUT_CHANNEL_INFO + #ifdef MAME_DEBUG +- output_delegate(FUNC(osd_file_output_callback), stdout), // OSD_OUTPUT_CHANNEL_DEBUG ++ output_delegate(FUNC(osd_file_std_output_callback), dummy), // OSD_OUTPUT_CHANNEL_DEBUG + #else +- output_delegate(FUNC(osd_null_output_callback), stdout), // OSD_OUTPUT_CHANNEL_DEBUG ++ output_delegate(FUNC(osd_null_std_output_callback), dummy), // OSD_OUTPUT_CHANNEL_DEBUG + #endif +- output_delegate(FUNC(osd_file_output_callback), stdout), // OSD_OUTPUT_CHANNEL_VERBOSE +- output_delegate(FUNC(osd_file_output_callback), stdout) // OSD_OUTPUT_CHANNEL_LOG ++ output_delegate(FUNC(osd_file_std_output_callback), dummy), // OSD_OUTPUT_CHANNEL_VERBOSE ++ output_delegate(FUNC(osd_file_std_output_callback), dummy) // OSD_OUTPUT_CHANNEL_LOG + }; + + |