git: a441758fae5a - main - games/libretro-melonds: new port: libretro port of melonDS

From: Neel Chauhan <nc_at_FreeBSD.org>
Date: Tue, 13 Sep 2022 16:09:59 UTC
The branch main has been updated by nc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a441758fae5a8018b50294ceda33387a441c0b54

commit a441758fae5a8018b50294ceda33387a441c0b54
Author:     Henry Hu <henry.hu.sh@gmail.com>
AuthorDate: 2022-09-13 16:05:19 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2022-09-13 16:09:49 +0000

    games/libretro-melonds: new port: libretro port of melonDS
    
    PR:     266391
---
 games/Makefile                                     |  1 +
 games/libretro-melonds/Makefile                    | 23 ++++++++++++++++++++++
 games/libretro-melonds/distinfo                    |  3 +++
 ...rc_libretro_libretro-common_rthreads_rthreads.c | 11 +++++++++++
 .../files/patch-src_libretro_platform.cpp          | 10 ++++++++++
 games/libretro-melonds/pkg-descr                   |  3 +++
 6 files changed, 51 insertions(+)

diff --git a/games/Makefile b/games/Makefile
index b3556eea5470..b3e3f9c0e101 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -527,6 +527,7 @@
     SUBDIR += libretro-mame2003
     SUBDIR += libretro-mame2003_plus
     SUBDIR += libretro-mgba
+    SUBDIR += libretro-melonds
     SUBDIR += libretro-mu
     SUBDIR += libretro-nestopia
     SUBDIR += libretro-nxengine
diff --git a/games/libretro-melonds/Makefile b/games/libretro-melonds/Makefile
new file mode 100644
index 000000000000..85cbc5a6d686
--- /dev/null
+++ b/games/libretro-melonds/Makefile
@@ -0,0 +1,23 @@
+PORTNAME=	libretro-melonds
+PORTVERSION=	0.20220712
+CATEGORIES=	games
+
+MAINTAINER=	henry.hu.sh@gmail.com
+COMMENT=	Port of melonDS to libretro
+
+LICENSE=	GPLv3
+
+USES=		compiler:c++17-lang gmake
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	libretro
+GH_PROJECT=	melonDS
+GH_TAGNAME=	490a66a
+
+PLIST_FILES=	lib/libretro/melonds_libretro.so
+
+do-install:
+	${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro;
+	${INSTALL_LIB} ${WRKSRC}/melonds_libretro.so ${STAGEDIR}/${PREFIX}/lib/libretro;
+
+.include <bsd.port.mk>
diff --git a/games/libretro-melonds/distinfo b/games/libretro-melonds/distinfo
new file mode 100644
index 000000000000..645a224d33a9
--- /dev/null
+++ b/games/libretro-melonds/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1662934834
+SHA256 (libretro-melonDS-0.20220712-490a66a_GH0.tar.gz) = e12a41863f9018bb863d4e3f217cc23dd9b67a530f85655c1126471422511ffc
+SIZE (libretro-melonDS-0.20220712-490a66a_GH0.tar.gz) = 2929298
diff --git a/games/libretro-melonds/files/patch-src_libretro_libretro-common_rthreads_rthreads.c b/games/libretro-melonds/files/patch-src_libretro_libretro-common_rthreads_rthreads.c
new file mode 100644
index 000000000000..b19846bae1da
--- /dev/null
+++ b/games/libretro-melonds/files/patch-src_libretro_libretro-common_rthreads_rthreads.c
@@ -0,0 +1,11 @@
+--- src/libretro/libretro-common/rthreads/rthreads.c.orig	2022-07-12 14:45:04 UTC
++++ src/libretro/libretro-common/rthreads/rthreads.c
+@@ -67,6 +67,8 @@
+ #include <mach/mach.h>
+ #endif
+ 
++#include <sys/time.h>
++
+ struct thread_data
+ {
+    void (*func)(void*);
diff --git a/games/libretro-melonds/files/patch-src_libretro_platform.cpp b/games/libretro-melonds/files/patch-src_libretro_platform.cpp
new file mode 100644
index 000000000000..1912b18b75ec
--- /dev/null
+++ b/games/libretro-melonds/files/patch-src_libretro_platform.cpp
@@ -0,0 +1,10 @@
+--- src/libretro/platform.cpp.orig	2022-09-11 22:46:37 UTC
++++ src/libretro/platform.cpp
+@@ -13,6 +13,7 @@
+ #include <unistd.h>
+ #include <arpa/inet.h>
+ #include <sys/socket.h>
++#include <netinet/in.h>
+ #define socket_t    int
+ #define sockaddr_t  struct sockaddr
+ #define closesocket close
diff --git a/games/libretro-melonds/pkg-descr b/games/libretro-melonds/pkg-descr
new file mode 100644
index 000000000000..c9512a4f6be2
--- /dev/null
+++ b/games/libretro-melonds/pkg-descr
@@ -0,0 +1,3 @@
+Port of melonDS to libretro
+
+WWW: https://github.com/libretro/melonDS