aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorpi <pi@FreeBSD.org>2015-11-16 03:09:01 +0800
committerpi <pi@FreeBSD.org>2015-11-16 03:09:01 +0800
commit22a6c192e8b8d28b4a7a0b55b2ed3f38f953f53f (patch)
tree1702981df1fbe35bde07f0c9baa6405dc6790912 /games
parent6c88eeda5cffab0ef9f8e5a74b3acecefb397034 (diff)
downloadfreebsd-ports-gnome-22a6c192e8b8d28b4a7a0b55b2ed3f38f953f53f.tar.gz
freebsd-ports-gnome-22a6c192e8b8d28b4a7a0b55b2ed3f38f953f53f.tar.zst
freebsd-ports-gnome-22a6c192e8b8d28b4a7a0b55b2ed3f38f953f53f.zip
New port: games/libretro-cores
This is the core pack for RetroArch. Mostly these cores are intended for playing/interpreting the retrogames. They are for the most part distributed by the Libretro organization, and are usually licensed under GPL. WWW: http://www.libretro.com/ PR: 204452 Submitted by: yuri@rawbw.com
Diffstat (limited to 'games')
-rw-r--r--games/Makefile1
-rw-r--r--games/libretro-cores/Makefile140
-rw-r--r--games/libretro-cores/distinfo108
-rw-r--r--games/libretro-cores/files/patch-CATSFC-libretro_Makefile13
-rw-r--r--games/libretro-cores/files/patch-beetle-bsnes-libretro_Makefile11
-rw-r--r--games/libretro-cores/files/patch-bsnes-libretro_Makefile11
-rw-r--r--games/libretro-cores/files/patch-bsnes-libretro_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-bsnes-libretro_nall_Makefile11
-rw-r--r--games/libretro-cores/files/patch-bsnes-libretro_nall_platform.hpp15
-rw-r--r--games/libretro-cores/files/patch-bsnes-libretro_target-libretro_Makefile11
-rw-r--r--games/libretro-cores/files/patch-desmume_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-emux_Makefile.freebsd9
-rw-r--r--games/libretro-cores/files/patch-emux_libretro_Makefile.bsd91
-rw-r--r--games/libretro-cores/files/patch-fba__cores__cps1_makefile.libretro10
-rw-r--r--games/libretro-cores/files/patch-fba__cores__cps2_makefile.libretro10
-rw-r--r--games/libretro-cores/files/patch-gambatte-libretro_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-hatari_Makefile.libretro10
-rw-r--r--games/libretro-cores/files/patch-libretro-fba_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-libretro-fba_makefile.libretro10
-rw-r--r--games/libretro-cores/files/patch-libretro-fceumm_src_general.c20
-rw-r--r--games/libretro-cores/files/patch-mame2014-libretro_3rdparty_genie_build_gmake.linux_genie.make20
-rw-r--r--games/libretro-cores/files/patch-mame2014-libretro_3rdparty_mongoose_test_Makefile11
-rw-r--r--games/libretro-cores/files/patch-mame2014-libretro_Makefile60
-rw-r--r--games/libretro-cores/files/patch-mame2014-libretro_src_osd_modules_sync_sync__retro.c20
-rw-r--r--games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrodir.c17
-rw-r--r--games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrofile.c72
-rw-r--r--games/libretro-cores/files/patch-meteor-libretro_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-mgba_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-nestopia_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-nxengine-libretro_Makefile10
-rw-r--r--games/libretro-cores/files/patch-pcsx__rearmed_Makefile.libretro10
-rw-r--r--games/libretro-cores/files/patch-scummvm_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-snes9x_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-snes9x_libretro_Makefile11
-rw-r--r--games/libretro-cores/files/patch-vbam-libretro_Makefile.freebsd5
-rw-r--r--games/libretro-cores/files/patch-vbam-libretro_src_gba_GBALink.cpp14
-rw-r--r--games/libretro-cores/files/patch-yabause_Makefile.freebsd5
-rw-r--r--games/libretro-cores/pkg-descr6
38 files changed, 787 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index 6bb8ad8cb856..72c981a5a349 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -518,6 +518,7 @@
SUBDIR += libkmahjongg
SUBDIR += libmaitretarot
SUBDIR += libmt_client
+ SUBDIR += libretro-cores
SUBDIR += libshhcards
SUBDIR += lightsoff
SUBDIR += lincity
diff --git a/games/libretro-cores/Makefile b/games/libretro-cores/Makefile
new file mode 100644
index 000000000000..7cffc3c0b50d
--- /dev/null
+++ b/games/libretro-cores/Makefile
@@ -0,0 +1,140 @@
+# Created by: Yuri Victorovich <yuri@rawbw.com>
+# $FreeBSD$
+
+PORTNAME= libretro-cores
+PORTVERSION= 0.20151110
+CATEGORIES= games
+
+MAINTAINER= yuri@rawbw.com
+COMMENT= Core pack for RetroArch
+
+BUILD_DEPENDS= cmake:${PORTSDIR}/devel/cmake
+
+ONLY_FOR_ARCHS= i386 amd64
+
+# core list (complete list that libretro distributes: http://buildbot.libretro.com/nightly/linux/x86_64/latest/)
+ALL_CORES+= libretro:libretro-2048:2048:d69235a:x
+ALL_CORES+= libretro:4do-libretro:4do:cbd700e:x
+ALL_CORES+= libretro:blueMSX-libretro:bluemsx:ee4ff9c:x
+ALL_CORES+= libretro:bsnes-libretro:bsnes:ee95143:accuracy,balanced,performance
+ALL_CORES+= libretro:CATSFC-libretro:catsfc:5907687:x
+ALL_CORES+= libretro:desmume:desmume:cae5945:x
+ALL_CORES+= libretro:Dinothawr:dinothawr:b49d969:x
+ALL_CORES+= libretro:dosbox-libretro:dosbox:bc5d578:x
+ALL_CORES+= libretro:emux:emux:be9022b:chip8,gb,nes,sms
+ALL_CORES+= libretro:fba_cores_cps1:fb_alpha_cps1:5614a9a:x
+ALL_CORES+= libretro:fba_cores_cps2:fb_alpha_cps2:f806c77:x
+ALL_CORES+= libretro:libretro-fba:fba:ddc9955:x
+ALL_CORES+= libretro:libretro-fceumm:fceumm:70ee9e6:x
+ALL_CORES+= libretro:fmsx-libretro:fmsx:4651948:x
+ALL_CORES+= libretro:fuse-libretro:fuse:c871953:x
+ALL_CORES+= libretro:gambatte-libretro:gambatte:59fb6a6:x
+ALL_CORES+= libretro:Genesis-Plus-GX:genesis_plus_gx:7d8d5f1:x
+ALL_CORES+= libretro:gpsp:gpsp:f1d14fb:x
+ALL_CORES+= libretro:gw-libretro:gw:95e3c4d:x
+ALL_CORES+= libretro:libretro-handy:handy:13d86fb:x
+ALL_CORES+= libretro:hatari:hatari:204dc6e:x
+ALL_CORES+= libretro:imageviewer-libretro:imageviewer:ae1465c:x
+#ALL_CORES+= libretro:mame:mame:a9d5a09:x BROKEN: missing file: https://github.com/libretro/mame/issues/38
+ALL_CORES+= libretro:mame2014-libretro:mame2014:6d370c1:x
+ALL_CORES+= libretro:beetle-gba-libretro:mednafen_gba:5110115:x
+ALL_CORES+= libretro:beetle-lynx-libretro:mednafen_lynx:a29513a:x
+ALL_CORES+= libretro:beetle-ngp-libretro:mednafen_ngp:f18354e:x
+ALL_CORES+= libretro:beetle-pce-fast-libretro:mednafen_pce_fast:6e2eaf7:x
+ALL_CORES+= libretro:beetle-pcfx-libretro:mednafen_pcfx:5b62ae8:x
+ALL_CORES+= libretro:beetle-psx-libretro:mednafen_psx:83b4b48:x
+ALL_CORES+= libretro:beetle-bsnes-libretro:mednafen_snes:7d9be82:x
+ALL_CORES+= libretro:beetle-supergrafx-libretro:mednafen_supergrafx:c6d3488:x
+ALL_CORES+= libretro:beetle-vb-libretro:mednafen_vb:085e0b6:x
+ALL_CORES+= libretro:beetle-wswan-libretro:mednafen_wswan:b850831:x
+ALL_CORES+= libretro:meteor-libretro:meteor:38b10c0:x
+ALL_CORES+= mgba-emu:mgba:mgba:b3d08ec:x
+#ALL_CORES+= libretro:mupen64plus-libretro:mupen64plus:7db9296:x BROKEN: needs GLES,GL....
+ALL_CORES+= libretro:nestopia:nestopia:dcaed96:x
+ALL_CORES+= libretro:nxengine-libretro:nxengine:4723600:x
+ALL_CORES+= libretro:libretro-o2em:o2em:c54042e:x
+ALL_CORES+= libretro:pcsx_rearmed:pcsx_rearmed:ce36c10:x
+ALL_CORES+= libretro:picodrive:picodrive:e912fdf:x
+#ALL_CORES+= libretro:pocketsnes-libretro:pocketsnes:5339c79:x BROKEN: asm
+#ALL_CORES+= libretro:libretro-ppsspp:ppsspp:ea17e27:x BROKEN: requires multiple distfiles?
+ALL_CORES+= libretro:libretro-prboom:prboom:d34af3f:x
+ALL_CORES+= libretro:prosystem-libretro:prosystem:7c8059c:x
+ALL_CORES+= libretro:QuickNES_Core:quicknes:518638b:x
+#ALL_CORES+= libretro:libretro-remotejoy:remotejoy:2e99718:x BROKEN: needs linux USB, is this linux-only?
+ALL_CORES+= libretro:scummvm:scummvm:c3e719a:x
+ALL_CORES+= libretro:snes9x:snes9x:ccf1ee2:x
+ALL_CORES+= libretro:snes9x-next:snes9x_next:dfb7eef:x
+ALL_CORES+= libretro:stella-libretro:stella:96619e4:x
+ALL_CORES+= libretro:tgbdual-libretro:tgbdual:b1bf294:x
+ALL_CORES+= libretro:tyrquake:tyrquake:8261e19:x
+#ALL_CORES+= libretro:libretro-uae:uae:7cbc230:x BROKEN: compile error https://github.com/libretro/libretro-uae/issues/4
+ALL_CORES+= libretro:vba-next:vba_next:0c20cd9:x
+ALL_CORES+= libretro:vbam-libretro:vbam:bedddba:x
+ALL_CORES+= libretro:libretro-vecx:vecx:be67ef1:x
+ALL_CORES+= libretro:virtualjaguar-libretro:virtualjaguar:ffec5c7:x
+ALL_CORES+= libretro:yabause:yabause:b121882:x
+
+# variables that depend on ALL_CORES
+MASTER_SITES= ${ALL_CORES:@CORE@https://codeload.github.com/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\1,}/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\2,}/tar.gz/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\4,}?dummy=/:${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}@}
+DISTFILES= ${ALL_CORES:@CORE@${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\1,}-${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\2,}-v${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\4,}_GH0.tar.gz:${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}@}
+CORE_DIRS_HASH= ${ALL_CORES:@CORE@${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\2,}-${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\4,}@}
+CORE_DIRS= ${ALL_CORES:@CORE@${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\2,}@}
+#PLIST_FILES= ${ALL_CORES:@CORE@libexec/libretro/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}_libretro.so@}
+PLIST_FILES= ${ALL_CORES:@CORE@${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\5,:S/,/ /g:@A@libexec/libretro/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}_${A}_libretro.so@}@:S/_x_libretro/_libretro/g}
+GIT_REV= ${ALL_CORES:@CORE@GIT_REV_${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}=`git ls-remote https://github.com/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\1,}/${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\2,}.git | ${GREP} HEAD | ${SED} -E "s/^(.......).*/\\1/g"` && @}
+GIT_REV_ECHO= ${ALL_CORES:@CORE@echo "GIT_REV_${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}=\$${GIT_REV_${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}}" && @}
+GIT_REV_CHANGE= ${ALL_CORES:@CORE@if [ "${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\4,}" != "\$${GIT_REV_${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}}" ]; then echo "upstream revision changed: core=${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,} old=${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\4,} new=\$${GIT_REV_${CORE:C,^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*),\3,}}"; fi && @}
+
+WRKSRC= ${WRKDIR}/all-cores
+
+USES= compiler:c++11-lib dos2unix gmake lua:53 python:2
+USE_LDCONFIG= yes
+USE_GL= gl
+DOS2UNIX_FILES= hatari/Makefile.libretro
+
+.include <bsd.port.pre.mk>
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000
+BROKEN= does not build for 9.X and earlier (various reasons)
+.endif
+
+post-extract:
+ @${MKDIR} ${WRKSRC}
+ @for dir in ${CORE_DIRS_HASH}; do \
+ ${MV} ${WRKDIR}/$${dir} ${WRKSRC}/`echo $${dir} | ${SED} -E 's/^(.*)\-.......$//\\1/g'`; \
+ done;
+
+do-build:
+ @for dir in ${CORE_DIRS}; do \
+ ${ECHO_MSG} "===> Building for ${PKGNAME}: core $${dir} (`date`)"; \
+ if [ -f ${WRKSRC}/$${dir}/Makefile.freebsd ]; then \
+ (cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} Makefile.freebsd ${_MAKE_JOBS} ${MAKE_ARGS}); \
+ elif [ -f ${WRKSRC}/$${dir}/Makefile.libretro ]; then \
+ (cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} Makefile.libretro ${_MAKE_JOBS} ${MAKE_ARGS}); \
+ else \
+ (cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} Makefile ${_MAKE_JOBS} ${MAKE_ARGS}); \
+ fi; \
+ done;
+
+do-install:
+ @${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ @for dir in ${CORE_DIRS}; do \
+ ${CP} $$(find ${WRKSRC}/$${dir} -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro/; \
+ done;
+ @if [ -n "${STRIP}" ]; then \
+ ${STRIP_CMD} ${STAGEDIR}/${PREFIX}/libexec/libretro/*.so; \
+ fi
+
+print-upstream-revisions:
+ @${ECHO} "--begin print upstream revisions--" && \
+ ${GIT_REV} \
+ ${GIT_REV_ECHO} \
+ ${ECHO} "--end print upstream revisions--"
+
+print-updated-revisions:
+ @${ECHO} "--begin print updated revisions--" && \
+ ${GIT_REV} \
+ ${GIT_REV_CHANGE} \
+ ${ECHO} "--end print updated revisions--"
+
+.include <bsd.port.post.mk>
diff --git a/games/libretro-cores/distinfo b/games/libretro-cores/distinfo
new file mode 100644
index 000000000000..e661956103ac
--- /dev/null
+++ b/games/libretro-cores/distinfo
@@ -0,0 +1,108 @@
+SHA256 (libretro-libretro-2048-vd69235a_GH0.tar.gz) = cdbb3e39ef70cf96434491bd28ed8057ed1c5157d39be2f381cbc0ace33422f5
+SIZE (libretro-libretro-2048-vd69235a_GH0.tar.gz) = 2681285
+SHA256 (libretro-4do-libretro-vcbd700e_GH0.tar.gz) = d11f2bdf41db507c94e1bbbed01cbfea5c69389922cda5013a1edf12f5320454
+SIZE (libretro-4do-libretro-vcbd700e_GH0.tar.gz) = 89043
+SHA256 (libretro-blueMSX-libretro-vee4ff9c_GH0.tar.gz) = 70f36e94737428859452bef673074b283cd3663f01c8327d9b1104ae98770a1e
+SIZE (libretro-blueMSX-libretro-vee4ff9c_GH0.tar.gz) = 2401332
+SHA256 (libretro-bsnes-libretro-vee95143_GH0.tar.gz) = d9485f98d4ecde4364696f57a4b72c5e3272450f26a8ad09c4f358a95f3046da
+SIZE (libretro-bsnes-libretro-vee95143_GH0.tar.gz) = 1254575
+SHA256 (libretro-CATSFC-libretro-v5907687_GH0.tar.gz) = d5f72a5f40d6fb70efd2d4599b07a64209f37450cf910e9fff03649b22054ae4
+SIZE (libretro-CATSFC-libretro-v5907687_GH0.tar.gz) = 373347
+SHA256 (libretro-desmume-vcae5945_GH0.tar.gz) = 6763e5167ed245c75686facf9b9722969e339dd7f9b073ea1a3c720e28c58185
+SIZE (libretro-desmume-vcae5945_GH0.tar.gz) = 2112170
+SHA256 (libretro-Dinothawr-vb49d969_GH0.tar.gz) = a9f00834a84a4c41b33848bcc2c6d7726df81f17f92864e3d8a85f8b88571198
+SIZE (libretro-Dinothawr-vb49d969_GH0.tar.gz) = 6547335
+SHA256 (libretro-dosbox-libretro-vbc5d578_GH0.tar.gz) = 139d376bd367045767df7f0640902d97d96bce690048f7d3079de5a831f2ee3e
+SIZE (libretro-dosbox-libretro-vbc5d578_GH0.tar.gz) = 1183334
+SHA256 (libretro-emux-vbe9022b_GH0.tar.gz) = fa64a21371f2617c819502f71992989e6bcddde53b1c26edf85900addddb6472
+SIZE (libretro-emux-vbe9022b_GH0.tar.gz) = 171134
+SHA256 (libretro-fba_cores_cps1-v5614a9a_GH0.tar.gz) = 3bf217e9fb5032c6bc6087473386078fd5d853ea2eb59c6b43bdf4da7f412ef8
+SIZE (libretro-fba_cores_cps1-v5614a9a_GH0.tar.gz) = 1081153
+SHA256 (libretro-fba_cores_cps2-vf806c77_GH0.tar.gz) = 0bfea9aa0cdb1d1ce5cc94de3fd23f6fd39882023c72667f46d60f77de509a7a
+SIZE (libretro-fba_cores_cps2-vf806c77_GH0.tar.gz) = 854972
+SHA256 (libretro-libretro-fba-vddc9955_GH0.tar.gz) = ff211ffc6e2ee950b2c2c74aac9b19d9f2d071611c1b1b7c019a7d6b3474a1d8
+SIZE (libretro-libretro-fba-vddc9955_GH0.tar.gz) = 7655337
+SHA256 (libretro-libretro-fceumm-v70ee9e6_GH0.tar.gz) = 015eb4c229a8e71a929b164a363f2099fc7eaab8e1aeed1d5dd2b0c733185e67
+SIZE (libretro-libretro-fceumm-v70ee9e6_GH0.tar.gz) = 385028
+SHA256 (libretro-fmsx-libretro-v4651948_GH0.tar.gz) = 8df8c7637e4ff9d4ad93fef4531c1fa5797a07c57c53b44e6f316efabf5a765a
+SIZE (libretro-fmsx-libretro-v4651948_GH0.tar.gz) = 531605
+SHA256 (libretro-fuse-libretro-vc871953_GH0.tar.gz) = 80ca38b6f3d9d668d416b359dacb14ce37373e9e7fd812560643defb182d449f
+SIZE (libretro-fuse-libretro-vc871953_GH0.tar.gz) = 4311923
+SHA256 (libretro-gambatte-libretro-v59fb6a6_GH0.tar.gz) = 7cc7d1084b39cd5b09d31849f852859a96d5ce1e90c05e0a0c5132418f313cd2
+SIZE (libretro-gambatte-libretro-v59fb6a6_GH0.tar.gz) = 154552
+SHA256 (libretro-Genesis-Plus-GX-v7d8d5f1_GH0.tar.gz) = 27531cf061f46ae3fc17b6316a48c878d5b8da8361107f4d6760b057e4c02ec4
+SIZE (libretro-Genesis-Plus-GX-v7d8d5f1_GH0.tar.gz) = 5711794
+SHA256 (libretro-gpsp-vf1d14fb_GH0.tar.gz) = 8bca47c9fd772357b5722adfc140586717a7834f099979b68f8310f330bb47dd
+SIZE (libretro-gpsp-vf1d14fb_GH0.tar.gz) = 258360
+SHA256 (libretro-gw-libretro-v95e3c4d_GH0.tar.gz) = 1a1d948d50a90b23e8dc82e6cc11765e8368c8061c7c763b49f73839e1367276
+SIZE (libretro-gw-libretro-v95e3c4d_GH0.tar.gz) = 3448370
+SHA256 (libretro-libretro-handy-v13d86fb_GH0.tar.gz) = 1198e14f16af20efc89dcee898e580c938c7e1a0c114e781a988f88f78eb6f52
+SIZE (libretro-libretro-handy-v13d86fb_GH0.tar.gz) = 96496
+SHA256 (libretro-hatari-v204dc6e_GH0.tar.gz) = 54076d3099a24d464e0ea6ac03cc71bfc84344a495ec545a27ec66e8c02daca0
+SIZE (libretro-hatari-v204dc6e_GH0.tar.gz) = 2735110
+SHA256 (libretro-imageviewer-libretro-vae1465c_GH0.tar.gz) = 7d638f812acc630938d4b512e21ef686163a1ebd63d8fca8eafd2c1b9c901f40
+SIZE (libretro-imageviewer-libretro-vae1465c_GH0.tar.gz) = 80001
+SHA256 (libretro-mame2014-libretro-v6d370c1_GH0.tar.gz) = 0da4adc412feed25335ad4a01515185f2633ef3397ef58548c1160cad9e3dedc
+SIZE (libretro-mame2014-libretro-v6d370c1_GH0.tar.gz) = 84559250
+SHA256 (libretro-beetle-gba-libretro-v5110115_GH0.tar.gz) = 0e421771c6b79ba5acef03f5e43fe834cb4b320e6f9afc5a21a7bd124045b39d
+SIZE (libretro-beetle-gba-libretro-v5110115_GH0.tar.gz) = 202956
+SHA256 (libretro-beetle-lynx-libretro-va29513a_GH0.tar.gz) = a288880d18529c962d92b45cb2265125e18bb930b86f0db4e1a10d7077ebb941
+SIZE (libretro-beetle-lynx-libretro-va29513a_GH0.tar.gz) = 172021
+SHA256 (libretro-beetle-ngp-libretro-vf18354e_GH0.tar.gz) = 996407c5ba17c46b9b35c4f1519cf040bc6493d22c6c9a890068e6219d7a8e42
+SIZE (libretro-beetle-ngp-libretro-vf18354e_GH0.tar.gz) = 196355
+SHA256 (libretro-beetle-pce-fast-libretro-v6e2eaf7_GH0.tar.gz) = b7a8be5a41d9f82e82c3237993b4d424c9389f7996a74de45e6f3b2023873ca3
+SIZE (libretro-beetle-pce-fast-libretro-v6e2eaf7_GH0.tar.gz) = 366978
+SHA256 (libretro-beetle-pcfx-libretro-v5b62ae8_GH0.tar.gz) = 92472d9bd2132646db5693e1a70c5299b6e47895c9e20abe274281a6a9996e41
+SIZE (libretro-beetle-pcfx-libretro-v5b62ae8_GH0.tar.gz) = 485807
+SHA256 (libretro-beetle-psx-libretro-v83b4b48_GH0.tar.gz) = fcc199577e4d539fcd375083edf328f0844318f2c8f066419f90b7bd1a888c31
+SIZE (libretro-beetle-psx-libretro-v83b4b48_GH0.tar.gz) = 444614
+SHA256 (libretro-beetle-bsnes-libretro-v7d9be82_GH0.tar.gz) = 2133ee6afef2be455f6dd230e858f0188e199ee6696319910d3328a117da414a
+SIZE (libretro-beetle-bsnes-libretro-v7d9be82_GH0.tar.gz) = 506584
+SHA256 (libretro-beetle-supergrafx-libretro-vc6d3488_GH0.tar.gz) = 620386fecfb02ec8126e3375b7869892002374c1c2ed93d7d0930c04dddbf73e
+SIZE (libretro-beetle-supergrafx-libretro-vc6d3488_GH0.tar.gz) = 378180
+SHA256 (libretro-beetle-vb-libretro-v085e0b6_GH0.tar.gz) = 92bc807fd7448ea01c6b9a292def205eb4d0294b54fb61c2f2129f718d1516fe
+SIZE (libretro-beetle-vb-libretro-v085e0b6_GH0.tar.gz) = 201233
+SHA256 (libretro-beetle-wswan-libretro-vb850831_GH0.tar.gz) = 53f2c11e9d860abce2552cfc26659c57bc1e6c6b7147744b56db2b8dd33542b2
+SIZE (libretro-beetle-wswan-libretro-vb850831_GH0.tar.gz) = 175725
+SHA256 (libretro-meteor-libretro-v38b10c0_GH0.tar.gz) = b11895884474f0f8caee06795c146f0d387e33b22ded769542fd440b8dc8bd31
+SIZE (libretro-meteor-libretro-v38b10c0_GH0.tar.gz) = 241351
+SHA256 (mgba-emu-mgba-vb3d08ec_GH0.tar.gz) = fd6bbdff1d912478121c8c20f8bc1a3b23daa7e59dbfd0a943b4b303639dc6dd
+SIZE (mgba-emu-mgba-vb3d08ec_GH0.tar.gz) = 4801675
+SHA256 (libretro-nestopia-vdcaed96_GH0.tar.gz) = 33c69807e37b422fbd47d96b50748b87eb7d4d5577f1f9b4b93038bcb701ab4b
+SIZE (libretro-nestopia-vdcaed96_GH0.tar.gz) = 1271711
+SHA256 (libretro-nxengine-libretro-v4723600_GH0.tar.gz) = 52d3694e2939d2efed0fd9a6f3df1f2afbae506f7dcb1959f782ef984d097799
+SIZE (libretro-nxengine-libretro-v4723600_GH0.tar.gz) = 2693820
+SHA256 (libretro-libretro-o2em-vc54042e_GH0.tar.gz) = 4e458a9b2cc51e06bfe351c1715118fb497bfd1518781dabf43940fae5e638e2
+SIZE (libretro-libretro-o2em-vc54042e_GH0.tar.gz) = 66521
+SHA256 (libretro-pcsx_rearmed-vce36c10_GH0.tar.gz) = ed894d4259fd5af6e144a777ab52be0184d5d92a99c1abd58fb4adad633be101
+SIZE (libretro-pcsx_rearmed-vce36c10_GH0.tar.gz) = 1186011
+SHA256 (libretro-picodrive-ve912fdf_GH0.tar.gz) = b13acc5014ecd157ca3929abb96a50ee3ab0fba6a6fb5124fd9d1bcaa0699e1e
+SIZE (libretro-picodrive-ve912fdf_GH0.tar.gz) = 1376528
+SHA256 (libretro-libretro-prboom-vd34af3f_GH0.tar.gz) = d4e0d2564100cda30d93002fb0d2791c26c06c07e28fc17abc46a543140a992e
+SIZE (libretro-libretro-prboom-vd34af3f_GH0.tar.gz) = 1080987
+SHA256 (libretro-prosystem-libretro-v7c8059c_GH0.tar.gz) = c8cc2a4b98e7b686cd45f52e4ad60e56bb50ae4eee3f3d5d63a97ea9360b0c37
+SIZE (libretro-prosystem-libretro-v7c8059c_GH0.tar.gz) = 58782
+SHA256 (libretro-QuickNES_Core-v518638b_GH0.tar.gz) = 8e91e905f803e249073d57d64498eef205183d96e277d71479a4bbe6a1824835
+SIZE (libretro-QuickNES_Core-v518638b_GH0.tar.gz) = 138482
+SHA256 (libretro-scummvm-vc3e719a_GH0.tar.gz) = 1e7d8bdbf9afd8c4f5aaf190a7c7de0e3017e9c28bda90c6c5d82837eb27fb78
+SIZE (libretro-scummvm-vc3e719a_GH0.tar.gz) = 23890636
+SHA256 (libretro-snes9x-vccf1ee2_GH0.tar.gz) = 7f91ab799d9f858775796fba251e3294a3cd3524c72b36f0e3e61f4fe0fe0769
+SIZE (libretro-snes9x-vccf1ee2_GH0.tar.gz) = 2133927
+SHA256 (libretro-snes9x-next-vdfb7eef_GH0.tar.gz) = 1769ba9bd0dd4c65d0a8ba2d8fba50874beb89e5d8a116f2cbe0552c4b321c52
+SIZE (libretro-snes9x-next-vdfb7eef_GH0.tar.gz) = 384239
+SHA256 (libretro-stella-libretro-v96619e4_GH0.tar.gz) = 2cecd7ee012868e305bbd4edc6878b47247ce7ea6ae62ce93b48b8b880870b77
+SIZE (libretro-stella-libretro-v96619e4_GH0.tar.gz) = 747535
+SHA256 (libretro-tgbdual-libretro-vb1bf294_GH0.tar.gz) = 56687ab994dbb6dc4414cacb85d046722580a3065d3afc92f905a2eeed4c9d75
+SIZE (libretro-tgbdual-libretro-vb1bf294_GH0.tar.gz) = 109789
+SHA256 (libretro-tyrquake-v8261e19_GH0.tar.gz) = cc9faaa2d1b7b84ba9355189590c10138b5eff5bfed0dbb5910bf069dacc3f61
+SIZE (libretro-tyrquake-v8261e19_GH0.tar.gz) = 574800
+SHA256 (libretro-vba-next-v0c20cd9_GH0.tar.gz) = 7510dd83fc0ac9c4bf2c9a4191da9559aec7aef496a73b30ba84565dbbf2f059
+SIZE (libretro-vba-next-v0c20cd9_GH0.tar.gz) = 135874
+SHA256 (libretro-vbam-libretro-vbedddba_GH0.tar.gz) = 45db639102f7fcd8a339f014909a1d971e200d9a3488a54f5733a8cee5e088bb
+SIZE (libretro-vbam-libretro-vbedddba_GH0.tar.gz) = 1237355
+SHA256 (libretro-libretro-vecx-vbe67ef1_GH0.tar.gz) = 0cbb52d9365fd0b788ac94aa48953f3ce6ee134f81749c7588640fb3df84be1e
+SIZE (libretro-libretro-vecx-vbe67ef1_GH0.tar.gz) = 111874
+SHA256 (libretro-virtualjaguar-libretro-vffec5c7_GH0.tar.gz) = 498204de6d4fad904708902f7959398a9b1b7315307ed8bcf677325898a8a6d6
+SIZE (libretro-virtualjaguar-libretro-vffec5c7_GH0.tar.gz) = 1026441
+SHA256 (libretro-yabause-vb121882_GH0.tar.gz) = 769b0898fc58d4da4541026359b56ef827b50081218d28116c6927f62d81ebc6
+SIZE (libretro-yabause-vb121882_GH0.tar.gz) = 2168003
diff --git a/games/libretro-cores/files/patch-CATSFC-libretro_Makefile b/games/libretro-cores/files/patch-CATSFC-libretro_Makefile
new file mode 100644
index 000000000000..48186e470738
--- /dev/null
+++ b/games/libretro-cores/files/patch-CATSFC-libretro_Makefile
@@ -0,0 +1,13 @@
+--- CATSFC-libretro/Makefile.orig 2015-11-09 12:40:42 UTC
++++ CATSFC-libretro/Makefile
+@@ -49,9 +49,7 @@ ifeq ($(platform), unix)
+ SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
+
+ CFLAGS += -fno-builtin \
+- -fno-exceptions -ffunction-sections \
+- -fomit-frame-pointer -fgcse-sm -fgcse-las -fgcse-after-reload \
+- -fweb -fpeel-loops
++ -fno-exceptions -ffunction-sections
+ else ifeq ($(platform), linux-portable)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC -nostdlib
diff --git a/games/libretro-cores/files/patch-beetle-bsnes-libretro_Makefile b/games/libretro-cores/files/patch-beetle-bsnes-libretro_Makefile
new file mode 100644
index 000000000000..22c2e2bd8f25
--- /dev/null
+++ b/games/libretro-cores/files/patch-beetle-bsnes-libretro_Makefile
@@ -0,0 +1,11 @@
+--- beetle-bsnes-libretro/Makefile.orig 2015-10-16 00:48:29 UTC
++++ beetle-bsnes-libretro/Makefile
+@@ -27,7 +27,7 @@ CORE_DEFINE := -DWANT_SNES_EMU
+ TARGET_NAME := mednafen_snes_libretro
+
+ ifneq ($(platform),win)
+-LDFLAGS += -ldl
++#LDFLAGS += -ldl
+ endif
+
+ ifeq ($(platform), unix)
diff --git a/games/libretro-cores/files/patch-bsnes-libretro_Makefile b/games/libretro-cores/files/patch-bsnes-libretro_Makefile
new file mode 100644
index 000000000000..3632535c7773
--- /dev/null
+++ b/games/libretro-cores/files/patch-bsnes-libretro_Makefile
@@ -0,0 +1,11 @@
+--- bsnes-libretro/Makefile.orig 2015-10-22 07:40:14 UTC
++++ bsnes-libretro/Makefile
+@@ -29,7 +29,7 @@ target := libretro
+ ifneq ($(debug),)
+ flags := -I. -Ilibco -O0 -g
+ else
+- flags := -I. -Ilibco -O3 -fomit-frame-pointer
++ flags := -I. -Ilibco
+ endif
+
+ cflags := -std=gnu99 -xc
diff --git a/games/libretro-cores/files/patch-bsnes-libretro_Makefile.freebsd b/games/libretro-cores/files/patch-bsnes-libretro_Makefile.freebsd
new file mode 100644
index 000000000000..0bd99de70360
--- /dev/null
+++ b/games/libretro-cores/files/patch-bsnes-libretro_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- bsnes-libretro/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ bsnes-libretro/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ $(foreach p,accuracy balanced performance,${MAKE} profile=$(p);)
diff --git a/games/libretro-cores/files/patch-bsnes-libretro_nall_Makefile b/games/libretro-cores/files/patch-bsnes-libretro_nall_Makefile
new file mode 100644
index 000000000000..b720cf155087
--- /dev/null
+++ b/games/libretro-cores/files/patch-bsnes-libretro_nall_Makefile
@@ -0,0 +1,11 @@
+--- bsnes-libretro/nall/Makefile.orig 2015-10-22 07:40:14 UTC
++++ bsnes-libretro/nall/Makefile
+@@ -40,7 +40,7 @@ ifeq ($(compiler),)
+ else ifeq ($(platform),osx)
+ compiler := clang++ -stdlib=libc++
+ else
+- compiler := g++
++ compiler := $(CXX)
+ endif
+ endif
+
diff --git a/games/libretro-cores/files/patch-bsnes-libretro_nall_platform.hpp b/games/libretro-cores/files/patch-bsnes-libretro_nall_platform.hpp
new file mode 100644
index 000000000000..f56c557931be
--- /dev/null
+++ b/games/libretro-cores/files/patch-bsnes-libretro_nall_platform.hpp
@@ -0,0 +1,15 @@
+--- bsnes-libretro/nall/platform.hpp.orig 2015-10-22 07:40:14 UTC
++++ bsnes-libretro/nall/platform.hpp
+@@ -41,11 +41,7 @@ namespace Math {
+ #undef interface
+ #define dllexport __declspec(dllexport)
+ #else
+- #ifdef __APPLE__
+- #include <machine/endian.h>
+- #else
+- #include <endian.h>
+- #endif
++ #include <machine/endian.h>
+ #include <unistd.h>
+ #include <pwd.h>
+ #define dllexport
diff --git a/games/libretro-cores/files/patch-bsnes-libretro_target-libretro_Makefile b/games/libretro-cores/files/patch-bsnes-libretro_target-libretro_Makefile
new file mode 100644
index 000000000000..2d8361e3ef17
--- /dev/null
+++ b/games/libretro-cores/files/patch-bsnes-libretro_target-libretro_Makefile
@@ -0,0 +1,11 @@
+--- bsnes-libretro/target-libretro/Makefile.orig 2015-10-22 07:40:14 UTC
++++ bsnes-libretro/target-libretro/Makefile
+@@ -36,7 +36,7 @@ obj/libretro-$(profile).o: $(ui)/libretr
+ #targets
+ build: $(objects)
+ ifeq ($(platform),linux)
+- $(compiler) -o out/bsnes_$(profile)_libretro.so -shared $(objects) -ldl -Wl,--no-undefined -Wl,--version-script=$(ui)/link.T
++ $(compiler) -o out/bsnes_$(profile)_libretro.so -shared $(objects) -Wl,--no-undefined -Wl,--version-script=$(ui)/link.T
+ else ifneq (,$(findstring ios,$(platform)))
+ $(compiler) -o out/bsnes_$(profile)_libretro_ios.dylib -dynamiclib $(objects) -isysroot $(IOSSDK) -arch armv7
+ else ifeq ($(platform),macosx)
diff --git a/games/libretro-cores/files/patch-desmume_Makefile.freebsd b/games/libretro-cores/files/patch-desmume_Makefile.freebsd
new file mode 100644
index 000000000000..c2fec1094a7f
--- /dev/null
+++ b/games/libretro-cores/files/patch-desmume_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- desmume/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ desmume/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd desmume && ${MAKE} -f Makefile.libretro
diff --git a/games/libretro-cores/files/patch-emux_Makefile.freebsd b/games/libretro-cores/files/patch-emux_Makefile.freebsd
new file mode 100644
index 000000000000..985d1b01ad5a
--- /dev/null
+++ b/games/libretro-cores/files/patch-emux_Makefile.freebsd
@@ -0,0 +1,9 @@
+--- emux/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ emux/Makefile.freebsd
+@@ -0,0 +1,6 @@
++all:
++ cd libretro && \
++ ${MAKE} -f Makefile.bsd MACHINE=chip8 && \
++ ${MAKE} -f Makefile.bsd MACHINE=gb && \
++ ${MAKE} -f Makefile.bsd MACHINE=nes && \
++ ${MAKE} -f Makefile.bsd MACHINE=sms
diff --git a/games/libretro-cores/files/patch-emux_libretro_Makefile.bsd b/games/libretro-cores/files/patch-emux_libretro_Makefile.bsd
new file mode 100644
index 000000000000..f05d936fe0be
--- /dev/null
+++ b/games/libretro-cores/files/patch-emux_libretro_Makefile.bsd
@@ -0,0 +1,91 @@
+--- emux/libretro/Makefile.bsd.orig 2015-11-10 19:32:17 UTC
++++ emux/libretro/Makefile.bsd
+@@ -0,0 +1,88 @@
++##############
++# Works on hosts Linux
++# apt-get install g++-multilib libc6-dev-i386
++
++##########################
++# Checks the host platform
++
++HOST_PLATFORM = linux
++ifeq ($(shell uname -a),)
++ HOST_PLATFORM = windows
++else ifneq ($(findstring MINGW,$(shell uname -a)),)
++ HOST_PLATFORM = windows
++else ifneq ($(findstring Darwin,$(shell uname -a)),)
++ HOST_PLATFORM = darwin
++else ifneq ($(findstring win,$(shell uname -a)),)
++ HOST_PLATFORM = windows
++endif
++
++#################
++# Toolchain setup
++
++AS = as
++AR = ar
++
++############
++# Extensions
++
++OBJEXT = .o
++SOEXT = .so
++
++################
++# Platform setup
++
++STATIC_LINKING = 0
++platform = unix
++PLATDEFS =
++PLATCFLAGS = -fpic -fstrict-aliasing
++PLATCXXFLAGS = -fpic -fstrict-aliasing
++PLATLDFLAGS = -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -Wl,-no-undefined
++PLATLDXFLAGS = -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -Wl,-no-undefined
++
++################
++# libretro setup
++
++RETRODEFS = -D__LIBRETRO__
++RETROCFLAGS =
++RETROCXXFLAGS =
++RETROLDFLAGS =
++RETROLDXFLAGS =
++
++#################
++# Final variables
++
++DEFINES = $(PLATDEFS) $(RETRODEFS)
++CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
++CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
++LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
++LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
++
++########
++# Tuning
++
++ifneq ($(DEBUG),)
++ CFLAGS += -O0 -g
++ CXXFLAGS += -O0 -g
++else
++ CFLAGS += -O3 -DNDEBUG
++ CXXFLAGS += -O3 -DNDEBUG
++endif
++
++ifneq ($(LOG_PERFORMANCE),)
++ CFLAGS += -DLOG_PERFORMANCE
++ CXXFLAGS += -DLOG_PERFORMANCE
++endif
++
++####################################
++# Variable setup for Makefile.common
++
++CORE_DIR ?= ..
++BUILD_DIR ?= .
++INCLUDES =
++
++include $(BUILD_DIR)/Makefile.common
++
++###############
++# Include rules
++
++include $(BUILD_DIR)/Makefile.rules
diff --git a/games/libretro-cores/files/patch-fba__cores__cps1_makefile.libretro b/games/libretro-cores/files/patch-fba__cores__cps1_makefile.libretro
new file mode 100644
index 000000000000..9a0af305e73b
--- /dev/null
+++ b/games/libretro-cores/files/patch-fba__cores__cps1_makefile.libretro
@@ -0,0 +1,10 @@
+--- fba_cores_cps1/makefile.libretro.orig 2015-10-31 20:25:45 UTC
++++ fba_cores_cps1/makefile.libretro
+@@ -46,6 +46,7 @@ ifeq ($(platform), unix)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T
++ PLATFORM_DEFINES := -DUSE_FILE32API
+ else ifeq ($(platform), osx)
+ TARGET := $(TARGET_NAME)_libretro.dylib
+ fpic := -fPIC
diff --git a/games/libretro-cores/files/patch-fba__cores__cps2_makefile.libretro b/games/libretro-cores/files/patch-fba__cores__cps2_makefile.libretro
new file mode 100644
index 000000000000..8fdf8b1c44d9
--- /dev/null
+++ b/games/libretro-cores/files/patch-fba__cores__cps2_makefile.libretro
@@ -0,0 +1,10 @@
+--- fba_cores_cps2/makefile.libretro.orig 2015-10-31 20:15:41 UTC
++++ fba_cores_cps2/makefile.libretro
+@@ -50,6 +50,7 @@ ifeq ($(platform), unix)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T
++ PLATFORM_DEFINES := -DUSE_FILE32API
+ else ifeq ($(platform), osx)
+ TARGET := $(TARGET_NAME)_libretro.dylib
+ fpic := -fPIC
diff --git a/games/libretro-cores/files/patch-gambatte-libretro_Makefile.freebsd b/games/libretro-cores/files/patch-gambatte-libretro_Makefile.freebsd
new file mode 100644
index 000000000000..4c35df1de3a3
--- /dev/null
+++ b/games/libretro-cores/files/patch-gambatte-libretro_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- gambatte-libretro/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ gambatte-libretro/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libgambatte && ${MAKE} -f Makefile.libretro
diff --git a/games/libretro-cores/files/patch-hatari_Makefile.libretro b/games/libretro-cores/files/patch-hatari_Makefile.libretro
new file mode 100644
index 000000000000..1d790f5a710d
--- /dev/null
+++ b/games/libretro-cores/files/patch-hatari_Makefile.libretro
@@ -0,0 +1,10 @@
+--- hatari/Makefile.libretro.orig 2015-11-02 18:02:58 UTC
++++ hatari/Makefile.libretro
+@@ -20,7 +20,6 @@ EXTERNAL_ZLIB = 0
+ TARGET_NAME := hatari
+
+ ifeq ($(platform), unix)
+- CC = gcc
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ SHARED := -lz -lpthread -shared -Wl,--version-script=$(LIBRETRO_DIR)/link.T -Wl,--no-undefined
diff --git a/games/libretro-cores/files/patch-libretro-fba_Makefile.freebsd b/games/libretro-cores/files/patch-libretro-fba_Makefile.freebsd
new file mode 100644
index 000000000000..2acf5677b186
--- /dev/null
+++ b/games/libretro-cores/files/patch-libretro-fba_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- libretro-fba/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ libretro-fba/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ $(foreach p,performance,${MAKE} -f makefile.libretro profile=$(p);)
diff --git a/games/libretro-cores/files/patch-libretro-fba_makefile.libretro b/games/libretro-cores/files/patch-libretro-fba_makefile.libretro
new file mode 100644
index 000000000000..07144599bc3b
--- /dev/null
+++ b/games/libretro-cores/files/patch-libretro-fba_makefile.libretro
@@ -0,0 +1,10 @@
+--- libretro-fba/makefile.libretro.orig 2015-11-07 10:29:16 UTC
++++ libretro-fba/makefile.libretro
+@@ -68,6 +68,7 @@ TARGET_NAME := fba
+
+ ifeq ($(platform), unix)
+ TARGET := $(TARGET_NAME)_libretro.so
++ PLATFORM_DEFINES := -DUSE_FILE32API
+ fpic := -fPIC
+ SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)/link.T
+ ENDIANNESS_DEFINES := -DLSB_FIRST
diff --git a/games/libretro-cores/files/patch-libretro-fceumm_src_general.c b/games/libretro-cores/files/patch-libretro-fceumm_src_general.c
new file mode 100644
index 000000000000..9d212b509e7c
--- /dev/null
+++ b/games/libretro-cores/files/patch-libretro-fceumm_src_general.c
@@ -0,0 +1,20 @@
+--- libretro-fceumm/src/general.c.orig 2015-10-16 01:08:30 UTC
++++ libretro-fceumm/src/general.c
+@@ -66,7 +66,7 @@ void FCEUI_SetDirOverride(int which, cha
+ FCEUSS_CheckStates();
+ }
+ }
+-
++/*
+ #ifndef HAVE_ASPRINTF
+ static int asprintf(char **strp, const char *fmt, ...) {
+ va_list ap;
+@@ -83,7 +83,7 @@ static int asprintf(char **strp, const c
+ return(ret);
+ }
+ #endif
+-
++*/
+ char *FCEU_MakeFName(int type, int id1, char *cd1)
+ {
+ char *ret = 0;
diff --git a/games/libretro-cores/files/patch-mame2014-libretro_3rdparty_genie_build_gmake.linux_genie.make b/games/libretro-cores/files/patch-mame2014-libretro_3rdparty_genie_build_gmake.linux_genie.make
new file mode 100644
index 000000000000..ec4d22271e6a
--- /dev/null
+++ b/games/libretro-cores/files/patch-mame2014-libretro_3rdparty_genie_build_gmake.linux_genie.make
@@ -0,0 +1,20 @@
+--- mame2014-libretro/3rdparty/genie/build/gmake.linux/genie.make.orig 2015-11-04 17:31:20 UTC
++++ mame2014-libretro/3rdparty/genie/build/gmake.linux/genie.make
+@@ -50,7 +50,7 @@ ifeq ($(config),release)
+ ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
+ ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
+ LDDEPS +=
+- LIBS += $(LDDEPS) -ldl -lm
++ LIBS += $(LDDEPS) -lm
+ LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJECTS := \
+ $(OBJDIR)/src/host/os_getcwd.o \
+@@ -126,7 +126,7 @@ ifeq ($(config),debug)
+ ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
+ ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
+ LDDEPS +=
+- LIBS += $(LDDEPS) -ldl -lm
++ LIBS += $(LDDEPS) -lm
+ LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ OBJECTS := \
+ $(OBJDIR)/src/host/os_getcwd.o \
diff --git a/games/libretro-cores/files/patch-mame2014-libretro_3rdparty_mongoose_test_Makefile b/games/libretro-cores/files/patch-mame2014-libretro_3rdparty_mongoose_test_Makefile
new file mode 100644
index 000000000000..56f54ed1a155
--- /dev/null
+++ b/games/libretro-cores/files/patch-mame2014-libretro_3rdparty_mongoose_test_Makefile
@@ -0,0 +1,11 @@
+--- mame2014-libretro/3rdparty/mongoose/test/Makefile.orig 2015-11-04 17:31:20 UTC
++++ mame2014-libretro/3rdparty/mongoose/test/Makefile
+@@ -11,7 +11,7 @@ all: $(PROG)
+ gcov -b $(PROG).c | egrep '^(File|Lines)'
+
+ $(PROG): $(SOURCES) Makefile ../mongoose.c clean
+- $(CC) -o $(PROG) $(SOURCES) $(CFLAGS) -ldl -lssl
++ $(CC) -o $(PROG) $(SOURCES) $(CFLAGS) -lssl
+
+ win:
+ wine cl $(SOURCES) /MD /nologo /DNDEBUG /O1 /Fe$(PROG).exe
diff --git a/games/libretro-cores/files/patch-mame2014-libretro_Makefile b/games/libretro-cores/files/patch-mame2014-libretro_Makefile
new file mode 100644
index 000000000000..f271e0516234
--- /dev/null
+++ b/games/libretro-cores/files/patch-mame2014-libretro_Makefile
@@ -0,0 +1,60 @@
+--- mame2014-libretro/Makefile.orig 2015-11-04 17:31:20 UTC
++++ mame2014-libretro/Makefile
+@@ -108,22 +108,21 @@ ifeq ($(platform), unix)
+ TARGETOS=linux
+ fpic := -fPIC
+ SHARED := -shared -Wl,--version-script=src/osd/retro/link.T -Wl,--no-undefined
+- CCOMFLAGS += $(fpic) -fsigned-char -finline -fno-common -fno-builtin -fweb -frename-registers -falign-functions=16
+- PLATCFLAGS += -DALIGN_INTS -DALIGN_SHORTS -fstrict-aliasing -fno-merge-constants $(fpic)
++ CCOMFLAGS += $(fpic) -fsigned-char -finline -fno-common -fno-builtin -falign-functions=16
++ PLATCFLAGS += -DALIGN_INTS -DALIGN_SHORTS -fstrict-aliasing $(fpic)
+ ifeq ($(VRENDER),opengl)
+ PLATCFLAGS += -DHAVE_GL
+ LIBS += -lGL
+ endif
++ LD = $(CXX)
+ LDFLAGS += $(fpic) $(SHARED)
+- REALCC = gcc
+- NATIVECC = g++
++ REALCC = $(CC)
++ NATIVECC = $(CXX)
+ NATIVECFLAGS = -std=gnu99
+ BASELIBS += -lpthread
+- CC = g++
+ AR = @ar
+- LD = g++
+ CCOMFLAGS += $(PLATCFLAGS)
+- LIBS += -lstdc++ -lpthread -ldl
++ LIBS += -lstdc++ -lpthread
+ ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
+ PTR64 = 1
+ endif
+@@ -150,7 +149,7 @@ else ifeq ($(platform), android)
+ AR = @arm-linux-androideabi-ar
+ LD = @arm-linux-androideabi-g++
+ FORCE_DRC_C_BACKEND = 1
+- CCOMFLAGS += -fPIC -mstructure-size-boundary=32 -mthumb-interwork -falign-functions=16 -fsigned-char -finline -fno-common -fno-builtin -fweb -frename-registers -falign-functions=16
++ CCOMFLAGS += -fPIC -mstructure-size-boundary=32 -mthumb-interwork -falign-functions=16 -fsigned-char -finline -fno-common -fno-builtin -falign-functions=16
+ PLATCFLAGS += -march=armv7-a -mfloat-abi=softfp -DANDROID -DALIGN_INTS -DALIGN_SHORTS -DLSB_FIRST -fstrict-aliasing -fno-merge-constants -DSDLMAME_NO64BITIO -DSDLMAME_ARM -DRETRO_SETJMP_HACK
+ ifeq ($(VRENDER),opengl)
+ PLATCFLAGS += -DHAVE_GL
+@@ -313,8 +312,8 @@ else ifneq (,$(findstring armv,$(platfor
+ TARGETOS=linux
+ fpic := -fPIC
+ SHARED := -shared -Wl,--version-script=src/osd/retro/link.T -Wl,--no-undefined
+- CCOMFLAGS += $(fpic) -mstructure-size-boundary=32 -falign-functions=16 -fsigned-char -finline -fno-common -fno-builtin -fweb -frename-registers -falign-functions=16
+- PLATCFLAGS += -march=armv7-a -DALIGN_INTS -DALIGN_SHORTS -DLSB_FIRST -fstrict-aliasing -fno-merge-constants -DSDLMAME_NO64BITIO -DSDLMAME_ARM -DRETRO_SETJMP_HACK
++ CCOMFLAGS += $(fpic) -mstructure-size-boundary=32 -falign-functions=16 -fsigned-char -finline -fno-common -fno-builtin -falign-functions=16
++ PLATCFLAGS += -march=armv7-a -DALIGN_INTS -DALIGN_SHORTS -DLSB_FIRST -fstrict-aliasing -DSDLMAME_NO64BITIO -DSDLMAME_ARM -DRETRO_SETJMP_HACK
+ LDFLAGS += -Wl,--fix-cortex-a8 -Wl,--no-as-needed $(fpic) $(SHARED)
+ REALCC = gcc
+ NATIVECC = g++
+@@ -954,7 +953,7 @@ endif
+ $(EMULATOR): $(EMUINFOOBJ) $(DRIVLISTOBJ) $(DRVLIBS) $(LIBOSD) $(LIBBUS) $(LIBOPTIONAL) $(LIBEMU) $(LIBDASM) $(LIBUTIL) $(EXPAT) $(SOFTFLOAT) $(JPEG_LIB) $(FLAC_LIB) $(7Z_LIB) $(FORMATS_LIB) $(LUA_LIB) $(SQLITE3_LIB) $(WEB_LIB) $(ZLIB) $(LIBOCORE) $(MIDI_LIB) $(RESFILE)
+ $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
+ @echo Linking $(TARGETLIB)
+- $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $(VERSIONOBJ) $^ $(LIBS) -o $(TARGETLIB)
++ $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $(VERSIONOBJ) $^ $(LIBS:-ldl=) -o $(TARGETLIB)
+
+
+ #-------------------------------------------------
diff --git a/games/libretro-cores/files/patch-mame2014-libretro_src_osd_modules_sync_sync__retro.c b/games/libretro-cores/files/patch-mame2014-libretro_src_osd_modules_sync_sync__retro.c
new file mode 100644
index 000000000000..d50cf75165b1
--- /dev/null
+++ b/games/libretro-cores/files/patch-mame2014-libretro_src_osd_modules_sync_sync__retro.c
@@ -0,0 +1,20 @@
+--- mame2014-libretro/src/osd/modules/sync/sync_retro.c.orig 2015-11-04 17:31:20 UTC
++++ mame2014-libretro/src/osd/modules/sync/sync_retro.c
+@@ -42,6 +42,8 @@
+ #include <signal.h>
+ #include <sys/time.h>
+
++#include <pthread_np.h>
++
+ #ifndef WIN32
+ struct hidden_mutex_t {
+ pthread_mutex_t id;
+@@ -492,7 +494,7 @@ int osd_thread_cpu_affinity(osd_thread *
+ #if defined(__GNUC__) && defined(WIN32)
+ return TRUE; /* stub */
+ #elif !defined(NO_AFFINITY_NP) && !defined(__MACH__) && !defined(SDLMAME_ARM)
+- cpu_set_t cmask;
++ cpuset_t cmask;
+ pthread_t lthread;
+ int bitnum;
+
diff --git a/games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrodir.c b/games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrodir.c
new file mode 100644
index 000000000000..fc9fed5c2f4d
--- /dev/null
+++ b/games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrodir.c
@@ -0,0 +1,17 @@
+--- mame2014-libretro/src/osd/retro/retrodir.c.orig 2015-11-04 17:31:20 UTC
++++ mame2014-libretro/src/osd/retro/retrodir.c
+@@ -37,10 +37,10 @@ typedef struct stat sdl_stat;
+ #define sdl_readdir readdir
+ #define sdl_stat_fn stat
+ #else
+-typedef struct dirent64 sdl_dirent;
+-typedef struct stat64 sdl_stat;
+-#define sdl_readdir readdir64
+-#define sdl_stat_fn stat64
++typedef struct dirent sdl_dirent;
++typedef struct stat sdl_stat;
++#define sdl_readdir readdir
++#define sdl_stat_fn stat
+ #endif
+
+ #define HAS_DT_XXX defined(SDLMAME_LINUX) || defined(SDLMAME_BSD) || defined(__MACH__)
diff --git a/games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrofile.c b/games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrofile.c
new file mode 100644
index 000000000000..77ae49d04d55
--- /dev/null
+++ b/games/libretro-cores/files/patch-mame2014-libretro_src_osd_retro_retrofile.c
@@ -0,0 +1,72 @@
+--- mame2014-libretro/src/osd/retro/retrofile.c.orig 2015-11-04 17:31:20 UTC
++++ mame2014-libretro/src/osd/retro/retrofile.c
+@@ -135,7 +135,7 @@ file_error osd_open(const char *path, UI
+ UINT32 access;
+ const char *src;
+ char *dst;
+-#if defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
+ struct stat st;
+ #else
+ struct stat64 st;
+@@ -238,7 +238,7 @@ file_error osd_open(const char *path, UI
+ #endif
+
+ // attempt to open the file
+-#if defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
+ (*file)->handle = open(tmpstr, access, 0666);
+ #else
+ (*file)->handle = open64(tmpstr, access, 0666);
+@@ -262,7 +262,7 @@ file_error osd_open(const char *path, UI
+ // attempt to reopen the file
+ if (error == NO_ERROR)
+ {
+-#if defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
+ (*file)->handle = open(tmpstr, access, 0666);
+ #else
+ (*file)->handle = open64(tmpstr, access, 0666);
+@@ -282,7 +282,7 @@ file_error osd_open(const char *path, UI
+ }
+
+ // get the file size
+-#if defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
+ fstat((*file)->handle, &st);
+ #else
+ fstat64((*file)->handle, &st);
+@@ -315,7 +315,7 @@ file_error osd_read(osd_file *file, void
+ switch (file->type)
+ {
+ case SDLFILE_FILE:
+-#if defined(__MACH__) || defined(SDLMAME_BSD)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(SDLMAME_BSD)
+ result = pread(file->handle, buffer, count, offset);
+ if (result < 0)
+ #elif defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_OS2)
+@@ -361,7 +361,7 @@ file_error osd_write(osd_file *file, con
+ switch (file->type)
+ {
+ case SDLFILE_FILE:
+-#if defined(__MACH__) || defined(SDLMAME_BSD)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(SDLMAME_BSD)
+ result = pwrite(file->handle, buffer, count, offset);
+ if (!result)
+ #elif defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_OS2)
+@@ -532,13 +532,13 @@ osd_directory_entry *osd_stat(const char
+ {
+ int err;
+ osd_directory_entry *result = NULL;
+-#if defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
+ struct stat st;
+ #else
+ struct stat64 st;
+ #endif
+
+-#if defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
++#if defined(__FreeBSD__) || defined(__MACH__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_ARM) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
+ err = stat(path, &st);
+ #else
+ err = stat64(path, &st);
diff --git a/games/libretro-cores/files/patch-meteor-libretro_Makefile.freebsd b/games/libretro-cores/files/patch-meteor-libretro_Makefile.freebsd
new file mode 100644
index 000000000000..f18859bfa8d5
--- /dev/null
+++ b/games/libretro-cores/files/patch-meteor-libretro_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- meteor-libretro/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ meteor-libretro/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-cores/files/patch-mgba_Makefile.freebsd b/games/libretro-cores/files/patch-mgba_Makefile.freebsd
new file mode 100644
index 000000000000..c515fe85931a
--- /dev/null
+++ b/games/libretro-cores/files/patch-mgba_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- mgba/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ mgba/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cmake . -DBUILD_LIBRETRO=ON -DBUILD_QT=OFF -DBUILD_SDL=OFF -DBUILD_SHARED=OFF -DBUILD_STATIC=ON && ${MAKE}
diff --git a/games/libretro-cores/files/patch-nestopia_Makefile.freebsd b/games/libretro-cores/files/patch-nestopia_Makefile.freebsd
new file mode 100644
index 000000000000..b7bda5c0bbc1
--- /dev/null
+++ b/games/libretro-cores/files/patch-nestopia_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- nestopia/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ nestopia/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-cores/files/patch-nxengine-libretro_Makefile b/games/libretro-cores/files/patch-nxengine-libretro_Makefile
new file mode 100644
index 000000000000..efd6096a7617
--- /dev/null
+++ b/games/libretro-cores/files/patch-nxengine-libretro_Makefile
@@ -0,0 +1,10 @@
+--- nxengine-libretro/Makefile.orig 2015-11-01 17:26:48 UTC
++++ nxengine-libretro/Makefile
+@@ -41,7 +41,6 @@ TARGET_NAME := nxengine
+ CORE_DIR := nxengine
+ EXTRACTDIR := $(CORE_DIR)/extract-auto
+
+-CC = gcc
+
+ ifeq ($(ARCHFLAGS),)
+ ifeq ($(archs),ppc)
diff --git a/games/libretro-cores/files/patch-pcsx__rearmed_Makefile.libretro b/games/libretro-cores/files/patch-pcsx__rearmed_Makefile.libretro
new file mode 100644
index 000000000000..585f9b37a905
--- /dev/null
+++ b/games/libretro-cores/files/patch-pcsx__rearmed_Makefile.libretro
@@ -0,0 +1,10 @@
+--- pcsx_rearmed/Makefile.libretro.orig 2015-11-01 09:25:51 UTC
++++ pcsx_rearmed/Makefile.libretro
+@@ -23,7 +23,6 @@ TARGET_NAME := pcsx_rearmed
+ LIBM := -lm
+ LIBZ := -lz
+ LIBPTHREAD := -lpthread
+-LIBDL := -ldl
+ MMAP_WIN32=0
+ EXTRA_LDFLAGS =
+
diff --git a/games/libretro-cores/files/patch-scummvm_Makefile.freebsd b/games/libretro-cores/files/patch-scummvm_Makefile.freebsd
new file mode 100644
index 000000000000..91b387b2a715
--- /dev/null
+++ b/games/libretro-cores/files/patch-scummvm_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- scummvm/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ scummvm/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd backends/platform/libretro/build && ${MAKE}
diff --git a/games/libretro-cores/files/patch-snes9x_Makefile.freebsd b/games/libretro-cores/files/patch-snes9x_Makefile.freebsd
new file mode 100644
index 000000000000..f81279ce3f0d
--- /dev/null
+++ b/games/libretro-cores/files/patch-snes9x_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- snes9x/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ snes9x/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-cores/files/patch-snes9x_libretro_Makefile b/games/libretro-cores/files/patch-snes9x_libretro_Makefile
new file mode 100644
index 000000000000..4bc6d0a571a5
--- /dev/null
+++ b/games/libretro-cores/files/patch-snes9x_libretro_Makefile
@@ -0,0 +1,11 @@
+--- snes9x/libretro/Makefile.orig 2015-10-15 00:36:01 UTC
++++ snes9x/libretro/Makefile
+@@ -18,8 +18,6 @@ ifeq ($(platform),)
+ endif
+ endif
+
+-CXX = g++
+-CC = gcc
+ TARGET_NAME = snes9x
+ LIBM = -lm
+
diff --git a/games/libretro-cores/files/patch-vbam-libretro_Makefile.freebsd b/games/libretro-cores/files/patch-vbam-libretro_Makefile.freebsd
new file mode 100644
index 000000000000..0976d4172e99
--- /dev/null
+++ b/games/libretro-cores/files/patch-vbam-libretro_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- vbam-libretro/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ vbam-libretro/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd src/libretro && ${MAKE} -f Makefile
diff --git a/games/libretro-cores/files/patch-vbam-libretro_src_gba_GBALink.cpp b/games/libretro-cores/files/patch-vbam-libretro_src_gba_GBALink.cpp
new file mode 100644
index 000000000000..b30cb16ed643
--- /dev/null
+++ b/games/libretro-cores/files/patch-vbam-libretro_src_gba_GBALink.cpp
@@ -0,0 +1,14 @@
+--- vbam-libretro/src/gba/GBALink.cpp.orig 2015-11-08 20:19:43 UTC
++++ vbam-libretro/src/gba/GBALink.cpp
+@@ -4,11 +4,7 @@
+ #include <stdio.h>
+
+ // malloc.h does not seem to exist on Mac OS 10.7
+-#ifdef __APPLE__
+ #include <stdlib.h>
+-#else
+-#include <malloc.h>
+-#endif
+
+ int vbaid = 0;
+ const char *MakeInstanceFilename(const char *Input)
diff --git a/games/libretro-cores/files/patch-yabause_Makefile.freebsd b/games/libretro-cores/files/patch-yabause_Makefile.freebsd
new file mode 100644
index 000000000000..b91b5a483d09
--- /dev/null
+++ b/games/libretro-cores/files/patch-yabause_Makefile.freebsd
@@ -0,0 +1,5 @@
+--- yabause/Makefile.freebsd.orig 2015-11-10 19:32:17 UTC
++++ yabause/Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-cores/pkg-descr b/games/libretro-cores/pkg-descr
new file mode 100644
index 000000000000..ef4f6a16570b
--- /dev/null
+++ b/games/libretro-cores/pkg-descr
@@ -0,0 +1,6 @@
+This is the core pack for RetroArch. Mostly these cores are
+intended for playing/interpreting the retrogames. They are for the
+most part distributed by the Libretro organization, and are usually
+licensed under GPL.
+
+WWW: http://www.libretro.com/