diff --git a/emulators/Makefile b/emulators/Makefile index 7f52809d2c5b..b44c4738624a 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -1,189 +1,190 @@ COMMENT = Emulators for other operating systems SUBDIR += adamem SUBDIR += almostti SUBDIR += anese SUBDIR += aqemu SUBDIR += aranym SUBDIR += atari800 SUBDIR += bfe SUBDIR += bochs SUBDIR += bsvc SUBDIR += cannonball SUBDIR += catapult SUBDIR += cemu SUBDIR += cingb SUBDIR += citra SUBDIR += citra-qt5 SUBDIR += cpmemu SUBDIR += cpmtools SUBDIR += cpmtools2 SUBDIR += darcnes SUBDIR += dgen-sdl SUBDIR += dolphin-emu SUBDIR += dosbox SUBDIR += dosbox-staging SUBDIR += dosbox-x SUBDIR += dps8m SUBDIR += dynamips-community SUBDIR += edumips64 SUBDIR += elliott-803 SUBDIR += emu64 SUBDIR += emulationstation SUBDIR += fceux SUBDIR += fmsx SUBDIR += frodo SUBDIR += fs-uae SUBDIR += fs-uae-launcher SUBDIR += fuse SUBDIR += fuse-roms SUBDIR += fuse-utils SUBDIR += gbe SUBDIR += gens SUBDIR += gngb SUBDIR += gngeo SUBDIR += gxemul SUBDIR += hatari SUBDIR += hercules SUBDIR += higan SUBDIR += hugo SUBDIR += hv_kvp_cmd SUBDIR += ines SUBDIR += javatari SUBDIR += joytran SUBDIR += jzintv SUBDIR += kcemu SUBDIR += klh10 SUBDIR += lib765 SUBDIR += libc6-shim SUBDIR += libdsk + SUBDIR += libretro-mame SUBDIR += libretro-ppsspp SUBDIR += libretro-reicast SUBDIR += libretro-vice SUBDIR += libspectrum SUBDIR += linux-c7 SUBDIR += linux-power10-functional-sim SUBDIR += linux-power9-functional-sim SUBDIR += linux_base-c7 SUBDIR += lisaem SUBDIR += magia SUBDIR += mame SUBDIR += mastergear SUBDIR += mednafen SUBDIR += mesen SUBDIR += mess SUBDIR += mgba SUBDIR += mtools SUBDIR += mupen64plus SUBDIR += mupen64plus-audio-sdl SUBDIR += mupen64plus-core SUBDIR += mupen64plus-input-sdl SUBDIR += mupen64plus-plugins SUBDIR += mupen64plus-qt SUBDIR += mupen64plus-rsp-cxd4 SUBDIR += mupen64plus-rsp-hle SUBDIR += mupen64plus-rsp-z64 SUBDIR += mupen64plus-ui-console SUBDIR += mupen64plus-video-arachnoid SUBDIR += mupen64plus-video-glide64 SUBDIR += mupen64plus-video-glide64mk2 SUBDIR += mupen64plus-video-rice SUBDIR += mupen64plus-video-z64 SUBDIR += nemu SUBDIR += nestopia SUBDIR += o2em SUBDIR += ods2reader SUBDIR += open-vm-tools SUBDIR += openmsx SUBDIR += p5-Acme-6502 SUBDIR += parallels-tools SUBDIR += pcem SUBDIR += pcemu SUBDIR += pcsxr SUBDIR += ppsspp SUBDIR += ppsspp-qt5 SUBDIR += py-gns3-converter SUBDIR += py-unicorn SUBDIR += qemu SUBDIR += qemu-cheri SUBDIR += qemu-devel SUBDIR += qemu-guest-agent SUBDIR += qemu-powernv SUBDIR += qemu-user-static SUBDIR += qemu-user-static-devel SUBDIR += qemu5 SUBDIR += qemu6 SUBDIR += qmc2 SUBDIR += quasi88 SUBDIR += reicast SUBDIR += ripes SUBDIR += riscv-isa-sim SUBDIR += rpcs3 SUBDIR += rtc SUBDIR += rubygem-fission SUBDIR += sameboy SUBDIR += simh SUBDIR += simh-hp2100 SUBDIR += simh-hp3000 SUBDIR += simh-hpdoc SUBDIR += skyeye SUBDIR += snes9x-gtk SUBDIR += spim SUBDIR += stella SUBDIR += stonx SUBDIR += teo SUBDIR += tiemu3 SUBDIR += tilem SUBDIR += tme SUBDIR += tnylpo SUBDIR += tpm-emulator SUBDIR += tuxnes SUBDIR += uae SUBDIR += ucon64 SUBDIR += ukncbtl SUBDIR += unicorn SUBDIR += vba SUBDIR += vboxtool SUBDIR += vgb-bin SUBDIR += vgba-bin SUBDIR += vice SUBDIR += virtualbox-ose SUBDIR += virtualbox-ose-additions SUBDIR += virtualbox-ose-additions-legacy SUBDIR += virtualbox-ose-additions-nox11 SUBDIR += virtualbox-ose-additions-nox11-legacy SUBDIR += virtualbox-ose-kmod SUBDIR += virtualbox-ose-kmod-legacy SUBDIR += virtualbox-ose-legacy SUBDIR += virtualbox-ose-nox11 SUBDIR += virtualbox-ose-nox11-legacy SUBDIR += visualboyadvance-m SUBDIR += vmips SUBDIR += vmsbackup SUBDIR += vmw SUBDIR += vt100 SUBDIR += vxtools SUBDIR += wine SUBDIR += wine-devel SUBDIR += wine-gecko SUBDIR += wine-gecko-devel SUBDIR += wine-mono SUBDIR += wine-mono-devel SUBDIR += wine-proton SUBDIR += winetricks SUBDIR += x16-emulator SUBDIR += x16-rom SUBDIR += x48 SUBDIR += x49gp SUBDIR += xbraitenberg SUBDIR += xcpc SUBDIR += xen-kernel SUBDIR += xhomer SUBDIR += xsystem35 SUBDIR += xzx SUBDIR += yaze-ag SUBDIR += yuzu SUBDIR += z80pack SUBDIR += zsnes .include diff --git a/emulators/libretro-mame/Makefile b/emulators/libretro-mame/Makefile new file mode 100644 index 000000000000..5a94d1157be8 --- /dev/null +++ b/emulators/libretro-mame/Makefile @@ -0,0 +1,73 @@ +# Created by: Timothy Beyer + +PORTNAME= libretro-mame +PORTVERSION= 20220124 +CATEGORIES= emulators games + +MAINTAINER= beyert@cs.ucr.edu +COMMENT= MAME-current for libretro + +LICENSE= BSD2CLAUSE GPLv2 +LICENSE_COMB= multi + +USES= compiler:c++11-lib gl gmake pkgconfig python:3.7,build +USE_LDCONFIG= yes + +USE_GL= gl + +USE_GITHUB= yes +GH_ACCOUNT= libretro +GH_PROJECT= mame +GH_TAGNAME= ec47e94 + +MAKEFILE= ${WRKSRC}/Makefile.libretro + +MAKE_ENV= CXX="${CXX}" \ + LD="${CXX}" \ + OPT_FLAGS="${CXXFLAGS}" \ + PYTHON="${PYTHON_CMD}" \ + PYTHON_EXECUTABLE="${PYTHON_CMD}" + +GENIE= ${WRKSRC}/3rdparty/genie + +MAKE_JOBS_UNSAFE= yes + +PLIST_FILES= lib/libretro/mame_libretro.so + +post-patch: + @${RM} ${WRKSRC}/3rdparty/bx/include/compat/freebsd/dirent.h + @${RM} ${WRKSRC}/3rdparty/bx/include/compat/freebsd/signal.h + @${ECHO_CMD} ${MV} ${GENIE}/build/gmake.freebsd ${GENIE}/build/gmake.bsd + @${REINPLACE_CMD} -e \ + 's|^\(CC \)|#\1| ; \ + s|^\(CXX \)|#\1| ; \ + s|^\(CXX:\)|#\1| ; \ + s|^\(LD \)|#\1| ; \ + s|^\(PYTHON \)|#\1| ; \ + s| .(ARCH)|| ; \ + s|FreeBSD|${OPSYS}|g' \ + ${WRKSRC}/makefile \ + ${GENIE}/build/gmake.freebsd/genie.make + @${REINPLACE_CMD} -e 's|gcc|${CC}|; s|g++|${CXX}|' \ + ${GENIE}/src/tools/gcc.lua \ + ${GENIE}/src/tools/snc.lua \ + ${GENIE}/tests/test_gmake_cpp.lua + @${REINPLACE_CMD} -e 's|= \"gcc|= \"${CC}|; s|= \"${CXX}|= \"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}/scripts/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"|' + @${REINPLACE_CMD} -e 's|"util/png.h"|"util/localpng.h"|' \ + ${WRKSRC}/src/frontend/mame/ui/icorender.cpp + @${MV} ${WRKSRC}/src/lib/util/png.h ${WRKSRC}/src/lib/util/localpng.h + +do-install: + ${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro; + ${INSTALL_LIB} ${WRKSRC}/mame_libretro.so ${STAGEDIR}/${PREFIX}/lib/libretro; + +.include diff --git a/emulators/libretro-mame/distinfo b/emulators/libretro-mame/distinfo new file mode 100644 index 000000000000..c936ab53eea9 --- /dev/null +++ b/emulators/libretro-mame/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1644819807 +SHA256 (libretro-mame-20220124-ec47e94_GH0.tar.gz) = 36593def33266b9a6171338941743b6ef01865bc3b8f38e7ad0c6b84d971ed1b +SIZE (libretro-mame-20220124-ec47e94_GH0.tar.gz) = 183780588 diff --git a/emulators/libretro-mame/files/patch-makefile b/emulators/libretro-mame/files/patch-makefile new file mode 100644 index 000000000000..706100ba0799 --- /dev/null +++ b/emulators/libretro-mame/files/patch-makefile @@ -0,0 +1,20 @@ +--- makefile.orig 2021-04-12 15:53:19 UTC ++++ makefile +@@ -199,7 +199,7 @@ GENIEOS := solaris + endif + ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD) + OS := freebsd +-GENIEOS := bsd ++GENIEOS := freebsd + endif + ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD) + OS := freebsd +@@ -1083,7 +1083,7 @@ ifeq ($(NEW_GIT_VERSION),) + NEW_GIT_VERSION := unknown + endif + +-GENIE := 3rdparty/genie/bin/$(GENIEOS)/genie$(EXE) ++GENIE := 3rdparty/genie/bin/bsd/genie$(EXE) + + ifeq ($(TARGET),$(SUBTARGET_FULL)) + FULLTARGET := $(TARGET) diff --git a/emulators/libretro-mame/pkg-descr b/emulators/libretro-mame/pkg-descr new file mode 100644 index 000000000000..7972e0144d37 --- /dev/null +++ b/emulators/libretro-mame/pkg-descr @@ -0,0 +1,3 @@ +MAME -current for libretro + +WWW: https://github.com/libretro/mame