From ad17dea80f98ec2b8d79ee478e4589c0496fd5e4 Mon Sep 17 00:00:00 2001 From: nia Date: Mon, 20 May 2019 12:42:40 +0000 Subject: retroarch: Use clock_gettime on BSD. Should unbreak architectures where there is no dirty __asm__ fallback. Possibly fixes something when the TSC is an unreliable time source. Bump PKGREVISION. --- emulators/retroarch/Makefile | 4 ++-- emulators/retroarch/distinfo | 3 ++- .../patch-libretro-common_features_features__cpu.c | 23 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 emulators/retroarch/patches/patch-libretro-common_features_features__cpu.c (limited to 'emulators') diff --git a/emulators/retroarch/Makefile b/emulators/retroarch/Makefile index b0051d20fce..21a9f6ac3bd 100644 --- a/emulators/retroarch/Makefile +++ b/emulators/retroarch/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.24 2019/05/19 23:13:03 nia Exp $ +# $NetBSD: Makefile,v 1.25 2019/05/20 12:42:40 nia Exp $ PKGNAME= retroarch-${RETROARCH_VERSION} DISTNAME= RetroArch-${RETROARCH_VERSION} -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= emulators MASTER_SITES= ${MASTER_SITE_GITHUB:=libretro/RetroArch/releases/download/v${RETROARCH_VERSION}/} EXTRACT_SUFX= .tar.xz diff --git a/emulators/retroarch/distinfo b/emulators/retroarch/distinfo index 3f609de55af..fd6f91ced8d 100644 --- a/emulators/retroarch/distinfo +++ b/emulators/retroarch/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.14 2019/05/18 14:58:53 nia Exp $ +$NetBSD: distinfo,v 1.15 2019/05/20 12:42:40 nia Exp $ SHA1 (RetroArch-1.7.7.tar.xz) = 32288d3cc23319280c80968e9f0446e00f24db19 RMD160 (RetroArch-1.7.7.tar.xz) = e019c8a6486706e076878adc0510178e5c8d5d81 @@ -9,4 +9,5 @@ SHA1 (patch-audio_drivers_audioio.c) = 50820a7f3fbf7685098efdb794dd4efa485df806 SHA1 (patch-configuration.c) = 58873db839f8f0ed2e011d4c4c75b00e6293c239 SHA1 (patch-frontend_drivers_platform__unix.c) = e81ba53af2bdd4cecc4007cc9556f06446bf3b3f SHA1 (patch-input_include_xfree86__keycodes.h) = cd3b59122e9075a96fccb01bce2110dfa9cc160e +SHA1 (patch-libretro-common_features_features__cpu.c) = da4a66b16ef7ca194443a65e4efb8887e6d9bc3e SHA1 (patch-qb_config.libs.sh) = 0ec6ab7d49cdcd59c5938276517df1ee0212868e diff --git a/emulators/retroarch/patches/patch-libretro-common_features_features__cpu.c b/emulators/retroarch/patches/patch-libretro-common_features_features__cpu.c new file mode 100644 index 00000000000..d9d36fef149 --- /dev/null +++ b/emulators/retroarch/patches/patch-libretro-common_features_features__cpu.c @@ -0,0 +1,23 @@ +$NetBSD: patch-libretro-common_features_features__cpu.c,v 1.1 2019/05/20 12:42:40 nia Exp $ + +Use clock_gettime on BSD. + +--- libretro-common/features/features_cpu.c.orig 2019-05-08 06:06:23.000000000 +0000 ++++ libretro-common/features/features_cpu.c +@@ -26,6 +26,7 @@ + #if defined(_WIN32) + #include + #else ++#define _POSIX_C_SOURCE 200112 + #include + #endif + +@@ -167,7 +168,7 @@ retro_perf_tick_t cpu_features_get_perf_ + 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(__linux__) || defined(BSD) || defined(__QNX__) || defined(__MACH__) + struct timespec tv = {0}; + if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0) + time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 + -- cgit v1.2.3