Skip to content

Commit

Permalink
games/libretro-desmume: new port
Browse files Browse the repository at this point in the history
PR:		274647
  • Loading branch information
sdalu authored and clausecker committed Nov 7, 2023
1 parent 1349056 commit 762073e
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions games/Makefile
Expand Up @@ -513,6 +513,7 @@
SUBDIR += libretro-boom3
SUBDIR += libretro-cap32
SUBDIR += libretro-core-info
SUBDIR += libretro-desmume
SUBDIR += libretro-desmume2015
SUBDIR += libretro-dosbox
SUBDIR += libretro-emux
Expand Down
39 changes: 39 additions & 0 deletions games/libretro-desmume/Makefile
@@ -0,0 +1,39 @@
PORTNAME= libretro-desmume
DISTVERSION= 0.20231006
CATEGORIES= games

MAINTAINER= sdalu@sdalu.com
COMMENT= Port of Desmume to libretro
WWW= https://github.com/libretro/desmume

LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/license.txt

ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= fails to compile: invokes x86 assembler

USES= gmake gl localbase:ldflags
USE_LDCONFIG= yes
USE_GL= gl

USE_GITHUB= yes
GH_ACCOUNT= libretro
GH_PROJECT= desmume
GH_TAGNAME= 4ee1bb1d6a6c9695baea49d0c2dff34c10187502

PLIST_FILES= lib/libretro/desmume_libretro.so

MAKEFILE= Makefile.libretro
BUILD_WRKSRC= ${WRKSRC}/desmume/src/frontend/libretro

.include <bsd.port.options.mk>

.if ${ARCH} != aarch64 && ${ARCH} != amd64 && !${ARCH:Marmv*} && ${ARCH} != i386
MAKE_ENV+= DESMUME_JIT=0
.endif

do-install:
${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro
${INSTALL_LIB} ${WRKSRC}/desmume/src/frontend/libretro/desmume_libretro.so ${STAGEDIR}/${PREFIX}/lib/libretro

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions games/libretro-desmume/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1698314795
SHA256 (libretro-desmume-0.20231006-4ee1bb1d6a6c9695baea49d0c2dff34c10187502_GH0.tar.gz) = 2cc19bb94521bcc717f25fec2c6fc26af7660748573bcfc78d3fbe6e3216ded9
SIZE (libretro-desmume-0.20231006-4ee1bb1d6a6c9695baea49d0c2dff34c10187502_GH0.tar.gz) = 11415777
@@ -0,0 +1,11 @@
--- desmume/src/libretro-common/features/features_cpu.c.orig 2021-02-16 18:16:47 UTC
+++ desmume/src/libretro-common/features/features_cpu.c
@@ -144,7 +144,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
tv_usec = (long)(system_time.wMilliseconds * 1000);
time_ticks = (1000000 * tv_sec + tv_usec);
-#elif defined(__linux__) || defined(__QNX__) || defined(__MACH__)
+#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__) || defined(__PSL1GHT__)
struct timespec tv = {0};
if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0)
time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 +
@@ -0,0 +1,11 @@
--- desmume/src/libretro-common/rthreads/rthreads.c.orig 2023-10-06 13:44:56 UTC
+++ desmume/src/libretro-common/rthreads/rthreads.c
@@ -55,7 +55,7 @@
#include <time.h>
#endif

-#if defined(VITA) || defined(BSD) || defined(ORBIS)
+#if defined(VITA) || defined(BSD) || defined(ORBIS) || (__FreeBSD__ <= 12)
#include <sys/time.h>
#endif

1 change: 1 addition & 0 deletions games/libretro-desmume/pkg-descr
@@ -0,0 +1 @@
Port of Desmume to libretro.

0 comments on commit 762073e

Please sign in to comment.