aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorLoïc Bartoletti <lbartoletti@FreeBSD.org>2020-04-29 05:27:55 +0000
committerLoïc Bartoletti <lbartoletti@FreeBSD.org>2020-04-29 05:27:55 +0000
commitf22c8b9e3227a66eee269d1015c3a5877a7c7585 (patch)
treeb296a87781dae373931fea67f759c6cdab3106da /games
parent4e52d52bb35a2ae6ba242ea83e17075a5327ce6d (diff)
downloadports-f22c8b9e3227a66eee269d1015c3a5877a7c7585.tar.gz
ports-f22c8b9e3227a66eee269d1015c3a5877a7c7585.zip
[NEW PORTS]: games/libretro-* libretro cores for compatible emulators
Libretro is a simple API that allows for the creation of games and emulators. It needs a compatible libretro emulator to work (such as retroarch). This is a collection of 48 ports and a meta port to play retrogames. libretro - meta port for libretro cores libretro-2048 - 2048 puzzle libretro-beetle_bsnes - Nintendo SNES emulator from Mednafen libretro-beetle_gba - Nintendo Gameboy Advance emulator from Mednafen libretro-beetle_lynx - Atari Lynx emulator from Mednafen libretro-beetle_ngp - Neogeo Pocket emulator from Mednafen libretro-beetle_pce_fast - NEC PC Engine emulator from Mednafen libretro-beetle_pcfx - NEC PCFX emulator from Mednafen libretro-beetle_psx - Sony Playstation emulator from Mednafen libretro-beetle_supergrafx - NEC Supergrafx emulator from Mednafen libretro-beetle_vb - Nintendo Virtual Boy emulator from Mednafen libretro-beetle_wswan - Bandai Wonderswan emulator from Mednafen libretro-bluemsx - MSX emulator libretro-desmume2015 - Nintendo DS emulator libretro-dosbox - MS-DOS emulator libretro-emux - Emulator project support a couple of 8bit platforms libretro-fbalpha - Final Burn Alpha, arcade emulator libretro-fceumm - Nintendo NES emulator libretro-fuse - ZX Spectrum emulator libretro-gambatte - Nintendo Gameboy Color Emulator libretro-genesis_plus_gx - Sega 8 and 16 bit multi-emulator libretro-gpsp - Nintendo Gameboy emulator libretro-gw - Nintendo Game & Watch emulator libretro-handy - Atari Lynx emulator libretro-hatari - Atari ST/STE/TT/Falcon emulator libretro-mame2000 - Multiple Arcade Machine Emulator (0.37b5) libretro-mame2003 - Multiple Arcade Machine Emulator (0.78) libretro-mame2003_plus - Multiple Arcade Machine Emulator (0.78 with extra games) libretro-mgba - Nintendo Gameboy Advance emulator libretro-nestopia - Nintendo NES emulator libretro-nxengine - Cave Story engine libretro-o2em - Magnavox Odyssey 2 / Phillips Videopac emulator libretro-opera - Panasonic 3DO emulator libretro-pcsx_rearmed - Sony Playstion 1 emulator libretro-picodrive - Sega 8 and 16 bit multi-emulator libretro-prboom - Doom engine libretro-prosystem - Atari 7800 / Prosystem emulator libretro-quicknes - Nintendo NES emulator libretro-scummvm - SCUMMVM backend libretro-snes9x - Nintendo SNES emulator (Trunk) libretro-snes9x2005 - Nintendo SNES emulator (1.43) libretro-snes9x2010 - Nintendo SNES emulator (1.52) libretro-stella2014 - Atari 2600 emulator libretro-tgbdual - Nintendo Game Boy / Game Boy Color emulator libretro-tyrquake - Quake engine libretro-uae - Commodore Amiga emulator libretro-vbanext - Nintendo Game Boy Advance emulator libretro-vecx - GCE Vectrex emulator libretro-virtualjaguar - Atari Jaguar emulator PR: 244897 Submitted by: Daniel Menelkir <menelkir@itroll.org> Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D24516
Notes
Notes: svn path=/head/; revision=533314
Diffstat (limited to 'games')
-rw-r--r--games/Makefile49
-rw-r--r--games/libretro-2048/Makefile27
-rw-r--r--games/libretro-2048/distinfo3
-rw-r--r--games/libretro-2048/pkg-descr3
-rw-r--r--games/libretro-beetle_bsnes/Makefile26
-rw-r--r--games/libretro-beetle_bsnes/distinfo3
-rw-r--r--games/libretro-beetle_bsnes/files/patch-mednafen_snes_src_lib_libco_aarch64.c17
-rw-r--r--games/libretro-beetle_bsnes/pkg-descr3
-rw-r--r--games/libretro-beetle_gba/Makefile26
-rw-r--r--games/libretro-beetle_gba/distinfo3
-rw-r--r--games/libretro-beetle_gba/pkg-descr3
-rw-r--r--games/libretro-beetle_lynx/Makefile26
-rw-r--r--games/libretro-beetle_lynx/distinfo3
-rw-r--r--games/libretro-beetle_lynx/pkg-descr3
-rw-r--r--games/libretro-beetle_ngp/Makefile26
-rw-r--r--games/libretro-beetle_ngp/distinfo3
-rw-r--r--games/libretro-beetle_ngp/pkg-descr3
-rw-r--r--games/libretro-beetle_pce_fast/Makefile26
-rw-r--r--games/libretro-beetle_pce_fast/distinfo3
-rw-r--r--games/libretro-beetle_pce_fast/pkg-descr3
-rw-r--r--games/libretro-beetle_pcfx/Makefile26
-rw-r--r--games/libretro-beetle_pcfx/distinfo3
-rw-r--r--games/libretro-beetle_pcfx/files/patch-libretro-common_rthreads_rthreads.c11
-rw-r--r--games/libretro-beetle_pcfx/pkg-descr3
-rw-r--r--games/libretro-beetle_psx/Makefile27
-rw-r--r--games/libretro-beetle_psx/distinfo3
-rw-r--r--games/libretro-beetle_psx/files/patch-libretro-common_rthreads_rthreads.c11
-rw-r--r--games/libretro-beetle_psx/pkg-descr3
-rw-r--r--games/libretro-beetle_supergrafx/Makefile26
-rw-r--r--games/libretro-beetle_supergrafx/distinfo3
-rw-r--r--games/libretro-beetle_supergrafx/pkg-descr3
-rw-r--r--games/libretro-beetle_vb/Makefile26
-rw-r--r--games/libretro-beetle_vb/distinfo3
-rw-r--r--games/libretro-beetle_vb/pkg-descr3
-rw-r--r--games/libretro-beetle_wswan/Makefile26
-rw-r--r--games/libretro-beetle_wswan/distinfo3
-rw-r--r--games/libretro-beetle_wswan/pkg-descr3
-rw-r--r--games/libretro-bluemsx/Makefile28
-rw-r--r--games/libretro-bluemsx/distinfo3
-rw-r--r--games/libretro-bluemsx/pkg-descr3
-rw-r--r--games/libretro-desmume2015/Makefile31
-rw-r--r--games/libretro-desmume2015/distinfo3
-rw-r--r--games/libretro-desmume2015/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-desmume2015/files/patch-desmume_src_libretro-common_rthreads_rthreads.c11
-rw-r--r--games/libretro-desmume2015/pkg-descr3
-rw-r--r--games/libretro-dosbox/Makefile26
-rw-r--r--games/libretro-dosbox/distinfo3
-rw-r--r--games/libretro-dosbox/files/patch-libretro-common_libco_aarch64.c17
-rw-r--r--games/libretro-dosbox/pkg-descr3
-rw-r--r--games/libretro-emux/Makefile31
-rw-r--r--games/libretro-emux/distinfo3
-rw-r--r--games/libretro-emux/files/patch-Makefile.freebsd10
-rw-r--r--games/libretro-emux/files/patch-emux_libretro_Makefile.bsd91
-rw-r--r--games/libretro-emux/files/patch-libretro_Makefile.bsd91
-rw-r--r--games/libretro-emux/pkg-descr3
-rw-r--r--games/libretro-fbalpha/Makefile34
-rw-r--r--games/libretro-fbalpha/distinfo3
-rw-r--r--games/libretro-fbalpha/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-fbalpha/pkg-descr3
-rw-r--r--games/libretro-fceumm/Makefile25
-rw-r--r--games/libretro-fceumm/distinfo3
-rw-r--r--games/libretro-fceumm/pkg-descr3
-rw-r--r--games/libretro-fuse/Makefile26
-rw-r--r--games/libretro-fuse/distinfo3
-rw-r--r--games/libretro-fuse/pkg-descr3
-rw-r--r--games/libretro-gambatte/Makefile26
-rw-r--r--games/libretro-gambatte/distinfo3
-rw-r--r--games/libretro-gambatte/pkg-descr3
-rw-r--r--games/libretro-genesis_plus_gx/Makefile33
-rw-r--r--games/libretro-genesis_plus_gx/distinfo3
-rw-r--r--games/libretro-genesis_plus_gx/pkg-descr3
-rw-r--r--games/libretro-gpsp/Makefile26
-rw-r--r--games/libretro-gpsp/distinfo3
-rw-r--r--games/libretro-gpsp/files/patch-libco_aarch64.c17
-rw-r--r--games/libretro-gpsp/pkg-descr3
-rw-r--r--games/libretro-gw/Makefile26
-rw-r--r--games/libretro-gw/distinfo3
-rw-r--r--games/libretro-gw/pkg-descr3
-rw-r--r--games/libretro-handy/Makefile25
-rw-r--r--games/libretro-handy/distinfo3
-rw-r--r--games/libretro-handy/pkg-descr3
-rw-r--r--games/libretro-hatari/Makefile28
-rw-r--r--games/libretro-hatari/distinfo3
-rw-r--r--games/libretro-hatari/files/patch-libretro_libretro-sdk_libco_aarch64.c17
-rw-r--r--games/libretro-hatari/files/patch-libretro_libretro-sdk_rthreads_rthreads.c11
-rw-r--r--games/libretro-hatari/pkg-descr3
-rw-r--r--games/libretro-mame2000/Makefile26
-rw-r--r--games/libretro-mame2000/distinfo3
-rw-r--r--games/libretro-mame2000/files/patch-src_libretro_libretro-common_libco_aarch64.c17
-rw-r--r--games/libretro-mame2000/pkg-descr3
-rw-r--r--games/libretro-mame2003/Makefile26
-rw-r--r--games/libretro-mame2003/distinfo3
-rw-r--r--games/libretro-mame2003/pkg-descr3
-rw-r--r--games/libretro-mame2003_plus/Makefile26
-rw-r--r--games/libretro-mame2003_plus/distinfo3
-rw-r--r--games/libretro-mame2003_plus/pkg-descr3
-rw-r--r--games/libretro-mgba/Makefile26
-rw-r--r--games/libretro-mgba/distinfo3
-rw-r--r--games/libretro-mgba/pkg-descr3
-rw-r--r--games/libretro-nestopia/Makefile28
-rw-r--r--games/libretro-nestopia/distinfo3
-rw-r--r--games/libretro-nestopia/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-nestopia/pkg-descr3
-rw-r--r--games/libretro-nxengine/Makefile26
-rw-r--r--games/libretro-nxengine/distinfo3
-rw-r--r--games/libretro-nxengine/pkg-descr3
-rw-r--r--games/libretro-o2em/Makefile25
-rw-r--r--games/libretro-o2em/distinfo3
-rw-r--r--games/libretro-o2em/pkg-descr3
-rw-r--r--games/libretro-opera/Makefile27
-rw-r--r--games/libretro-opera/distinfo3
-rw-r--r--games/libretro-opera/files/patch-Makefile10
-rw-r--r--games/libretro-opera/files/patch-libretro-common_cdrom_cdrom.c19
-rw-r--r--games/libretro-opera/pkg-descr3
-rw-r--r--games/libretro-pcsx_rearmed/Makefile29
-rw-r--r--games/libretro-pcsx_rearmed/distinfo3
-rw-r--r--games/libretro-pcsx_rearmed/pkg-descr3
-rw-r--r--games/libretro-picodrive/Makefile30
-rw-r--r--games/libretro-picodrive/distinfo3
-rw-r--r--games/libretro-picodrive/pkg-descr3
-rw-r--r--games/libretro-prboom/Makefile25
-rw-r--r--games/libretro-prboom/distinfo3
-rw-r--r--games/libretro-prboom/pkg-descr3
-rw-r--r--games/libretro-prosystem/Makefile26
-rw-r--r--games/libretro-prosystem/distinfo3
-rw-r--r--games/libretro-prosystem/pkg-descr3
-rw-r--r--games/libretro-quicknes/Makefile26
-rw-r--r--games/libretro-quicknes/distinfo3
-rw-r--r--games/libretro-quicknes/pkg-descr3
-rw-r--r--games/libretro-scummvm/Makefile28
-rw-r--r--games/libretro-scummvm/distinfo3
-rw-r--r--games/libretro-scummvm/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-scummvm/files/patch-backends_platform_libretro_libretro-common_libco_aarch64.c17
-rw-r--r--games/libretro-scummvm/pkg-descr3
-rw-r--r--games/libretro-snes9x/Makefile35
-rw-r--r--games/libretro-snes9x/distinfo3
-rw-r--r--games/libretro-snes9x/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-snes9x/pkg-descr3
-rw-r--r--games/libretro-snes9x2005/Makefile31
-rw-r--r--games/libretro-snes9x2005/distinfo3
-rw-r--r--games/libretro-snes9x2005/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-snes9x2005/pkg-descr3
-rw-r--r--games/libretro-snes9x2010/Makefile31
-rw-r--r--games/libretro-snes9x2010/distinfo3
-rw-r--r--games/libretro-snes9x2010/files/patch-Makefile.freebsd5
-rw-r--r--games/libretro-snes9x2010/pkg-descr3
-rw-r--r--games/libretro-stella2014/Makefile26
-rw-r--r--games/libretro-stella2014/distinfo3
-rw-r--r--games/libretro-stella2014/pkg-descr3
-rw-r--r--games/libretro-tgbdual/Makefile26
-rw-r--r--games/libretro-tgbdual/distinfo3
-rw-r--r--games/libretro-tgbdual/pkg-descr3
-rw-r--r--games/libretro-tyrquake/Makefile27
-rw-r--r--games/libretro-tyrquake/distinfo3
-rw-r--r--games/libretro-tyrquake/pkg-descr3
-rw-r--r--games/libretro-uae/Makefile29
-rw-r--r--games/libretro-uae/distinfo3
-rw-r--r--games/libretro-uae/files/patch-libco_aarch64.c17
-rw-r--r--games/libretro-uae/files/patch-sources_src_disk.c10
-rw-r--r--games/libretro-uae/pkg-descr3
-rw-r--r--games/libretro-vbanext/Makefile26
-rw-r--r--games/libretro-vbanext/distinfo3
-rw-r--r--games/libretro-vbanext/pkg-descr3
-rw-r--r--games/libretro-vecx/Makefile25
-rw-r--r--games/libretro-vecx/distinfo3
-rw-r--r--games/libretro-vecx/pkg-descr3
-rw-r--r--games/libretro-virtualjaguar/Makefile26
-rw-r--r--games/libretro-virtualjaguar/distinfo3
-rw-r--r--games/libretro-virtualjaguar/pkg-descr3
-rw-r--r--games/libretro/Makefile136
-rw-r--r--games/libretro/pkg-descr3
171 files changed, 2214 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index 791afdc78d07..ecb6fe465cf3 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -479,9 +479,58 @@
SUBDIR += liblcf
SUBDIR += libmaitretarot
SUBDIR += libmt_client
+ SUBDIR += libretro
+ SUBDIR += libretro-2048
+ SUBDIR += libretro-beetle_bsnes
+ SUBDIR += libretro-beetle_gba
+ SUBDIR += libretro-beetle_lynx
+ SUBDIR += libretro-beetle_ngp
+ SUBDIR += libretro-beetle_pce_fast
+ SUBDIR += libretro-beetle_pcfx
+ SUBDIR += libretro-beetle_psx
+ SUBDIR += libretro-beetle_supergrafx
+ SUBDIR += libretro-beetle_vb
+ SUBDIR += libretro-beetle_wswan
+ SUBDIR += libretro-bluemsx
SUBDIR += libretro-core-info
+ SUBDIR += libretro-desmume2015
+ SUBDIR += libretro-dosbox
+ SUBDIR += libretro-emux
+ SUBDIR += libretro-fbalpha
+ SUBDIR += libretro-fceumm
+ SUBDIR += libretro-fuse
+ SUBDIR += libretro-gambatte
+ SUBDIR += libretro-genesis_plus_gx
+ SUBDIR += libretro-gpsp
+ SUBDIR += libretro-gw
+ SUBDIR += libretro-handy
+ SUBDIR += libretro-hatari
+ SUBDIR += libretro-mame2000
+ SUBDIR += libretro-mame2003
+ SUBDIR += libretro-mame2003_plus
+ SUBDIR += libretro-mgba
+ SUBDIR += libretro-nestopia
+ SUBDIR += libretro-nxengine
+ SUBDIR += libretro-o2em
+ SUBDIR += libretro-opera
+ SUBDIR += libretro-pcsx_rearmed
+ SUBDIR += libretro-picodrive
+ SUBDIR += libretro-prboom
+ SUBDIR += libretro-prosystem
+ SUBDIR += libretro-quicknes
+ SUBDIR += libretro-scummvm
SUBDIR += libretro-shaders-glsl
SUBDIR += libretro-shaders-slang
+ SUBDIR += libretro-snes9x
+ SUBDIR += libretro-snes9x2005
+ SUBDIR += libretro-snes9x2010
+ SUBDIR += libretro-stella2014
+ SUBDIR += libretro-tgbdual
+ SUBDIR += libretro-tyrquake
+ SUBDIR += libretro-uae
+ SUBDIR += libretro-vbanext
+ SUBDIR += libretro-vecx
+ SUBDIR += libretro-virtualjaguar
SUBDIR += libshhcards
SUBDIR += libtmcg
SUBDIR += lightsoff
diff --git a/games/libretro-2048/Makefile b/games/libretro-2048/Makefile
new file mode 100644
index 000000000000..4f3a607307a2
--- /dev/null
+++ b/games/libretro-2048/Makefile
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME= libretro-2048
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of 2048 puzzle game to the libretro API
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= c5e0df2
+
+PLIST_FILES= libexec/libretro/2048_libretro.so
+
+MAKEFILE= Makefile.libretro
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-2048/distinfo b/games/libretro-2048/distinfo
new file mode 100644
index 000000000000..a8f3c650c0d7
--- /dev/null
+++ b/games/libretro-2048/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584469651
+SHA256 (libretro-libretro-2048-0.20200313-c5e0df2_GH0.tar.gz) = f28d3795cecd140e35209bca2daf991f60ca6980bdd074e5c6c1ea1414192e8c
+SIZE (libretro-libretro-2048-0.20200313-c5e0df2_GH0.tar.gz) = 2697711
diff --git a/games/libretro-2048/pkg-descr b/games/libretro-2048/pkg-descr
new file mode 100644
index 000000000000..bf9ddde1f550
--- /dev/null
+++ b/games/libretro-2048/pkg-descr
@@ -0,0 +1,3 @@
+Port of 2048 puzzle game to the libretro API.
+
+WWW: https://github.com/libretro/libretro-2048
diff --git a/games/libretro-beetle_bsnes/Makefile b/games/libretro-beetle_bsnes/Makefile
new file mode 100644
index 000000000000..326d17567cdb
--- /dev/null
+++ b/games/libretro-beetle_bsnes/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_bsnes
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen bSNES to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-bsnes-libretro
+GH_TAGNAME= de22d84
+
+PLIST_FILES= libexec/libretro/mednafen_snes_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_bsnes/distinfo b/games/libretro-beetle_bsnes/distinfo
new file mode 100644
index 000000000000..48414b83b975
--- /dev/null
+++ b/games/libretro-beetle_bsnes/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584470447
+SHA256 (libretro-beetle-bsnes-libretro-0.20200313-de22d84_GH0.tar.gz) = 1d18a49d670d1e2baaeb11df6473dba10c209b256dd817e81cf2a7aac849fbe7
+SIZE (libretro-beetle-bsnes-libretro-0.20200313-de22d84_GH0.tar.gz) = 547398
diff --git a/games/libretro-beetle_bsnes/files/patch-mednafen_snes_src_lib_libco_aarch64.c b/games/libretro-beetle_bsnes/files/patch-mednafen_snes_src_lib_libco_aarch64.c
new file mode 100644
index 000000000000..9ea4b83ad5f5
--- /dev/null
+++ b/games/libretro-beetle_bsnes/files/patch-mednafen_snes_src_lib_libco_aarch64.c
@@ -0,0 +1,17 @@
+--- mednafen/snes/src/lib/libco/aarch64.c.orig 2020-04-28 06:21:33 UTC
++++ mednafen/snes/src/lib/libco/aarch64.c
+@@ -12,7 +12,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-beetle_bsnes/pkg-descr b/games/libretro-beetle_bsnes/pkg-descr
new file mode 100644
index 000000000000..f98c398ce60a
--- /dev/null
+++ b/games/libretro-beetle_bsnes/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen bSNES to libretro, itself a fork of bsnes 0.59.
+
+WWW: https://github.com/libretro/beetle-bsnes-libretro
diff --git a/games/libretro-beetle_gba/Makefile b/games/libretro-beetle_gba/Makefile
new file mode 100644
index 000000000000..b141f008ee67
--- /dev/null
+++ b/games/libretro-beetle_gba/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_gba
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen GBA to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-gba-libretro
+GH_TAGNAME= 135afdb
+
+PLIST_FILES= libexec/libretro/mednafen_gba_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_gba/distinfo b/games/libretro-beetle_gba/distinfo
new file mode 100644
index 000000000000..092faf7ce43e
--- /dev/null
+++ b/games/libretro-beetle_gba/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584470679
+SHA256 (libretro-beetle-gba-libretro-0.20200313-135afdb_GH0.tar.gz) = 9d16f31547d692344b7552df0a9522ce0c2bee8e1cf684a87e0a7f73e265bcf1
+SIZE (libretro-beetle-gba-libretro-0.20200313-135afdb_GH0.tar.gz) = 174344
diff --git a/games/libretro-beetle_gba/pkg-descr b/games/libretro-beetle_gba/pkg-descr
new file mode 100644
index 000000000000..2a45975282d7
--- /dev/null
+++ b/games/libretro-beetle_gba/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen GBA to libretro.
+
+WWW: https://github.com/libretro/beetle-gba-libretro
diff --git a/games/libretro-beetle_lynx/Makefile b/games/libretro-beetle_lynx/Makefile
new file mode 100644
index 000000000000..1f0b44b63d5f
--- /dev/null
+++ b/games/libretro-beetle_lynx/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_lynx
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen Lynx to libretro, itself a fork of Handy
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-lynx-libretro
+GH_TAGNAME= 928f7cf
+
+PLIST_FILES= libexec/libretro/mednafen_lynx_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_lynx/distinfo b/games/libretro-beetle_lynx/distinfo
new file mode 100644
index 000000000000..29e4b3004406
--- /dev/null
+++ b/games/libretro-beetle_lynx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584470797
+SHA256 (libretro-beetle-lynx-libretro-0.20200313-928f7cf_GH0.tar.gz) = 3bcb4f5680a90c3eda2f1013c0e27807eee5fb2aeb2c37171a90cc05ef60f7fe
+SIZE (libretro-beetle-lynx-libretro-0.20200313-928f7cf_GH0.tar.gz) = 175309
diff --git a/games/libretro-beetle_lynx/pkg-descr b/games/libretro-beetle_lynx/pkg-descr
new file mode 100644
index 000000000000..26dbc3b59f60
--- /dev/null
+++ b/games/libretro-beetle_lynx/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen Lynx to libretro, itself a fork of Handy.
+
+WWW: https://github.com/libretro/beetle-lynx-libretro
diff --git a/games/libretro-beetle_ngp/Makefile b/games/libretro-beetle_ngp/Makefile
new file mode 100644
index 000000000000..896d30113d85
--- /dev/null
+++ b/games/libretro-beetle_ngp/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_ngp
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen NGP to the libretro API
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-ngp-libretro
+GH_TAGNAME= 6f15532
+
+PLIST_FILES= libexec/libretro/mednafen_ngp_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_ngp/distinfo b/games/libretro-beetle_ngp/distinfo
new file mode 100644
index 000000000000..fd1f709aac6c
--- /dev/null
+++ b/games/libretro-beetle_ngp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584470872
+SHA256 (libretro-beetle-ngp-libretro-0.20200313-6f15532_GH0.tar.gz) = f0d3968734a8f948e40b5a2ca3df5120845533936986b5f6f921b1838184acb8
+SIZE (libretro-beetle-ngp-libretro-0.20200313-6f15532_GH0.tar.gz) = 187325
diff --git a/games/libretro-beetle_ngp/pkg-descr b/games/libretro-beetle_ngp/pkg-descr
new file mode 100644
index 000000000000..8edd163f23eb
--- /dev/null
+++ b/games/libretro-beetle_ngp/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen NGP to the libretro API, itself a fork of Neopop.
+
+WWW: https://github.com/libretro/beetle-ngp-libretro
diff --git a/games/libretro-beetle_pce_fast/Makefile b/games/libretro-beetle_pce_fast/Makefile
new file mode 100644
index 000000000000..d0aa6cbe7d8b
--- /dev/null
+++ b/games/libretro-beetle_pce_fast/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_pce_fast
+PORTVERSION= 0.20200418
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen PCE Fast to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-pce-fast-libretro
+GH_TAGNAME= 40a42b7
+
+PLIST_FILES= libexec/libretro/mednafen_pce_fast_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_pce_fast/distinfo b/games/libretro-beetle_pce_fast/distinfo
new file mode 100644
index 000000000000..c50ebc71cad4
--- /dev/null
+++ b/games/libretro-beetle_pce_fast/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1587213101
+SHA256 (libretro-beetle-pce-fast-libretro-0.20200418-40a42b7_GH0.tar.gz) = 50b8fefc859bc371b10cdd5971c5238f8d6dbe1cb5f2b278f10aed8c977f9c00
+SIZE (libretro-beetle-pce-fast-libretro-0.20200418-40a42b7_GH0.tar.gz) = 1200304
diff --git a/games/libretro-beetle_pce_fast/pkg-descr b/games/libretro-beetle_pce_fast/pkg-descr
new file mode 100644
index 000000000000..32decd94a0ff
--- /dev/null
+++ b/games/libretro-beetle_pce_fast/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen PCE Fast to libretro.
+
+WWW: https://github.com/libretro/beetle-vb-pce-fast-libretro
diff --git a/games/libretro-beetle_pcfx/Makefile b/games/libretro-beetle_pcfx/Makefile
new file mode 100644
index 000000000000..864094e11696
--- /dev/null
+++ b/games/libretro-beetle_pcfx/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_pcfx
+PORTVERSION= 0.20200418
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen PCFX to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-pcfx-libretro
+GH_TAGNAME= 7bba669
+
+PLIST_FILES= libexec/libretro/mednafen_pcfx_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_pcfx/distinfo b/games/libretro-beetle_pcfx/distinfo
new file mode 100644
index 000000000000..756cf7ecd0b2
--- /dev/null
+++ b/games/libretro-beetle_pcfx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1587213318
+SHA256 (libretro-beetle-pcfx-libretro-0.20200418-7bba669_GH0.tar.gz) = 611c779930cc47e25f86d5ebfa0a1ae668e37cb8e4caee31137d1a8164cb2dae
+SIZE (libretro-beetle-pcfx-libretro-0.20200418-7bba669_GH0.tar.gz) = 1250165
diff --git a/games/libretro-beetle_pcfx/files/patch-libretro-common_rthreads_rthreads.c b/games/libretro-beetle_pcfx/files/patch-libretro-common_rthreads_rthreads.c
new file mode 100644
index 000000000000..711eba8689ed
--- /dev/null
+++ b/games/libretro-beetle_pcfx/files/patch-libretro-common_rthreads_rthreads.c
@@ -0,0 +1,11 @@
+--- libretro-common/rthreads/rthreads.c.orig 2020-03-17 18:50:48 UTC
++++ libretro-common/rthreads/rthreads.c
+@@ -66,6 +66,8 @@
+ #include <mach/mach.h>
+ #endif
+
++#include <sys/time.h>
++
+ struct thread_data
+ {
+ void (*func)(void*);
diff --git a/games/libretro-beetle_pcfx/pkg-descr b/games/libretro-beetle_pcfx/pkg-descr
new file mode 100644
index 000000000000..5b0eec5d2582
--- /dev/null
+++ b/games/libretro-beetle_pcfx/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen PCFX to libretro.
+
+WWW: https://github.com/libretro/beetle-gba-libretro
diff --git a/games/libretro-beetle_psx/Makefile b/games/libretro-beetle_psx/Makefile
new file mode 100644
index 000000000000..692d1a1b1a94
--- /dev/null
+++ b/games/libretro-beetle_psx/Makefile
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_psx
+PORTVERSION= 0.20200418
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port/fork of Mednafen PSX to the Libretro API
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-psx-libretro
+GH_TAGNAME= dfab19a
+
+PLIST_FILES= libexec/libretro/mednafen_psx_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_psx/distinfo b/games/libretro-beetle_psx/distinfo
new file mode 100644
index 000000000000..b53c7591db47
--- /dev/null
+++ b/games/libretro-beetle_psx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1587213783
+SHA256 (libretro-beetle-psx-libretro-0.20200418-dfab19a_GH0.tar.gz) = ff80d229859120b2d79b13b6740b21f43515fb6fad7488b973c913c26f91dc1f
+SIZE (libretro-beetle-psx-libretro-0.20200418-dfab19a_GH0.tar.gz) = 2899119
diff --git a/games/libretro-beetle_psx/files/patch-libretro-common_rthreads_rthreads.c b/games/libretro-beetle_psx/files/patch-libretro-common_rthreads_rthreads.c
new file mode 100644
index 000000000000..0ca1ab3d9c0b
--- /dev/null
+++ b/games/libretro-beetle_psx/files/patch-libretro-common_rthreads_rthreads.c
@@ -0,0 +1,11 @@
+--- libretro-common/rthreads/rthreads.c.orig 2020-03-17 21:58:04 UTC
++++ libretro-common/rthreads/rthreads.c
+@@ -58,6 +58,8 @@
+ #include <time.h>
+ #endif
+
++#include <sys/time.h>
++
+ #if defined(VITA) || defined(BSD) || defined(ORBIS)
+ #include <sys/time.h>
+ #endif
diff --git a/games/libretro-beetle_psx/pkg-descr b/games/libretro-beetle_psx/pkg-descr
new file mode 100644
index 000000000000..33f47e53f964
--- /dev/null
+++ b/games/libretro-beetle_psx/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port/fork of Mednafen PSX to the Libretro API.
+
+WWW: https://github.com/libretro/beetle-psx-libretro
diff --git a/games/libretro-beetle_supergrafx/Makefile b/games/libretro-beetle_supergrafx/Makefile
new file mode 100644
index 000000000000..16715fbefc28
--- /dev/null
+++ b/games/libretro-beetle_supergrafx/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_supergrafx
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen supergrafx to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-supergrafx-libretro
+GH_TAGNAME= fadef23
+
+PLIST_FILES= libexec/libretro/mednafen_supergrafx_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_supergrafx/distinfo b/games/libretro-beetle_supergrafx/distinfo
new file mode 100644
index 000000000000..1d65e1a88da7
--- /dev/null
+++ b/games/libretro-beetle_supergrafx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1587214304
+SHA256 (libretro-beetle-supergrafx-libretro-0.20200313-fadef23_GH0.tar.gz) = 2052235ba4468dded454d2913337d9eaae47ae072fc52dc7b8e7e0aa3a9dd7de
+SIZE (libretro-beetle-supergrafx-libretro-0.20200313-fadef23_GH0.tar.gz) = 1184377
diff --git a/games/libretro-beetle_supergrafx/pkg-descr b/games/libretro-beetle_supergrafx/pkg-descr
new file mode 100644
index 000000000000..6597d388da27
--- /dev/null
+++ b/games/libretro-beetle_supergrafx/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen supergrafx to libretro
+
+WWW: https://github.com/libretro/beetle-supergrafx-libretro
diff --git a/games/libretro-beetle_vb/Makefile b/games/libretro-beetle_vb/Makefile
new file mode 100644
index 000000000000..3e8cd2e4155f
--- /dev/null
+++ b/games/libretro-beetle_vb/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_vb
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen VB to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-vb-libretro
+GH_TAGNAME= 9a4e604
+
+PLIST_FILES= libexec/libretro/mednafen_vb_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_vb/distinfo b/games/libretro-beetle_vb/distinfo
new file mode 100644
index 000000000000..ecf09fbdfe99
--- /dev/null
+++ b/games/libretro-beetle_vb/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584482435
+SHA256 (libretro-beetle-vb-libretro-0.20200313-9a4e604_GH0.tar.gz) = 3fd6e3f702bc0584fe7d80a7710a66f10340d8ebf81a8c42260ea5ea9ad90134
+SIZE (libretro-beetle-vb-libretro-0.20200313-9a4e604_GH0.tar.gz) = 174800
diff --git a/games/libretro-beetle_vb/pkg-descr b/games/libretro-beetle_vb/pkg-descr
new file mode 100644
index 000000000000..962d25f1db24
--- /dev/null
+++ b/games/libretro-beetle_vb/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen VB to libretro.
+
+WWW: https://github.com/libretro/beetle-vb-libretro
diff --git a/games/libretro-beetle_wswan/Makefile b/games/libretro-beetle_wswan/Makefile
new file mode 100644
index 000000000000..e0ce24c8cfd1
--- /dev/null
+++ b/games/libretro-beetle_wswan/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-beetle_wswan
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Standalone port of Mednafen WonderSwan to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= beetle-wswan-libretro
+GH_TAGNAME= 5b03d1b
+
+PLIST_FILES= libexec/libretro/mednafen_wswan_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-beetle_wswan/distinfo b/games/libretro-beetle_wswan/distinfo
new file mode 100644
index 000000000000..ac628b192143
--- /dev/null
+++ b/games/libretro-beetle_wswan/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584482740
+SHA256 (libretro-beetle-wswan-libretro-0.20200313-5b03d1b_GH0.tar.gz) = d9c38e2321229f1e57745ddf8a5220fbe64218770353e155e48386f08f8ebd45
+SIZE (libretro-beetle-wswan-libretro-0.20200313-5b03d1b_GH0.tar.gz) = 151768
diff --git a/games/libretro-beetle_wswan/pkg-descr b/games/libretro-beetle_wswan/pkg-descr
new file mode 100644
index 000000000000..23f2159bda2b
--- /dev/null
+++ b/games/libretro-beetle_wswan/pkg-descr
@@ -0,0 +1,3 @@
+Standalone port of Mednafen WonderSwan to libretro, itself a fork of Cygne.
+
+WWW: https://github.com/libretro/beetle-wswan-libretro
diff --git a/games/libretro-bluemsx/Makefile b/games/libretro-bluemsx/Makefile
new file mode 100644
index 000000000000..afe4f371e0d5
--- /dev/null
+++ b/games/libretro-bluemsx/Makefile
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+PORTNAME= libretro-bluemsx
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of blueMSX to the libretro API
+
+LICENSE= GPLv3
+
+BROKEN_aarch64= error: constant expression evaluates to -1 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= blueMSX-libretro
+GH_TAGNAME= 7a1d40e
+
+PLIST_FILES= libexec/libretro/bluemsx_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-bluemsx/distinfo b/games/libretro-bluemsx/distinfo
new file mode 100644
index 000000000000..d59af920189c
--- /dev/null
+++ b/games/libretro-bluemsx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584482968
+SHA256 (libretro-blueMSX-libretro-0.20200313-7a1d40e_GH0.tar.gz) = 8a17b7007c193f7ebdd8f3bbb80b5c74d9130130a4557f2ec47b22ae27ea6fce
+SIZE (libretro-blueMSX-libretro-0.20200313-7a1d40e_GH0.tar.gz) = 6602066
diff --git a/games/libretro-bluemsx/pkg-descr b/games/libretro-bluemsx/pkg-descr
new file mode 100644
index 000000000000..14ad125454ec
--- /dev/null
+++ b/games/libretro-bluemsx/pkg-descr
@@ -0,0 +1,3 @@
+Port of blueMSX to the libretro API.
+
+WWW: https://github.com/libretro/blueMSX-libretro
diff --git a/games/libretro-desmume2015/Makefile b/games/libretro-desmume2015/Makefile
new file mode 100644
index 000000000000..671f76ccf9ba
--- /dev/null
+++ b/games/libretro-desmume2015/Makefile
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+PORTNAME= libretro-desmume2015
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of Desmume to libretro based on Desmume SVN circa 2015
+
+LICENSE= GPLv2
+
+BROKEN_aarch64= fails to compile: invokes x86 assembler
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= desmume2015
+GH_TAGNAME= 93d5789
+
+PLIST_FILES= libexec/libretro/desmume2015_libretro.so
+
+MAKEFILE= Makefile.freebsd
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-desmume2015/distinfo b/games/libretro-desmume2015/distinfo
new file mode 100644
index 000000000000..7d4d85918778
--- /dev/null
+++ b/games/libretro-desmume2015/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584483086
+SHA256 (libretro-desmume2015-0.20200313-93d5789_GH0.tar.gz) = 950cb8b0e3564e6c810a9b29bf0ae8a4619f3b5b2db8d97d8ee150199cc2e33a
+SIZE (libretro-desmume2015-0.20200313-93d5789_GH0.tar.gz) = 1374909
diff --git a/games/libretro-desmume2015/files/patch-Makefile.freebsd b/games/libretro-desmume2015/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..aea5189f337d
--- /dev/null
+++ b/games/libretro-desmume2015/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-17 22:12:07 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd desmume && ${MAKE} -f Makefile.libretro
diff --git a/games/libretro-desmume2015/files/patch-desmume_src_libretro-common_rthreads_rthreads.c b/games/libretro-desmume2015/files/patch-desmume_src_libretro-common_rthreads_rthreads.c
new file mode 100644
index 000000000000..33166ce59c20
--- /dev/null
+++ b/games/libretro-desmume2015/files/patch-desmume_src_libretro-common_rthreads_rthreads.c
@@ -0,0 +1,11 @@
+--- desmume/src/libretro-common/rthreads/rthreads.c.orig 2020-03-17 22:13:05 UTC
++++ desmume/src/libretro-common/rthreads/rthreads.c
+@@ -60,6 +60,8 @@
+ #include <mach/mach.h>
+ #endif
+
++#include <sys/time.h>
++
+ struct thread_data
+ {
+ void (*func)(void*);
diff --git a/games/libretro-desmume2015/pkg-descr b/games/libretro-desmume2015/pkg-descr
new file mode 100644
index 000000000000..910c650ef930
--- /dev/null
+++ b/games/libretro-desmume2015/pkg-descr
@@ -0,0 +1,3 @@
+Port of Desmume to libretro based on Desmume SVN circa 2015.
+
+WWW: https://github.com/libretro/desmume2015
diff --git a/games/libretro-dosbox/Makefile b/games/libretro-dosbox/Makefile
new file mode 100644
index 000000000000..9859268b4d46
--- /dev/null
+++ b/games/libretro-dosbox/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-dosbox
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of DOSBox (upstream) to the libretro API
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= dosbox-libretro
+GH_TAGNAME= e4ed503
+
+PLIST_FILES= libexec/libretro/dosbox_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-dosbox/distinfo b/games/libretro-dosbox/distinfo
new file mode 100644
index 000000000000..68473f2f17ba
--- /dev/null
+++ b/games/libretro-dosbox/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584483330
+SHA256 (libretro-dosbox-libretro-0.20200313-e4ed503_GH0.tar.gz) = 0e5c69964d3a45b832640554fb3c791c2d75338e18a2f20a4b0b47ca515b3d5b
+SIZE (libretro-dosbox-libretro-0.20200313-e4ed503_GH0.tar.gz) = 1186313
diff --git a/games/libretro-dosbox/files/patch-libretro-common_libco_aarch64.c b/games/libretro-dosbox/files/patch-libretro-common_libco_aarch64.c
new file mode 100644
index 000000000000..dec40ead577a
--- /dev/null
+++ b/games/libretro-dosbox/files/patch-libretro-common_libco_aarch64.c
@@ -0,0 +1,17 @@
+--- libretro-common/libco/aarch64.c.orig 2020-04-28 06:08:20 UTC
++++ libretro-common/libco/aarch64.c
+@@ -12,7 +12,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-dosbox/pkg-descr b/games/libretro-dosbox/pkg-descr
new file mode 100644
index 000000000000..1382b74add04
--- /dev/null
+++ b/games/libretro-dosbox/pkg-descr
@@ -0,0 +1,3 @@
+Port of DOSBox (upstream) to the libretro API.
+
+WWW: https://github.com/libretro/dosbox-libretro
diff --git a/games/libretro-emux/Makefile b/games/libretro-emux/Makefile
new file mode 100644
index 000000000000..e7da43903b0d
--- /dev/null
+++ b/games/libretro-emux/Makefile
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+PORTNAME= libretro-emux
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Emux is a cross-platform emulator project supporting various machines
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= emux
+GH_TAGNAME= 640d4ba
+
+PLIST_FILES= libexec/libretro/emux_chip8_libretro.so \
+ libexec/libretro/emux_gb_libretro.so \
+ libexec/libretro/emux_nes_libretro.so \
+ libexec/libretro/emux_sms_libretro.so
+
+MAKEFILE= Makefile.freebsd
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-emux/distinfo b/games/libretro-emux/distinfo
new file mode 100644
index 000000000000..27e750547eb0
--- /dev/null
+++ b/games/libretro-emux/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584483491
+SHA256 (libretro-emux-0.20200313-640d4ba_GH0.tar.gz) = a3a3ad177d8859b2c114d340b9d287048aa45d69b6829903fd24f01ac9aea81c
+SIZE (libretro-emux-0.20200313-640d4ba_GH0.tar.gz) = 187661
diff --git a/games/libretro-emux/files/patch-Makefile.freebsd b/games/libretro-emux/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..9db73a926727
--- /dev/null
+++ b/games/libretro-emux/files/patch-Makefile.freebsd
@@ -0,0 +1,10 @@
+--- Makefile.freebsd.orig 2020-03-17 22:18:45 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,7 @@
++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-emux/files/patch-emux_libretro_Makefile.bsd b/games/libretro-emux/files/patch-emux_libretro_Makefile.bsd
new file mode 100644
index 000000000000..34b966558688
--- /dev/null
+++ b/games/libretro-emux/files/patch-emux_libretro_Makefile.bsd
@@ -0,0 +1,91 @@
+--- emux/libretro/Makefile.bsd.orig 2016-11-09 04:30:27 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-emux/files/patch-libretro_Makefile.bsd b/games/libretro-emux/files/patch-libretro_Makefile.bsd
new file mode 100644
index 000000000000..70e805909b66
--- /dev/null
+++ b/games/libretro-emux/files/patch-libretro_Makefile.bsd
@@ -0,0 +1,91 @@
+--- libretro/Makefile.bsd.orig 2020-03-17 22:22:41 UTC
++++ 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-emux/pkg-descr b/games/libretro-emux/pkg-descr
new file mode 100644
index 000000000000..3b04f85ff353
--- /dev/null
+++ b/games/libretro-emux/pkg-descr
@@ -0,0 +1,3 @@
+Emux is a cross-platform emulator project supporting various machines.
+
+WWW: https://github.com/libretro/emux
diff --git a/games/libretro-fbalpha/Makefile b/games/libretro-fbalpha/Makefile
new file mode 100644
index 000000000000..0b11fce87de0
--- /dev/null
+++ b/games/libretro-fbalpha/Makefile
@@ -0,0 +1,34 @@
+# $FreeBSD$
+
+PORTNAME= libretro-fbalpha
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Final Burn Alpha port for libretro
+
+LICENSE= FBA
+LICENSE_NAME= FBA
+LICENSE_FILE= ${WRKSRC}/src/license.txt
+LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+PLIST_FILES= libexec/libretro/fbalpha_libretro.so
+
+NO_CDROM= Commercial users must seek permission from copyright holders.
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= fbalpha
+GH_TAGNAME= 84eb9d9
+
+MAKEFILE= Makefile.freebsd
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-fbalpha/distinfo b/games/libretro-fbalpha/distinfo
new file mode 100644
index 000000000000..0471eb441df3
--- /dev/null
+++ b/games/libretro-fbalpha/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584483886
+SHA256 (libretro-fbalpha-0.20200313-84eb9d9_GH0.tar.gz) = d26559d7869fe327bb8f7fcbd31bc5becf18b557ba73a186166bd0e67354ddc7
+SIZE (libretro-fbalpha-0.20200313-84eb9d9_GH0.tar.gz) = 11752465
diff --git a/games/libretro-fbalpha/files/patch-Makefile.freebsd b/games/libretro-fbalpha/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..0290a6d3be5a
--- /dev/null
+++ b/games/libretro-fbalpha/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-17 22:25:53 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ $(foreach p,performance,${MAKE} -f makefile.libretro profile=$(p);)
diff --git a/games/libretro-fbalpha/pkg-descr b/games/libretro-fbalpha/pkg-descr
new file mode 100644
index 000000000000..2402754629ac
--- /dev/null
+++ b/games/libretro-fbalpha/pkg-descr
@@ -0,0 +1,3 @@
+Final Burn Alpha port for libretro.
+
+WWW: https://github.com/libretro/libretro-fbalpha
diff --git a/games/libretro-fceumm/Makefile b/games/libretro-fceumm/Makefile
new file mode 100644
index 000000000000..666e4b697d40
--- /dev/null
+++ b/games/libretro-fceumm/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+PORTNAME= libretro-fceumm
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Unofficial build of FCEU Ultra by CaH4e3
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= 68b8f0e
+
+PLIST_FILES= libexec/libretro/fceumm_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-fceumm/distinfo b/games/libretro-fceumm/distinfo
new file mode 100644
index 000000000000..bd2e2c141825
--- /dev/null
+++ b/games/libretro-fceumm/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484113
+SHA256 (libretro-libretro-fceumm-0.20200313-68b8f0e_GH0.tar.gz) = ef0c7c8635d5b33251ae9759ffdfa6613b08157ac39d5f10f7242a0cc4c03222
+SIZE (libretro-libretro-fceumm-0.20200313-68b8f0e_GH0.tar.gz) = 495038
diff --git a/games/libretro-fceumm/pkg-descr b/games/libretro-fceumm/pkg-descr
new file mode 100644
index 000000000000..f54d13ed1de4
--- /dev/null
+++ b/games/libretro-fceumm/pkg-descr
@@ -0,0 +1,3 @@
+Unofficial build of FCEU Ultra by CaH4e3 that supports more mappers
+
+WWW: https://github.com/libretro/libretro-fceumm
diff --git a/games/libretro-fuse/Makefile b/games/libretro-fuse/Makefile
new file mode 100644
index 000000000000..51db2eda1a22
--- /dev/null
+++ b/games/libretro-fuse/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-fuse
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of the Fuse Unix Spectrum Emulator to libretro
+
+LICENSE= GPLv3
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= fuse-libretro
+GH_TAGNAME= ef603d1
+
+PLIST_FILES= libexec/libretro/fuse_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-fuse/distinfo b/games/libretro-fuse/distinfo
new file mode 100644
index 000000000000..ae46a0da5d5c
--- /dev/null
+++ b/games/libretro-fuse/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484166
+SHA256 (libretro-fuse-libretro-0.20200313-ef603d1_GH0.tar.gz) = b17f0179fe1aeb13dffa7b28bfb4198f20b7ecf7abcbb39ab59158afd27afb65
+SIZE (libretro-fuse-libretro-0.20200313-ef603d1_GH0.tar.gz) = 4317370
diff --git a/games/libretro-fuse/pkg-descr b/games/libretro-fuse/pkg-descr
new file mode 100644
index 000000000000..03780f738f80
--- /dev/null
+++ b/games/libretro-fuse/pkg-descr
@@ -0,0 +1,3 @@
+A port of the Fuse Unix Spectrum Emulator to libretro
+
+WWW: https://github.com/libretro/fuse-libretro
diff --git a/games/libretro-gambatte/Makefile b/games/libretro-gambatte/Makefile
new file mode 100644
index 000000000000..b54f625f754a
--- /dev/null
+++ b/games/libretro-gambatte/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-gambatte
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Libretro Implementation of libgambatte, a Game Boy Color emulator
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= gambatte-libretro
+GH_TAGNAME= 132f36e
+
+PLIST_FILES= libexec/libretro/gambatte_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-gambatte/distinfo b/games/libretro-gambatte/distinfo
new file mode 100644
index 000000000000..d08fa92b1f57
--- /dev/null
+++ b/games/libretro-gambatte/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484252
+SHA256 (libretro-gambatte-libretro-0.20200313-132f36e_GH0.tar.gz) = 552518381fefc23a4726c65ea06ac8756a11f1d02eda3d210a93e958316cc63d
+SIZE (libretro-gambatte-libretro-0.20200313-132f36e_GH0.tar.gz) = 206163
diff --git a/games/libretro-gambatte/pkg-descr b/games/libretro-gambatte/pkg-descr
new file mode 100644
index 000000000000..5e43bcb51fa9
--- /dev/null
+++ b/games/libretro-gambatte/pkg-descr
@@ -0,0 +1,3 @@
+Libretro implementation of libgambatte, a Game Boy Color emulator.
+
+WWW: https://github.com/libretro/gambatte-libretro
diff --git a/games/libretro-genesis_plus_gx/Makefile b/games/libretro-genesis_plus_gx/Makefile
new file mode 100644
index 000000000000..01ed8eae4031
--- /dev/null
+++ b/games/libretro-genesis_plus_gx/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PORTNAME= libretro-genesis_plus_gx
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Enhanced port of Genesis Plus
+
+LICENSE= GPGX
+LICENSE_NAME= GPGX
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+NO_CDROM= Commercial users must seek permission from copyright holders.
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= Genesis-Plus-GX
+GH_TAGNAME= 5055106
+
+PLIST_FILES= libexec/libretro/genesis_plus_gx_libretro.so
+
+MAKEFILE= Makefile.libretro
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-genesis_plus_gx/distinfo b/games/libretro-genesis_plus_gx/distinfo
new file mode 100644
index 000000000000..9dd780ca1e88
--- /dev/null
+++ b/games/libretro-genesis_plus_gx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484315
+SHA256 (libretro-Genesis-Plus-GX-0.20200313-5055106_GH0.tar.gz) = dce2aac66f0dd9874d98f6e123f427ff5b14f11dd268cb0838749a0ee5eb7b89
+SIZE (libretro-Genesis-Plus-GX-0.20200313-5055106_GH0.tar.gz) = 6504144
diff --git a/games/libretro-genesis_plus_gx/pkg-descr b/games/libretro-genesis_plus_gx/pkg-descr
new file mode 100644
index 000000000000..475369c2d94d
--- /dev/null
+++ b/games/libretro-genesis_plus_gx/pkg-descr
@@ -0,0 +1,3 @@
+An enhanced port of Genesis Plus - accurate & portable Sega 8/16 bit emulator
+
+WWW: https://github.com/libretro/Genesis-Plus-GX
diff --git a/games/libretro-gpsp/Makefile b/games/libretro-gpsp/Makefile
new file mode 100644
index 000000000000..fbac1e2c4fd6
--- /dev/null
+++ b/games/libretro-gpsp/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-gpsp
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Gameboy emulator for libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= gpsp
+GH_TAGNAME= d8cf63b
+
+PLIST_FILES= libexec/libretro/gpsp_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-gpsp/distinfo b/games/libretro-gpsp/distinfo
new file mode 100644
index 000000000000..4f860cf70d0a
--- /dev/null
+++ b/games/libretro-gpsp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484448
+SHA256 (libretro-gpsp-0.20200313-d8cf63b_GH0.tar.gz) = 4eefb3d19e911b6a19e945637e441dfa3e22af14088f8698ea4b257b278d105c
+SIZE (libretro-gpsp-0.20200313-d8cf63b_GH0.tar.gz) = 251726
diff --git a/games/libretro-gpsp/files/patch-libco_aarch64.c b/games/libretro-gpsp/files/patch-libco_aarch64.c
new file mode 100644
index 000000000000..a96a0a96fa89
--- /dev/null
+++ b/games/libretro-gpsp/files/patch-libco_aarch64.c
@@ -0,0 +1,17 @@
+--- libco/aarch64.c.orig 2020-04-28 06:29:00 UTC
++++ libco/aarch64.c
+@@ -12,7 +12,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-gpsp/pkg-descr b/games/libretro-gpsp/pkg-descr
new file mode 100644
index 000000000000..237cc2c89559
--- /dev/null
+++ b/games/libretro-gpsp/pkg-descr
@@ -0,0 +1,3 @@
+gpSP for libretro.
+
+WWW: https://github.com/libretro/gpsp
diff --git a/games/libretro-gw/Makefile b/games/libretro-gw/Makefile
new file mode 100644
index 000000000000..7fd6f46ca94f
--- /dev/null
+++ b/games/libretro-gw/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-gw
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Libretro core for Game & Watch simulators
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= gw-libretro
+GH_TAGNAME= 819b1dd
+
+PLIST_FILES= libexec/libretro/gw_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-gw/distinfo b/games/libretro-gw/distinfo
new file mode 100644
index 000000000000..0b5eb11f26b2
--- /dev/null
+++ b/games/libretro-gw/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484502
+SHA256 (libretro-gw-libretro-0.20200313-819b1dd_GH0.tar.gz) = 017a8e1c190059717a0e6b4159e839429849f3336604408954eb46247eaceeee
+SIZE (libretro-gw-libretro-0.20200313-819b1dd_GH0.tar.gz) = 3615669
diff --git a/games/libretro-gw/pkg-descr b/games/libretro-gw/pkg-descr
new file mode 100644
index 000000000000..1ff0d3d2c081
--- /dev/null
+++ b/games/libretro-gw/pkg-descr
@@ -0,0 +1,3 @@
+A libretro core for Game & Watch simulators
+
+WWW: https://github.com/libretro/gw-libretro
diff --git a/games/libretro-handy/Makefile b/games/libretro-handy/Makefile
new file mode 100644
index 000000000000..429c3d8e67d3
--- /dev/null
+++ b/games/libretro-handy/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+PORTNAME= libretro-handy
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Atari Lynx emulator Handy for Libretro
+
+LICENSE= ZLIB
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= c9fe65d
+
+PLIST_FILES= libexec/libretro/handy_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-handy/distinfo b/games/libretro-handy/distinfo
new file mode 100644
index 000000000000..fb948c403d0c
--- /dev/null
+++ b/games/libretro-handy/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484553
+SHA256 (libretro-libretro-handy-0.20200313-c9fe65d_GH0.tar.gz) = 1f47a92d0ac46f12e8ff4af6d067cf24169ec76ae1fbbc106b56a252a0579cdc
+SIZE (libretro-libretro-handy-0.20200313-c9fe65d_GH0.tar.gz) = 110435
diff --git a/games/libretro-handy/pkg-descr b/games/libretro-handy/pkg-descr
new file mode 100644
index 000000000000..9ebd63d1e432
--- /dev/null
+++ b/games/libretro-handy/pkg-descr
@@ -0,0 +1,3 @@
+K. Wilkins' Atari Lynx emulator Handy for Libretro.
+
+WWW: https://github.com/libretro/libretro-handy
diff --git a/games/libretro-hatari/Makefile b/games/libretro-hatari/Makefile
new file mode 100644
index 000000000000..3c57acf5a36e
--- /dev/null
+++ b/games/libretro-hatari/Makefile
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+PORTNAME= libretro-hatari
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Hatari is an Atari ST/STE/TT/Falcon emulator
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= hatari
+GH_TAGNAME= ec1b59c
+
+PLIST_FILES= libexec/libretro/hatari_libretro.so
+
+MAKEFILE= Makefile.libretro
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-hatari/distinfo b/games/libretro-hatari/distinfo
new file mode 100644
index 000000000000..c3f4559b55af
--- /dev/null
+++ b/games/libretro-hatari/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584484620
+SHA256 (libretro-hatari-0.20200313-ec1b59c_GH0.tar.gz) = 8539808c52b0078d9f3341c20cd9d13583c678f6d7e425cd3722c967209c840b
+SIZE (libretro-hatari-0.20200313-ec1b59c_GH0.tar.gz) = 2757042
diff --git a/games/libretro-hatari/files/patch-libretro_libretro-sdk_libco_aarch64.c b/games/libretro-hatari/files/patch-libretro_libretro-sdk_libco_aarch64.c
new file mode 100644
index 000000000000..6233d550d983
--- /dev/null
+++ b/games/libretro-hatari/files/patch-libretro_libretro-sdk_libco_aarch64.c
@@ -0,0 +1,17 @@
+--- libretro/libretro-sdk/libco/aarch64.c.orig 2020-04-28 06:22:25 UTC
++++ libretro/libretro-sdk/libco/aarch64.c
+@@ -12,7 +12,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-hatari/files/patch-libretro_libretro-sdk_rthreads_rthreads.c b/games/libretro-hatari/files/patch-libretro_libretro-sdk_rthreads_rthreads.c
new file mode 100644
index 000000000000..fef03b7c7275
--- /dev/null
+++ b/games/libretro-hatari/files/patch-libretro_libretro-sdk_rthreads_rthreads.c
@@ -0,0 +1,11 @@
+--- libretro/libretro-sdk/rthreads/rthreads.c.orig 2020-03-17 22:37:38 UTC
++++ libretro/libretro-sdk/rthreads/rthreads.c
+@@ -44,6 +44,8 @@
+ #include <mach/mach.h>
+ #endif
+
++#include <time.h>
++
+ struct thread_data
+ {
+ void (*func)(void*);
diff --git a/games/libretro-hatari/pkg-descr b/games/libretro-hatari/pkg-descr
new file mode 100644
index 000000000000..e8b81f3f8d39
--- /dev/null
+++ b/games/libretro-hatari/pkg-descr
@@ -0,0 +1,3 @@
+Hatari is an Atari ST/STE/TT/Falcon emulator
+
+WWW: https://github.com/libretro/hatari
diff --git a/games/libretro-mame2000/Makefile b/games/libretro-mame2000/Makefile
new file mode 100644
index 000000000000..b2fca13d8e7e
--- /dev/null
+++ b/games/libretro-mame2000/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-mame2000
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= MAME (0.37b5) for libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= mame2000-libretro
+GH_TAGNAME= e5d4a93
+
+PLIST_FILES= libexec/libretro/mame2000_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-mame2000/distinfo b/games/libretro-mame2000/distinfo
new file mode 100644
index 000000000000..d2f3dd031be5
--- /dev/null
+++ b/games/libretro-mame2000/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584485898
+SHA256 (libretro-mame2000-libretro-0.20200313-e5d4a93_GH0.tar.gz) = 406f5b569bbe298139b5be735df3ceb94762d241aeab5c664da57d87a326dec0
+SIZE (libretro-mame2000-libretro-0.20200313-e5d4a93_GH0.tar.gz) = 5636744
diff --git a/games/libretro-mame2000/files/patch-src_libretro_libretro-common_libco_aarch64.c b/games/libretro-mame2000/files/patch-src_libretro_libretro-common_libco_aarch64.c
new file mode 100644
index 000000000000..59d149c9ff55
--- /dev/null
+++ b/games/libretro-mame2000/files/patch-src_libretro_libretro-common_libco_aarch64.c
@@ -0,0 +1,17 @@
+--- src/libretro/libretro-common/libco/aarch64.c.orig 2020-04-28 06:27:38 UTC
++++ src/libretro/libretro-common/libco/aarch64.c
+@@ -12,7 +12,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-mame2000/pkg-descr b/games/libretro-mame2000/pkg-descr
new file mode 100644
index 000000000000..98108df08268
--- /dev/null
+++ b/games/libretro-mame2000/pkg-descr
@@ -0,0 +1,3 @@
+MAME 0.37b5 for libretro
+
+WWW: https://github.com/libretro/mame2000-libretro
diff --git a/games/libretro-mame2003/Makefile b/games/libretro-mame2003/Makefile
new file mode 100644
index 000000000000..c9a7b17244a5
--- /dev/null
+++ b/games/libretro-mame2003/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-mame2003
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= MAME 0.78 for libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= mame2003-libretro
+GH_TAGNAME= 8259601
+
+PLIST_FILES= libexec/libretro/mame2003_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-mame2003/distinfo b/games/libretro-mame2003/distinfo
new file mode 100644
index 000000000000..01b239ae3100
--- /dev/null
+++ b/games/libretro-mame2003/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1587125582
+SHA256 (libretro-mame2003-libretro-0.20200313-8259601_GH0.tar.gz) = 15f540d69ba5c7d410bfe28973d7f9ae79e4bd7d51f0b966ba61f8db92d6f096
+SIZE (libretro-mame2003-libretro-0.20200313-8259601_GH0.tar.gz) = 13737486
diff --git a/games/libretro-mame2003/pkg-descr b/games/libretro-mame2003/pkg-descr
new file mode 100644
index 000000000000..d376d6400ee1
--- /dev/null
+++ b/games/libretro-mame2003/pkg-descr
@@ -0,0 +1,3 @@
+MAME 0.78 for libretro. Compatible with MAME 0.78 romsets.
+
+WWW: https://github.com/libretro/mame2003-libretro
diff --git a/games/libretro-mame2003_plus/Makefile b/games/libretro-mame2003_plus/Makefile
new file mode 100644
index 000000000000..5100100d2474
--- /dev/null
+++ b/games/libretro-mame2003_plus/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-mame2003_plus
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Updated MAME 0.78 for libretro with added game support
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= mame2003-plus-libretro
+GH_TAGNAME= 0134c42
+
+PLIST_FILES= libexec/libretro/mame2003_plus_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-mame2003_plus/distinfo b/games/libretro-mame2003_plus/distinfo
new file mode 100644
index 000000000000..45125e6c6103
--- /dev/null
+++ b/games/libretro-mame2003_plus/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584486143
+SHA256 (libretro-mame2003-plus-libretro-0.20200313-0134c42_GH0.tar.gz) = 84cfc03c45abd224a3ac50a9c2941f2afe910bc6e455c9c6dcd45d0430ce2432
+SIZE (libretro-mame2003-plus-libretro-0.20200313-0134c42_GH0.tar.gz) = 27815282
diff --git a/games/libretro-mame2003_plus/pkg-descr b/games/libretro-mame2003_plus/pkg-descr
new file mode 100644
index 000000000000..598eb1e785cf
--- /dev/null
+++ b/games/libretro-mame2003_plus/pkg-descr
@@ -0,0 +1,3 @@
+Updated MAME 0.78 for libretro with added game support
+
+WWW: https://github.com/libretro/mame2003-plus-libretro
diff --git a/games/libretro-mgba/Makefile b/games/libretro-mgba/Makefile
new file mode 100644
index 000000000000..94fd70853c48
--- /dev/null
+++ b/games/libretro-mgba/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-mgba
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Game Boy Advance Emulator for libretro
+
+LICENSE= MPL20
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= mgba
+GH_TAGNAME= f87f9ef
+
+PLIST_FILES= libexec/libretro/mgba_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-mgba/distinfo b/games/libretro-mgba/distinfo
new file mode 100644
index 000000000000..2a88a0e16f82
--- /dev/null
+++ b/games/libretro-mgba/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584487318
+SHA256 (libretro-mgba-0.20200313-f87f9ef_GH0.tar.gz) = 99bf6d816fb424f8132b08d0faee2970300e5b83728124a0c6da06f68c5ef5f2
+SIZE (libretro-mgba-0.20200313-f87f9ef_GH0.tar.gz) = 11913552
diff --git a/games/libretro-mgba/pkg-descr b/games/libretro-mgba/pkg-descr
new file mode 100644
index 000000000000..75aef678f46e
--- /dev/null
+++ b/games/libretro-mgba/pkg-descr
@@ -0,0 +1,3 @@
+mGBA Game Boy Advance Emulator for libretro.
+
+WWW: https://github.com/libretro/mgba
diff --git a/games/libretro-nestopia/Makefile b/games/libretro-nestopia/Makefile
new file mode 100644
index 000000000000..f2e079e8c62a
--- /dev/null
+++ b/games/libretro-nestopia/Makefile
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+PORTNAME= libretro-nestopia
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= NEStopia emulator for libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= nestopia
+GH_TAGNAME= 70c53f0
+
+PLIST_FILES= libexec/libretro/nestopia_libretro.so
+
+MAKEFILE= Makefile.freebsd
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-nestopia/distinfo b/games/libretro-nestopia/distinfo
new file mode 100644
index 000000000000..cd16d94d4ff5
--- /dev/null
+++ b/games/libretro-nestopia/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584487383
+SHA256 (libretro-nestopia-0.20200313-70c53f0_GH0.tar.gz) = 70a02084de91a84c07fff6aed1f5691cb29f644db363ef7f208be551b58a1e6f
+SIZE (libretro-nestopia-0.20200313-70c53f0_GH0.tar.gz) = 1023562
diff --git a/games/libretro-nestopia/files/patch-Makefile.freebsd b/games/libretro-nestopia/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..17e34453a07a
--- /dev/null
+++ b/games/libretro-nestopia/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-17 23:23:33 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-nestopia/pkg-descr b/games/libretro-nestopia/pkg-descr
new file mode 100644
index 000000000000..10f6ddbb5d1e
--- /dev/null
+++ b/games/libretro-nestopia/pkg-descr
@@ -0,0 +1,3 @@
+Nestopia emulator with libretro interface
+
+WWW: https://github.com/libretro/nestopia
diff --git a/games/libretro-nxengine/Makefile b/games/libretro-nxengine/Makefile
new file mode 100644
index 000000000000..4cd07d53bba4
--- /dev/null
+++ b/games/libretro-nxengine/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-nxengine
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= NXEngine is a Cave Story game engine clone for libretro
+
+LICENSE= GPLv3
+
+USES= compiler:c++11-lib dos2unix gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= nxengine-libretro
+GH_TAGNAME= f39250e
+
+PLIST_FILES= libexec/libretro/nxengine_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-nxengine/distinfo b/games/libretro-nxengine/distinfo
new file mode 100644
index 000000000000..0f701fafce79
--- /dev/null
+++ b/games/libretro-nxengine/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584487535
+SHA256 (libretro-nxengine-libretro-0.20200313-f39250e_GH0.tar.gz) = 499ebf2f07289907292926c87cd8cbdab1521b2ebf80118a5aff0ca75666bd73
+SIZE (libretro-nxengine-libretro-0.20200313-f39250e_GH0.tar.gz) = 2706247
diff --git a/games/libretro-nxengine/pkg-descr b/games/libretro-nxengine/pkg-descr
new file mode 100644
index 000000000000..2c5bb7468e78
--- /dev/null
+++ b/games/libretro-nxengine/pkg-descr
@@ -0,0 +1,3 @@
+Port of NxEngine to the libretro API. NXEngine is a Cave Story game engine clone
+
+WWW: https://github.com/libretro/nxengine-libretro
diff --git a/games/libretro-o2em/Makefile b/games/libretro-o2em/Makefile
new file mode 100644
index 000000000000..bb051fa24825
--- /dev/null
+++ b/games/libretro-o2em/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+PORTNAME= libretro-o2em
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of O2EM to the libretro API, an Odyssey 2 / VideoPac emulator
+
+LICENSE= ART20
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= b23a796
+
+PLIST_FILES= libexec/libretro/o2em_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-o2em/distinfo b/games/libretro-o2em/distinfo
new file mode 100644
index 000000000000..d533a13e92f7
--- /dev/null
+++ b/games/libretro-o2em/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584487595
+SHA256 (libretro-libretro-o2em-0.20200313-b23a796_GH0.tar.gz) = 818d3f8c643b8fa0989f1a737614c25d256d85a4b269b1ef62418129a4e739b7
+SIZE (libretro-libretro-o2em-0.20200313-b23a796_GH0.tar.gz) = 80988
diff --git a/games/libretro-o2em/pkg-descr b/games/libretro-o2em/pkg-descr
new file mode 100644
index 000000000000..088b3259516d
--- /dev/null
+++ b/games/libretro-o2em/pkg-descr
@@ -0,0 +1,3 @@
+Port of O2EM to the libretro API, an Odyssey 2 / VideoPac emulator.
+
+WWW: https://github.com/libretro/libretro-o2em
diff --git a/games/libretro-opera/Makefile b/games/libretro-opera/Makefile
new file mode 100644
index 000000000000..86414a159b01
--- /dev/null
+++ b/games/libretro-opera/Makefile
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME= libretro-opera
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= 3DO core for libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= opera-libretro
+GH_TAGNAME= 27bc265
+
+PLIST_FILES= libexec/libretro/opera_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-opera/distinfo b/games/libretro-opera/distinfo
new file mode 100644
index 000000000000..b3e68ab056d2
--- /dev/null
+++ b/games/libretro-opera/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1587125860
+SHA256 (libretro-opera-libretro-0.20200313-27bc265_GH0.tar.gz) = d5034fb73ae200c693050162ca8e43d54b1ad5391e4166fbd1711e7f61e32672
+SIZE (libretro-opera-libretro-0.20200313-27bc265_GH0.tar.gz) = 909910
diff --git a/games/libretro-opera/files/patch-Makefile b/games/libretro-opera/files/patch-Makefile
new file mode 100644
index 000000000000..69cb01dd2df3
--- /dev/null
+++ b/games/libretro-opera/files/patch-Makefile
@@ -0,0 +1,10 @@
+--- Makefile.orig 2020-04-28 06:20:25 UTC
++++ Makefile
+@@ -50,7 +50,6 @@ unixcygpath = /$(subst :,,$(call unixpath,$1))
+
+ ifneq (,$(findstring unix,$(platform)))
+ AR = ${CC_PREFIX}ar
+- CC = ${CC_PREFIX}gcc
+
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
diff --git a/games/libretro-opera/files/patch-libretro-common_cdrom_cdrom.c b/games/libretro-opera/files/patch-libretro-common_cdrom_cdrom.c
new file mode 100644
index 000000000000..55603b8a81a9
--- /dev/null
+++ b/games/libretro-opera/files/patch-libretro-common_cdrom_cdrom.c
@@ -0,0 +1,19 @@
+--- libretro-common/cdrom/cdrom.c.orig 2020-03-17 23:29:26 UTC
++++ libretro-common/cdrom/cdrom.c
+@@ -478,6 +478,8 @@ static int cdrom_send_command(libretro_vfs_implementat
+ #endif
+
+ retry:
++#if defined(__linux_) || defined(_WIN32)
++
+ #if defined(__linux__) && !defined(ANDROID)
+ if (cached_read || !cdrom_send_command_linux(stream, dir, xfer_buf_pos, request_len, cmd, cmd_len, sense, sizeof(sense)))
+ #else
+@@ -518,6 +520,7 @@ retry:
+ }
+ }
+ else
++#endif
+ {
+ cdrom_print_sense_data(sense, sizeof(sense));
+
diff --git a/games/libretro-opera/pkg-descr b/games/libretro-opera/pkg-descr
new file mode 100644
index 000000000000..a5263bac2e2a
--- /dev/null
+++ b/games/libretro-opera/pkg-descr
@@ -0,0 +1,3 @@
+3DO libretro core.
+
+WWW: https://github.com/libretro/opera-libretro
diff --git a/games/libretro-pcsx_rearmed/Makefile b/games/libretro-pcsx_rearmed/Makefile
new file mode 100644
index 000000000000..e07f821efa41
--- /dev/null
+++ b/games/libretro-pcsx_rearmed/Makefile
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+PORTNAME= libretro-pcsx_rearmed
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Fork of PCSX with ARM optimizations
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= pcsx_rearmed
+GH_TAGNAME= 8fda5dd
+
+PLIST_FILES= libexec/libretro/pcsx_rearmed_libretro.so
+
+MAKEFILE= Makefile.libretro
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-pcsx_rearmed/distinfo b/games/libretro-pcsx_rearmed/distinfo
new file mode 100644
index 000000000000..8a14ea70d114
--- /dev/null
+++ b/games/libretro-pcsx_rearmed/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584487893
+SHA256 (libretro-pcsx_rearmed-0.20200313-8fda5dd_GH0.tar.gz) = afeed219f593203522262b77b8b26ce4d075e604080d7bbf4aad8a0108b0cd1f
+SIZE (libretro-pcsx_rearmed-0.20200313-8fda5dd_GH0.tar.gz) = 2269819
diff --git a/games/libretro-pcsx_rearmed/pkg-descr b/games/libretro-pcsx_rearmed/pkg-descr
new file mode 100644
index 000000000000..83491eb2b883
--- /dev/null
+++ b/games/libretro-pcsx_rearmed/pkg-descr
@@ -0,0 +1,3 @@
+Fork of PCSX with ARM optimizations
+
+WWW: https://github.com/libretro/pcsx_rearmed
diff --git a/games/libretro-picodrive/Makefile b/games/libretro-picodrive/Makefile
new file mode 100644
index 000000000000..80a01bc1fa8b
--- /dev/null
+++ b/games/libretro-picodrive/Makefile
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+PORTNAME= libretro-picodrive
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Fast MegaDrive/MegaCD/32X emulator
+
+LICENSE= PD
+
+BROKEN_aarch64= error: unsupported arch
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= picodrive
+GH_TAGNAME= 600894e
+
+PLIST_FILES= libexec/libretro/picodrive_libretro.so
+
+MAKEFILE= Makefile.libretro
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-picodrive/distinfo b/games/libretro-picodrive/distinfo
new file mode 100644
index 000000000000..89b2503a0e4c
--- /dev/null
+++ b/games/libretro-picodrive/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584488787
+SHA256 (libretro-picodrive-0.20200313-600894e_GH0.tar.gz) = 939a1564c799df211b96522e35609398f7d836a53e38488e80b944baf84aa48d
+SIZE (libretro-picodrive-0.20200313-600894e_GH0.tar.gz) = 1437950
diff --git a/games/libretro-picodrive/pkg-descr b/games/libretro-picodrive/pkg-descr
new file mode 100644
index 000000000000..87a0e1d8646c
--- /dev/null
+++ b/games/libretro-picodrive/pkg-descr
@@ -0,0 +1,3 @@
+Fast MegaDrive/MegaCD/32X emulator
+
+WWW: https://github.com/libretro/picodrive
diff --git a/games/libretro-prboom/Makefile b/games/libretro-prboom/Makefile
new file mode 100644
index 000000000000..37932ed846e3
--- /dev/null
+++ b/games/libretro-prboom/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+PORTNAME= libretro-prboom
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of prboom to libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= 991016b
+
+PLIST_FILES= libexec/libretro/prboom_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-prboom/distinfo b/games/libretro-prboom/distinfo
new file mode 100644
index 000000000000..a37401bd1ace
--- /dev/null
+++ b/games/libretro-prboom/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489015
+SHA256 (libretro-libretro-prboom-0.20200313-991016b_GH0.tar.gz) = 7172dd210a3c96bf052534dfcc823f36d78879afcce76e863d9201129e877290
+SIZE (libretro-libretro-prboom-0.20200313-991016b_GH0.tar.gz) = 2284859
diff --git a/games/libretro-prboom/pkg-descr b/games/libretro-prboom/pkg-descr
new file mode 100644
index 000000000000..1057f665171a
--- /dev/null
+++ b/games/libretro-prboom/pkg-descr
@@ -0,0 +1,3 @@
+Port of prboom to libretro
+
+WWW: https://github.com/libretro/libretro-prboom
diff --git a/games/libretro-prosystem/Makefile b/games/libretro-prosystem/Makefile
new file mode 100644
index 000000000000..db5dd62dfd2e
--- /dev/null
+++ b/games/libretro-prosystem/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-prosystem
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of ProSystem to the libretro API
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= prosystem-libretro
+GH_TAGNAME= 6f7e34a
+
+PLIST_FILES= libexec/libretro/prosystem_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-prosystem/distinfo b/games/libretro-prosystem/distinfo
new file mode 100644
index 000000000000..051f8bbe4913
--- /dev/null
+++ b/games/libretro-prosystem/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489158
+SHA256 (libretro-prosystem-libretro-0.20200313-6f7e34a_GH0.tar.gz) = a52fbe1c65e13adc72e7856b5c29ab61f1d5a185a0180632a3dcfc7191a0d38b
+SIZE (libretro-prosystem-libretro-0.20200313-6f7e34a_GH0.tar.gz) = 76309
diff --git a/games/libretro-prosystem/pkg-descr b/games/libretro-prosystem/pkg-descr
new file mode 100644
index 000000000000..c4bfc6991c77
--- /dev/null
+++ b/games/libretro-prosystem/pkg-descr
@@ -0,0 +1,3 @@
+Port of ProSystem to the libretro API.
+
+WWW: https://github.com/libretro/prosystem-libretro
diff --git a/games/libretro-quicknes/Makefile b/games/libretro-quicknes/Makefile
new file mode 100644
index 000000000000..bf44c44385a6
--- /dev/null
+++ b/games/libretro-quicknes/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-quicknes
+PORTVERSION= 0.20200317
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= NES emulator core for libretro
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= QuickNES_Core
+GH_TAGNAME= 3165481
+
+PLIST_FILES= libexec/libretro/quicknes_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-quicknes/distinfo b/games/libretro-quicknes/distinfo
new file mode 100644
index 000000000000..ea4bb9697eb7
--- /dev/null
+++ b/games/libretro-quicknes/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489206
+SHA256 (libretro-QuickNES_Core-0.20200317-3165481_GH0.tar.gz) = 68e2550e3c7e2bc6580571aeab7f8d133389720344adf41161accce1dcf4dda2
+SIZE (libretro-QuickNES_Core-0.20200317-3165481_GH0.tar.gz) = 185074
diff --git a/games/libretro-quicknes/pkg-descr b/games/libretro-quicknes/pkg-descr
new file mode 100644
index 000000000000..18cb3c99447d
--- /dev/null
+++ b/games/libretro-quicknes/pkg-descr
@@ -0,0 +1,3 @@
+NES emulator core for libretro
+
+WWW: https://github.com/libretro/QuickNES_Core
diff --git a/games/libretro-scummvm/Makefile b/games/libretro-scummvm/Makefile
new file mode 100644
index 000000000000..d1319a0a490c
--- /dev/null
+++ b/games/libretro-scummvm/Makefile
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+PORTNAME= libretro-scummvm
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= ScummVM with libretro backend
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= scummvm
+GH_TAGNAME= de91bf9
+
+PLIST_FILES= libexec/libretro/scummvm_libretro.so
+
+MAKEFILE= Makefile.freebsd
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-scummvm/distinfo b/games/libretro-scummvm/distinfo
new file mode 100644
index 000000000000..fd463c8aa9e7
--- /dev/null
+++ b/games/libretro-scummvm/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489371
+SHA256 (libretro-scummvm-0.20200313-de91bf9_GH0.tar.gz) = 3e9736f58d01feff92b24ba296d0680725d505b314a9f9207569aacf6bc0c99a
+SIZE (libretro-scummvm-0.20200313-de91bf9_GH0.tar.gz) = 54530968
diff --git a/games/libretro-scummvm/files/patch-Makefile.freebsd b/games/libretro-scummvm/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..b00d5b61ec2e
--- /dev/null
+++ b/games/libretro-scummvm/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-17 23:56:43 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd backends/platform/libretro/build && ${MAKE}
diff --git a/games/libretro-scummvm/files/patch-backends_platform_libretro_libretro-common_libco_aarch64.c b/games/libretro-scummvm/files/patch-backends_platform_libretro_libretro-common_libco_aarch64.c
new file mode 100644
index 000000000000..77636d1e4da2
--- /dev/null
+++ b/games/libretro-scummvm/files/patch-backends_platform_libretro_libretro-common_libco_aarch64.c
@@ -0,0 +1,17 @@
+--- backends/platform/libretro/libretro-common/libco/aarch64.c.orig 2020-04-28 06:18:38 UTC
++++ backends/platform/libretro/libretro-common/libco/aarch64.c
+@@ -18,7 +18,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-scummvm/pkg-descr b/games/libretro-scummvm/pkg-descr
new file mode 100644
index 000000000000..7fb4a5365632
--- /dev/null
+++ b/games/libretro-scummvm/pkg-descr
@@ -0,0 +1,3 @@
+ScummVM with libretro backend.
+
+WWW: https://github.com/libretro/scummvm
diff --git a/games/libretro-snes9x/Makefile b/games/libretro-snes9x/Makefile
new file mode 100644
index 000000000000..95eed77cc91d
--- /dev/null
+++ b/games/libretro-snes9x/Makefile
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+PORTNAME= libretro-snes9x
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Snes9x - Portable Super Nintendo emulator
+
+LICENSE= PS
+LICENSE_NAME= PS
+LICENSE_FILE= ${WRKSRC}/LICENSE
+LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
+
+BROKEN_FreeBSD_11= linker error: unrecognized option '-plugin'
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+NO_CDROM= Commercial users must seek permission from copyright holders.
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= snes9x
+GH_TAGNAME= 6db918c
+
+PLIST_FILES= libexec/libretro/snes9x_libretro.so
+
+MAKEFILE= Makefile.freebsd
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-snes9x/distinfo b/games/libretro-snes9x/distinfo
new file mode 100644
index 000000000000..8abb25abb102
--- /dev/null
+++ b/games/libretro-snes9x/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489617
+SHA256 (libretro-snes9x-0.20200313-6db918c_GH0.tar.gz) = ff7ae95cd1e70dd20746ae69ef8565f08317e316b1047e339e63f88832035542
+SIZE (libretro-snes9x-0.20200313-6db918c_GH0.tar.gz) = 2882404
diff --git a/games/libretro-snes9x/files/patch-Makefile.freebsd b/games/libretro-snes9x/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..06829f4e56ea
--- /dev/null
+++ b/games/libretro-snes9x/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-18 00:01:09 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-snes9x/pkg-descr b/games/libretro-snes9x/pkg-descr
new file mode 100644
index 000000000000..8a0fefc2bd4e
--- /dev/null
+++ b/games/libretro-snes9x/pkg-descr
@@ -0,0 +1,3 @@
+Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
+
+WWW: https://github.com/libretro/snes9x
diff --git a/games/libretro-snes9x2005/Makefile b/games/libretro-snes9x2005/Makefile
new file mode 100644
index 000000000000..19f99b6804c6
--- /dev/null
+++ b/games/libretro-snes9x2005/Makefile
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+PORTNAME= libretro-snes9x2005
+PORTVERSION= 0.20200317
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Snes9x - Portable Super Nintendo emulator (1.43)
+
+LICENSE= PS
+LICENSE_NAME= PS
+LICENSE_FILE= ${WRKSRC}/copyright
+LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+NO_CDROM= Commercial users must seek permission from copyright holders.
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= snes9x2005
+GH_TAGNAME= c216559
+
+PLIST_FILES= libexec/libretro/snes9x2005_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-snes9x2005/distinfo b/games/libretro-snes9x2005/distinfo
new file mode 100644
index 000000000000..e6a61f9b81e4
--- /dev/null
+++ b/games/libretro-snes9x2005/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489897
+SHA256 (libretro-snes9x2005-0.20200317-c216559_GH0.tar.gz) = 99e228359a0ba523fac00346e0ce5572a544528978870a22858342711245088a
+SIZE (libretro-snes9x2005-0.20200317-c216559_GH0.tar.gz) = 263480
diff --git a/games/libretro-snes9x2005/files/patch-Makefile.freebsd b/games/libretro-snes9x2005/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..769111b27d77
--- /dev/null
+++ b/games/libretro-snes9x2005/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-18 00:05:14 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-snes9x2005/pkg-descr b/games/libretro-snes9x2005/pkg-descr
new file mode 100644
index 000000000000..02f3ec546d68
--- /dev/null
+++ b/games/libretro-snes9x2005/pkg-descr
@@ -0,0 +1,3 @@
+Snes9x - Portable Super Nintendo Entertainment System (TM) emulator (1.43)
+
+WWW: https://github.com/libretro/snes9x2005
diff --git a/games/libretro-snes9x2010/Makefile b/games/libretro-snes9x2010/Makefile
new file mode 100644
index 000000000000..8ddc0bcfd5e5
--- /dev/null
+++ b/games/libretro-snes9x2010/Makefile
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+PORTNAME= libretro-snes9x2010
+PORTVERSION= 0.20200317
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Snes9x - Portable Super Nintendo emulator (1.52)
+
+LICENSE= PS
+LICENSE_NAME= PS
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+LICENSE_PERMS= dist-mirror pkg-mirror auto-accept
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+NO_CDROM= Commercial users must seek permission from copyright holders.
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= snes9x2010
+GH_TAGNAME= ba9f224
+
+PLIST_FILES= libexec/libretro/snes9x2010_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-snes9x2010/distinfo b/games/libretro-snes9x2010/distinfo
new file mode 100644
index 000000000000..064ee3b2021d
--- /dev/null
+++ b/games/libretro-snes9x2010/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584489994
+SHA256 (libretro-snes9x2010-0.20200317-ba9f224_GH0.tar.gz) = 4e3c7a3d382c6b990808a62c9dd6fa63bf72bdda0304144de5365bbe719642e0
+SIZE (libretro-snes9x2010-0.20200317-ba9f224_GH0.tar.gz) = 394653
diff --git a/games/libretro-snes9x2010/files/patch-Makefile.freebsd b/games/libretro-snes9x2010/files/patch-Makefile.freebsd
new file mode 100644
index 000000000000..8738762b577b
--- /dev/null
+++ b/games/libretro-snes9x2010/files/patch-Makefile.freebsd
@@ -0,0 +1,5 @@
+--- Makefile.freebsd.orig 2020-03-18 00:06:44 UTC
++++ Makefile.freebsd
+@@ -0,0 +1,2 @@
++all:
++ cd libretro && ${MAKE}
diff --git a/games/libretro-snes9x2010/pkg-descr b/games/libretro-snes9x2010/pkg-descr
new file mode 100644
index 000000000000..6cfee8ded302
--- /dev/null
+++ b/games/libretro-snes9x2010/pkg-descr
@@ -0,0 +1,3 @@
+Snes9x - Portable Super Nintendo Entertainment System (TM) emulator (1.52)
+
+WWW: https://github.com/libretro/snes9x2010
diff --git a/games/libretro-stella2014/Makefile b/games/libretro-stella2014/Makefile
new file mode 100644
index 000000000000..1a176f7171f9
--- /dev/null
+++ b/games/libretro-stella2014/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-stella2014
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of Stella (Atari 2600) to libretro (2014)
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= stella2014-libretro
+GH_TAGNAME= fc87f2c
+
+PLIST_FILES= libexec/libretro/stella2014_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-stella2014/distinfo b/games/libretro-stella2014/distinfo
new file mode 100644
index 000000000000..c30e7f7b1cc8
--- /dev/null
+++ b/games/libretro-stella2014/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490117
+SHA256 (libretro-stella2014-libretro-0.20200313-fc87f2c_GH0.tar.gz) = fb78ef2b0c9437b8b1339ecd619352f015c499aa6048e5a236f53b2ffe1f4147
+SIZE (libretro-stella2014-libretro-0.20200313-fc87f2c_GH0.tar.gz) = 694580
diff --git a/games/libretro-stella2014/pkg-descr b/games/libretro-stella2014/pkg-descr
new file mode 100644
index 000000000000..fb7be3d7e229
--- /dev/null
+++ b/games/libretro-stella2014/pkg-descr
@@ -0,0 +1,3 @@
+Port of Stella (Atari 2600) to libretro (2014).
+
+WWW: https://github.com/libretro/stela2014-libretro
diff --git a/games/libretro-tgbdual/Makefile b/games/libretro-tgbdual/Makefile
new file mode 100644
index 000000000000..1dd1410dcb6a
--- /dev/null
+++ b/games/libretro-tgbdual/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-tgbdual
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= TGB Dual is an open source GB/GBC emulator with game link support
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= tgbdual-libretro
+GH_TAGNAME= 9be31d3
+
+PLIST_FILES= libexec/libretro/tgbdual_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-tgbdual/distinfo b/games/libretro-tgbdual/distinfo
new file mode 100644
index 000000000000..714ffb068595
--- /dev/null
+++ b/games/libretro-tgbdual/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490174
+SHA256 (libretro-tgbdual-libretro-0.20200313-9be31d3_GH0.tar.gz) = 92ff723c2a01888fb43f401a37db53eb76b4b5797ab70418d953912bfe4026f9
+SIZE (libretro-tgbdual-libretro-0.20200313-9be31d3_GH0.tar.gz) = 119742
diff --git a/games/libretro-tgbdual/pkg-descr b/games/libretro-tgbdual/pkg-descr
new file mode 100644
index 000000000000..e707b28d45b2
--- /dev/null
+++ b/games/libretro-tgbdual/pkg-descr
@@ -0,0 +1,3 @@
+TGB Dual is an open source (GPLv2) GB/GBC emulator with game link cable support.
+
+WWW: https://github.com/libretro/tgbdual-libretro
diff --git a/games/libretro-tyrquake/Makefile b/games/libretro-tyrquake/Makefile
new file mode 100644
index 000000000000..65d3ee8a76a1
--- /dev/null
+++ b/games/libretro-tyrquake/Makefile
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME= libretro-tyrquake
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Libretro port of Tyrquake (Quake 1 engine)
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= tyrquake
+GH_TAGNAME= 8c6ec56
+
+PLIST_FILES= libexec/libretro/tyrquake_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-tyrquake/distinfo b/games/libretro-tyrquake/distinfo
new file mode 100644
index 000000000000..b28f8e1d3867
--- /dev/null
+++ b/games/libretro-tyrquake/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490227
+SHA256 (libretro-tyrquake-0.20200313-8c6ec56_GH0.tar.gz) = 12b905583f40585cefae1a91a30404d5889b4cf14f48d00a6d7e27aeae70848f
+SIZE (libretro-tyrquake-0.20200313-8c6ec56_GH0.tar.gz) = 2128962
diff --git a/games/libretro-tyrquake/pkg-descr b/games/libretro-tyrquake/pkg-descr
new file mode 100644
index 000000000000..9e3d7b151683
--- /dev/null
+++ b/games/libretro-tyrquake/pkg-descr
@@ -0,0 +1,3 @@
+Libretro port of Tyrquake (Quake 1 engine)
+
+WWW: https://github.com/libretro/libretro-tyrquake
diff --git a/games/libretro-uae/Makefile b/games/libretro-uae/Makefile
new file mode 100644
index 000000000000..9f5d7153774b
--- /dev/null
+++ b/games/libretro-uae/Makefile
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+PORTNAME= libretro-uae
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Libretro port of UAE
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake gl
+USE_LDCONFIG= yes
+USE_GL= gl
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= 8333daa
+
+PLIST_FILES= libexec/libretro/puae_libretro.so
+
+post-patch:
+ ${REINPLACE_CMD} 's/" GIT_VERSION/${GH_TAGNAME}"/' ${WRKSRC}/libretro/libretro.c
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-uae/distinfo b/games/libretro-uae/distinfo
new file mode 100644
index 000000000000..38587bd33f6a
--- /dev/null
+++ b/games/libretro-uae/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490306
+SHA256 (libretro-libretro-uae-0.20200313-8333daa_GH0.tar.gz) = e20c9b8c33e9da99db28bd5af18c3adeac30269fac9b1a965b5a49a587650847
+SIZE (libretro-libretro-uae-0.20200313-8333daa_GH0.tar.gz) = 5327186
diff --git a/games/libretro-uae/files/patch-libco_aarch64.c b/games/libretro-uae/files/patch-libco_aarch64.c
new file mode 100644
index 000000000000..090db8ad5138
--- /dev/null
+++ b/games/libretro-uae/files/patch-libco_aarch64.c
@@ -0,0 +1,17 @@
+--- libco/aarch64.c.orig 2020-04-28 06:24:48 UTC
++++ libco/aarch64.c
+@@ -12,7 +12,13 @@
+ #include <stdint.h>
+
+ #ifndef IOS
+-#include <malloc.h>
++#include <sys/param.h>
++
++void *
++memalign(size_t align, size_t size)
++{
++ return (aligned_alloc(align, roundup(size, align)));
++}
+ #endif
+
+ #ifdef __cplusplus
diff --git a/games/libretro-uae/files/patch-sources_src_disk.c b/games/libretro-uae/files/patch-sources_src_disk.c
new file mode 100644
index 000000000000..b8b0cb3aba06
--- /dev/null
+++ b/games/libretro-uae/files/patch-sources_src_disk.c
@@ -0,0 +1,10 @@
+--- sources/src/disk.c.orig 2020-03-18 00:12:17 UTC
++++ sources/src/disk.c
+@@ -282,7 +282,6 @@ static void disk_date (uae_u8 *p)
+ struct mytimeval mtv;
+
+ gettimeofday (&tv, NULL);
+- tv.tv_sec -= timezone;
+ mtv.tv_sec = tv.tv_sec;
+ mtv.tv_usec = tv.tv_usec;
+ timeval_to_amiga (&mtv, &days, &mins, &ticks);
diff --git a/games/libretro-uae/pkg-descr b/games/libretro-uae/pkg-descr
new file mode 100644
index 000000000000..6d32db128616
--- /dev/null
+++ b/games/libretro-uae/pkg-descr
@@ -0,0 +1,3 @@
+Libretro port of UAE.
+
+WWW: https://github.com/libretro/libretro-uae
diff --git a/games/libretro-vbanext/Makefile b/games/libretro-vbanext/Makefile
new file mode 100644
index 000000000000..1fd07f39a4a9
--- /dev/null
+++ b/games/libretro-vbanext/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-vbanext
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Optimized port of VBA-M to Libretro, a Game Boy Advance emulator
+
+LICENSE= GPLv2
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= vba-next
+GH_TAGNAME= 019132d
+
+PLIST_FILES= libexec/libretro/vba_next_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-vbanext/distinfo b/games/libretro-vbanext/distinfo
new file mode 100644
index 000000000000..13c26491f532
--- /dev/null
+++ b/games/libretro-vbanext/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490441
+SHA256 (libretro-vba-next-0.20200313-019132d_GH0.tar.gz) = 137e3a01b7cc03a6b025e300395ccfb79a644e2005f07516ebc8dc8d4d70d8cd
+SIZE (libretro-vba-next-0.20200313-019132d_GH0.tar.gz) = 202135
diff --git a/games/libretro-vbanext/pkg-descr b/games/libretro-vbanext/pkg-descr
new file mode 100644
index 000000000000..b67060aefb89
--- /dev/null
+++ b/games/libretro-vbanext/pkg-descr
@@ -0,0 +1,3 @@
+Optimized port of VBA-M to Libretro, a Game Boy Advance emulator.
+
+WWW: https://github.com/libretro/vba-next
diff --git a/games/libretro-vecx/Makefile b/games/libretro-vecx/Makefile
new file mode 100644
index 000000000000..67504fb372e0
--- /dev/null
+++ b/games/libretro-vecx/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+PORTNAME= libretro-vecx
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Vectrex emulator for libretro
+
+LICENSE= GPLv3
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_TAGNAME= 3212052
+
+PLIST_FILES= libexec/libretro/vecx_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-vecx/distinfo b/games/libretro-vecx/distinfo
new file mode 100644
index 000000000000..00a67aaa4b04
--- /dev/null
+++ b/games/libretro-vecx/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490508
+SHA256 (libretro-libretro-vecx-0.20200313-3212052_GH0.tar.gz) = 8285451b37fded9e366e83f9f56310e9d4c4297e6446c36345b862a8fcd646ce
+SIZE (libretro-libretro-vecx-0.20200313-3212052_GH0.tar.gz) = 142364
diff --git a/games/libretro-vecx/pkg-descr b/games/libretro-vecx/pkg-descr
new file mode 100644
index 000000000000..c14570915088
--- /dev/null
+++ b/games/libretro-vecx/pkg-descr
@@ -0,0 +1,3 @@
+Vectrex Emulator for libretro.
+
+WWW: https://github.com/libretro/libretro-vecx
diff --git a/games/libretro-virtualjaguar/Makefile b/games/libretro-virtualjaguar/Makefile
new file mode 100644
index 000000000000..fdc0d8eae221
--- /dev/null
+++ b/games/libretro-virtualjaguar/Makefile
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PORTNAME= libretro-virtualjaguar
+PORTVERSION= 0.20200313
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Port of Virtual Jaguar to Libretro
+
+LICENSE= GPLv3
+
+USES= compiler:c++11-lib gmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= libretro
+GH_PROJECT= virtualjaguar-libretro
+GH_TAGNAME= a162fb7
+
+PLIST_FILES= libexec/libretro/virtualjaguar_libretro.so
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/libretro;
+ ${INSTALL_LIB} $$(find ${WRKSRC}/${COREDIR}/ -name "*.so") ${STAGEDIR}/${PREFIX}/libexec/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-virtualjaguar/distinfo b/games/libretro-virtualjaguar/distinfo
new file mode 100644
index 000000000000..da6ac1139370
--- /dev/null
+++ b/games/libretro-virtualjaguar/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584490582
+SHA256 (libretro-virtualjaguar-libretro-0.20200313-a162fb7_GH0.tar.gz) = 295539ad880d70f1e721d6a1704dfc4ab2e51c06ce7f02c1580862505493f235
+SIZE (libretro-virtualjaguar-libretro-0.20200313-a162fb7_GH0.tar.gz) = 980362
diff --git a/games/libretro-virtualjaguar/pkg-descr b/games/libretro-virtualjaguar/pkg-descr
new file mode 100644
index 000000000000..2f7b22d16dc6
--- /dev/null
+++ b/games/libretro-virtualjaguar/pkg-descr
@@ -0,0 +1,3 @@
+Port of Virtual Jaguar for Libretro.
+
+WWW: https://github.com/libretro/virtualjaguar-libretro
diff --git a/games/libretro/Makefile b/games/libretro/Makefile
new file mode 100644
index 000000000000..46739dc8381c
--- /dev/null
+++ b/games/libretro/Makefile
@@ -0,0 +1,136 @@
+# $FreeBSD$
+
+PORTNAME= libretro
+PORTVERSION= 0.1
+CATEGORIES= games
+
+MAINTAINER= menelkir@itroll.org
+COMMENT= Meta-port for libretro cores
+
+USES= metaport
+
+OPTIONS_DEFINE= 2048 BEETLE_BSNES BEETLE_GBA BEETLE_LYNX BEETLE_NGP \
+ BEETLE_PCE_FAST BEETLE_PCFX BEETLE_PSX BEETLE_SUPERGRAFX \
+ BEETLE_VB BEETLE_WSWAN BLUEMSX DESMUME2015 DOSBOX EMUX \
+ FBALPHA FCEUMM FUSE GAMBATTE GENESIS_PLUS_GX GPSP GW HANDY \
+ HATARI MAME2000 MAME2003 MAME2003_PLUS MGBA NESTOPIA NXENGINE \
+ O2EM OPERA PCSX_REARMED PICODRIVE PRBOOM PROSYSTEM QUICKNES \
+ SCUMMVM SNES9X SNES9X2005 SNES9X2010 STELLA2014 TGBDUAL \
+ TYRQUAKE UAE VBANEXT VECX VIRTUALJAGUAR
+OPTIONS_DEFAULT= 2048 BEETLE_BSNES BEETLE_GBA BEETLE_LYNX BEETLE_NGP \
+ BEETLE_PCE_FAST BEETLE_PCFX BEETLE_PSX BEETLE_SUPERGRAFX \
+ BEETLE_VB BEETLE_WSWAN BLUEMSX DESMUME2015 DOSBOX EMUX \
+ FBALPHA FCEUMM FUSE GAMBATTE GENESIS_PLUS_GX GPSP GW HANDY \
+ HATARI MAME2000 MAME2003 MAME2003_PLUS MGBA NESTOPIA NXENGINE \
+ O2EM OPERA PCSX_REARMED PICODRIVE PRBOOM PROSYSTEM QUICKNES \
+ SCUMMVM SNES9X SNES9X2005 SNES9X2010 STELLA2014 TGBDUAL \
+ TYRQUAKE UAE VBANEXT VECX VIRTUALJAGUAR
+
+OPTIONS_DEFAULT_aarch64= 2048 BEETLE_BSNES BEETLE_GBA BEETLE_LYNX BEETLE_NGP \
+ BEETLE_PCE_FAST BEETLE_PCFX BEETLE_PSX BEETLE_SUPERGRAFX \
+ BEETLE_VB BEETLE_WSWAN DOSBOX EMUX \
+ FBALPHA FCEUMM FUSE GAMBATTE GENESIS_PLUS_GX GPSP GW HANDY \
+ HATARI MAME2000 MAME2003 MAME2003_PLUS MGBA NESTOPIA NXENGINE \
+ O2EM OPERA PCSX_REARMED PRBOOM PROSYSTEM QUICKNES \
+ SCUMMVM SNES9X SNES9X2005 SNES9X2010 STELLA2014 TGBDUAL \
+ TYRQUAKE UAE VBANEXT VECX VIRTUALJAGUAR
+
+2048_DESC= 2048 puzzle game
+BEETLE_BSNES_DESC= Mednafen Super Nintendo
+BEETLE_GBA_DESC= Mednafen GameBoy Advance
+BEETLE_LYNX_DESC= Mednafen Atari Lynx
+BEETLE_NGP_DESC= Mednafen SNK Neo Geo Pocket
+BEETLE_PCE_FAST_DESC= Mednafen NEC PC-Engine/Turbografx-16
+BEETLE_PCFX_DESC= Mednafen NEC PC-FX
+BEETLE_PSX_DESC= Mednafen Sony Playstation
+BEETLE_SUPERGRAFX_DESC= Mednafen NEC Supergrafx
+BEETLE_VB_DESC= Mednafen Nintendo Virtual Boy
+BEETLE_WSWAN_DESC= Mednafen Nintendo Bandai Wonderswan
+BLUEMSX_DESC= MSX1/2/Turbo-R
+DESMUME2015_DESC= Nintendo DS
+DOSBOX_DESC= MS-DOS
+EMUX_DESC= Multiple 8-Bit Console (Chip-8, GameBoy, NES, Mastersystem)
+FBALPHA_DESC= Final Burn Alpha
+FCEUMM_DESC= Nintendo NES/Famicon
+FUSE_DESC= Sinclair ZX-Spectrum
+GAMBATTE_DESC= Nintendo GameBoy Color
+GENESIS_PLUS_GX_DESC= Sega 8-bit/16-bit Consoles and peripherals
+GPSP_DESC= Nintendo GameBoy
+GW_DESC= Nintendo Game & Watch
+HANDY_DESC= Atari Lynx
+HATARI_DESC= Atari ST/STE/TT/Falcon
+MAME2000_DESC= M.A.M.E 0.37b5
+MAME2003_DESC= M.A.M.E 0.78
+MAME2003_PLUS_DESC= M.A.M.E 0.78 with extra additions
+MGBA_DESC= Nintendo Gameboy Advance
+NESTOPIA_DESC= Nintendo NES/Famicon
+NXENGINE_DESC= Cave Story game
+O2EM_DESC= Magnavox Odyssey 2 / Philips Videopac
+OPERA_DESC= Panasonic 3DO
+PCSX_REARMED_DESC= Sony Playstation
+PICODRIVE_DESC= Sega Genesis/Megadrive with peripherals
+PRBOOM_DESC= Doom game
+PROSYSTEM_DESC= Atari 7800
+QUICKNES_DESC= Nintendo NES
+SCUMMVM_DESC= Script Creation Utility for Maniac Mansion Virtual Machine
+SNES9X_DESC= Nintendo Super NES/Super Famicon (Trunk)
+SNES9X2005_DESC= Nintendo Super NES/Super Famicon (1.43)
+SNES9X2010_DESC= Nintendo Super NES/Super Famicon (1.52)
+STELLA2014_DESC= Atari 2600
+TGBDUAL_DESC= Nintendo GameBoy and GameBoy Color (with link support)
+TYRQUAKE_DESC= Quake game
+UAE_DESC= Commodore Amiga
+VBANEXT_DESC= Nintendo GameBoy Advance
+VECX_DESC= GCE Vectrex
+VIRTUALJAGUAR_DESC= Atari Jaguar
+
+2048_RUN_DEPENDS= libretro-2048>=0:games/libretro-2048
+BEETLE_BSNES_RUN_DEPENDS= libretro-beetle_bsnes>=0:games/libretro-beetle_bsnes
+BEETLE_GBA_RUN_DEPENDS= libretro-beetle_gba>=0:games/libretro-beetle_gba
+BEETLE_LYNX_RUN_DEPENDS= libretro-beetle_lynx>=0:games/libretro-beetle_lynx
+BEETLE_NGP_RUN_DEPENDS= libretro-beetle_ngp>=0:games/libretro-beetle_ngp
+BEETLE_PCE_FAST_RUN_DEPENDS= libretro-beetle_pce_fast>=0:games/libretro-beetle_pce_fast
+BEETLE_PCFX_RUN_DEPENDS= libretro-beetle_pcfx>=0:games/libretro-beetle_pcfx
+BEETLE_PSX_RUN_DEPENDS= libretro-beetle_psx>=0:games/libretro-beetle_psx
+BEETLE_SUPERGRAFX_RUN_DEPENDS= libretro-beetle_supergrafx>=0:games/libretro-beetle_supergrafx
+BEETLE_VB_RUN_DEPENDS= libretro-beetle_vb>=0:games/libretro-beetle_vb
+BEETLE_WSWAN_RUN_DEPENDS= libretro-beetle_wswan>=0:games/libretro-beetle_wswan
+BLUEMSX_RUN_DEPENDS= libretro-bluemsx>=0:games/libretro-bluemsx
+DESMUME2015_RUN_DEPENDS= libretro-desmume2015>=0:games/libretro-desmume2015
+DOSBOX_RUN_DEPENDS= libretro-dosbox>=0:games/libretro-dosbox
+EMUX_RUN_DEPENDS= libretro-emux>=0:games/libretro-emux
+FBALPHA_RUN_DEPENDS= libretro-fbalpha>=0:games/libretro-fbalpha
+FCEUMM_RUN_DEPENDS= libretro-fceumm>=0:games/libretro-fceumm
+FUSE_RUN_DEPENDS= libretro-fuse>=0:games/libretro-fuse
+GAMBATTE_RUN_DEPENDS= libretro-gambatte>=0:games/libretro-gambatte
+GENESIS_PLUS_GX_RUN_DEPENDS= libretro-genesis_plus_gx>=0:games/libretro-genesis_plus_gx
+GPSP_RUN_DEPENDS= libretro-gpsp>=0:games/libretro-gpsp
+GW_RUN_DEPENDS= libretro-gw>=0:games/libretro-gw
+HANDY_RUN_DEPENDS= libretro-handy>=0:games/libretro-handy
+HATARI_RUN_DEPENDS= libretro-hatari>=0:games/libretro-hatari
+MAME2000_RUN_DEPENDS= libretro-mame2000>=0:games/libretro-mame2000
+MAME2003_RUN_DEPENDS= libretro-mame2003>=0:games/libretro-mame2003
+MAME2003_PLUS_RUN_DEPENDS= libretro-mame2003_plus>=0:games/libretro-mame2003_plus
+MGBA_RUN_DEPENDS= libretro-mgba>=0:games/libretro-mgba
+NESTOPIA_RUN_DEPENDS= libretro-nestopia>=0:games/libretro-nestopia
+NXENGINE_RUN_DEPENDS= libretro-nxengine>=0:games/libretro-nxengine
+O2EM_RUN_DEPENDS= libretro-o2em>=0:games/libretro-o2em
+OPERA_RUN_DEPENDS= libretro-opera>=0:games/libretro-opera
+PCSX_REARMED_RUN_DEPENDS= libretro-pcsx_rearmed>=0:games/libretro-pcsx_rearmed
+PICODRIVE_RUN_DEPENDS= libretro-picodrive>=0:games/libretro-picodrive
+PRBOOM_RUN_DEPENDS= libretro-prboom>=0:games/libretro-prboom
+PROSYSTEM_RUN_DEPENDS= libretro-prosystem>=0:games/libretro-prosystem
+QUICKNES_RUN_DEPENDS= libretro-quicknes>=0:games/libretro-quicknes
+SCUMMVM_RUN_DEPENDS= libretro-scummvm>=0:games/libretro-scummvm
+SNES9X_RUN_DEPENDS= libretro-snes9x>=0:games/libretro-snes9x
+SNES9X2005_RUN_DEPENDS= libretro-snes9x2005>=0:games/libretro-snes9x2005
+SNES9X2010_RUN_DEPENDS= libretro-snes9x2010>=0:games/libretro-snes9x2010
+STELLA2014_RUN_DEPENDS= libretro-stella2014>=0:games/libretro-stella2014
+TGBDUAL_RUN_DEPENDS= libretro-tgbdual>=0:games/libretro-tgbdual
+TYRQUAKE_RUN_DEPENDS= libretro-tyrquake>=0:games/libretro-tyrquake
+UAE_RUN_DEPENDS= libretro-uae>=0:games/libretro-uae
+VBANEXT_RUN_DEPENDS= libretro-vbanext>=0:games/libretro-vbanext
+VECX_RUN_DEPENDS= libretro-vecx>=0:games/libretro-vecx
+VIRTUALJAGUAR_RUN_DEPENDS= libretro-virtualjaguar>=0:games/libretro-virtualjaguar
+
+.include <bsd.port.mk>
diff --git a/games/libretro/pkg-descr b/games/libretro/pkg-descr
new file mode 100644
index 000000000000..91c55cd98fcf
--- /dev/null
+++ b/games/libretro/pkg-descr
@@ -0,0 +1,3 @@
+Meta-port to install libretro cores.
+
+WWW: http://www.libretro.com