this updates retroarch to latest version, I only tried on amd64

Changelog https://github.com/libretro/RetroArch/blob/master/CHANGES.md

Commit diff https://github.com/libretro/RetroArch/compare/v1.10.3...v1.18.0

I added a README file because the behavior on OpenBSD seems different
from what I've seen on other OSes, maybe a packaging issue but I'm
not sure. If I try to load a content from the UI, it says no core
are available although I have one installed. In addition, there are
no icons in the UI. Both behavior already exist with the current port
version.

The README explains how to get icons through the online updater
(something we may be able to ship through the port I guess), and
also how to create a playlist to assign a core to ROMs found in a
directory, which allows to load games fine.

diff --git a/emulators/retroarch/Makefile b/emulators/retroarch/Makefile
index 2089cf6620a..192864bfae1 100644
--- a/emulators/retroarch/Makefile
+++ b/emulators/retroarch/Makefile
@@ -4,8 +4,7 @@ PKGNAME =               retroarch-${GH_TAGNAME:S/v//}
 
 GH_ACCOUNT =           libretro
 GH_PROJECT =           RetroArch
-GH_TAGNAME =           v1.10.3
-REVISION =             3
+GH_TAGNAME =           v1.18.0
 
 # crashes when recording videos due to ffmpeg
 USE_NOBTCFI-amd64 =    Yes
diff --git a/emulators/retroarch/distinfo b/emulators/retroarch/distinfo
index 5d65027ae26..c937f3a6379 100644
--- a/emulators/retroarch/distinfo
+++ b/emulators/retroarch/distinfo
@@ -1,2 +1,2 @@
-SHA256 (RetroArch-1.10.3.tar.gz) = KvRClOVfVjYmIoTWUMtf/1XJBwrDpwDU+lXB8VLcs/I=
-SIZE (RetroArch-1.10.3.tar.gz) = 43353256
+SHA256 (RetroArch-1.18.0.tar.gz) = EIejwCnudGPPra+6sNs9VY1tKrnO9B9GftjzcrtCu9Y=
+SIZE (RetroArch-1.18.0.tar.gz) = 56944954
diff --git a/emulators/retroarch/patches/patch-audio_audio_driver_c 
b/emulators/retroarch/patches/patch-audio_audio_driver_c
index 9f41bfe7eae..bbf9f8398fc 100644
--- a/emulators/retroarch/patches/patch-audio_audio_driver_c
+++ b/emulators/retroarch/patches/patch-audio_audio_driver_c
@@ -1,7 +1,7 @@
 Index: audio/audio_driver.c
 --- audio/audio_driver.c.orig
 +++ audio/audio_driver.c
-@@ -93,7 +93,7 @@ audio_driver_t *audio_drivers[] = {
+@@ -92,7 +92,7 @@ audio_driver_t *audio_drivers[] = {
  #if defined(HAVE_AUDIOIO)
     &audio_audioio,
  #endif
diff --git a/emulators/retroarch/patches/patch-gfx_common_x11_common_c 
b/emulators/retroarch/patches/patch-gfx_common_x11_common_c
index b99d25d44c4..bd16f9cdba6 100644
--- a/emulators/retroarch/patches/patch-gfx_common_x11_common_c
+++ b/emulators/retroarch/patches/patch-gfx_common_x11_common_c
@@ -4,27 +4,27 @@ which breaks keyboard input.
 Index: gfx/common/x11_common.c
 --- gfx/common/x11_common.c.orig
 +++ gfx/common/x11_common.c
-@@ -495,7 +495,7 @@ static enum retro_key x11_translate_keysym_to_rk(unsig
+@@ -505,7 +505,7 @@ static enum retro_key x11_translate_keysym_to_rk(unsig
     return RETROK_UNKNOWN;
  }
  
--static void x11_handle_key_event(unsigned keycode, XEvent *event, XIC ic, 
bool filter)
-+static void x11_handle_key_event(XEvent *event, XIC ic, bool filter)
+-static void x11_handle_key_event(unsigned keycode, XEvent *event,
++static void x11_handle_key_event(XEvent *event,
+       XIC ic, bool filter)
  {
     int i;
-    Status status;
-@@ -546,9 +546,7 @@ static void x11_handle_key_event(unsigned keycode, XEv
+@@ -557,9 +557,7 @@ static void x11_handle_key_event(unsigned keycode, XEv
     if (keysym >= XK_A && keysym <= XK_Z)
         keysym += XK_z - XK_Z;
  
--   /* Get the real keycode,
--      that correctly ignores international layouts as windows code does. */
+-   /* Get the real keycode, that correctly ignores international layouts
+-    * as windows code does. */
 -   key     = x11_translate_keysym_to_rk(keycode);
 +   key   = input_keymaps_translate_keysym_to_rk(keysym);
  
     if (state & ShiftMask)
        mod |= RETROKMOD_SHIFT;
-@@ -558,10 +556,10 @@ static void x11_handle_key_event(unsigned keycode, XEv
+@@ -569,10 +567,10 @@ static void x11_handle_key_event(unsigned keycode, XEv
        mod |= RETROKMOD_CTRL;
     if (state & Mod1Mask)
        mod |= RETROKMOD_ALT;
@@ -37,7 +37,7 @@ Index: gfx/common/x11_common.c
  
     input_keyboard_event(down, key, chars[0], mod, RETRO_DEVICE_KEYBOARD);
  
-@@ -576,14 +574,9 @@ bool x11_alive(void *data)
+@@ -587,14 +585,10 @@ bool x11_alive(void *data)
     {
        XEvent event;
        bool filter = false;
@@ -45,14 +45,14 @@ Index: gfx/common/x11_common.c
  
        /* Can get events from older windows. Check this. */
        XNextEvent(g_x11_dpy, &event);
--
+ 
 -      /* IMPORTANT - Get keycode before XFilterEvent
 -         because the event is localizated after the call */
 -      keycode = event.xkey.keycode;
-       filter = XFilterEvent(&event, g_x11_win);
+       filter  = XFilterEvent(&event, g_x11_win);
  
        switch (event.type)
-@@ -667,7 +660,7 @@ bool x11_alive(void *data)
+@@ -677,7 +671,7 @@ bool x11_alive(void *data)
              }
           case KeyPress:
              if (event.xkey.window == g_x11_win)
diff --git a/emulators/retroarch/patches/patch-input_drivers_x11_input_c 
b/emulators/retroarch/patches/patch-input_drivers_x11_input_c
index 8c5bb280170..1d56712e183 100644
--- a/emulators/retroarch/patches/patch-input_drivers_x11_input_c
+++ b/emulators/retroarch/patches/patch-input_drivers_x11_input_c
@@ -4,7 +4,7 @@ which breaks keyboard input.
 Index: input/drivers/x11_input.c
 --- input/drivers/x11_input.c.orig
 +++ input/drivers/x11_input.c
-@@ -76,7 +76,7 @@ static void *x_input_init(const char *joypad_driver)
+@@ -71,7 +71,7 @@ static void *x_input_init(const char *joypad_driver)
  
  static bool x_keyboard_pressed(x11_input_t *x11, unsigned key)
  {
@@ -13,30 +13,3 @@ Index: input/drivers/x11_input.c
     return x11->state[keycode >> 3] & (1 << (keycode & 7));
  }
  
-@@ -228,6 +228,8 @@ static int16_t x_input_state(
-             int16_t ret           = 0;
-             bool id_plus_valid    = false;
-             bool id_minus_valid   = false;
-+            unsigned sym          = 0;
-+            int keycode           = 0;
- 
-             input_conv_analog_id_to_bind_id(idx, id, id_minus, id_plus);
- 
-@@ -238,13 +240,15 @@ static int16_t x_input_state(
- 
-             if (id_plus_valid && id_plus_key < RETROK_LAST)
-             {
--               unsigned sym = rarch_keysym_lut[(enum retro_key)id_plus_key];
-+               sym = rarch_keysym_lut[(enum retro_key)id_plus_key];
-+               keycode = XKeysymToKeycode(x11->display, sym);
-                if (x11->state[sym >> 3] & (1 << (sym & 7)))
-                   ret = 0x7fff;
-             }
-             if (id_minus_valid && id_minus_key < RETROK_LAST)
-             {
--               unsigned sym = rarch_keysym_lut[(enum retro_key)id_minus_key];
-+               sym = rarch_keysym_lut[(enum retro_key)id_minus_key];
-+               keycode = XKeysymToKeycode(x11->display, sym);
-                if (x11->state[sym >> 3] & (1 << (sym & 7)))
-                   ret += -0x7fff;
-             }
diff --git a/emulators/retroarch/patches/patch-input_input_keymaps_c 
b/emulators/retroarch/patches/patch-input_input_keymaps_c
index 49229a85cf8..c47700f614e 100644
--- a/emulators/retroarch/patches/patch-input_input_keymaps_c
+++ b/emulators/retroarch/patches/patch-input_input_keymaps_c
@@ -4,7 +4,7 @@ which breaks keyboard input.
 Index: input/input_keymaps.c
 --- input/input_keymaps.c.orig
 +++ input/input_keymaps.c
-@@ -60,7 +60,9 @@
+@@ -64,7 +64,9 @@
  #endif
  
  #ifdef HAVE_X11
@@ -15,7 +15,7 @@ Index: input/input_keymaps.c
  #endif
  
  #ifdef HAVE_DINPUT
-@@ -864,123 +866,156 @@ const struct rarch_key_map rarch_key_map_wiiu[] = {
+@@ -1008,123 +1010,156 @@ const struct rarch_key_map rarch_key_map_wiiu[] = {
  
  #ifdef HAVE_X11
  
diff --git a/emulators/retroarch/patches/patch-retroarch_cfg 
b/emulators/retroarch/patches/patch-retroarch_cfg
index c062d134e57..d52afcaa919 100644
--- a/emulators/retroarch/patches/patch-retroarch_cfg
+++ b/emulators/retroarch/patches/patch-retroarch_cfg
@@ -1,7 +1,7 @@
 Index: retroarch.cfg
 --- retroarch.cfg.orig
 +++ retroarch.cfg
-@@ -832,7 +832,7 @@
+@@ -844,7 +844,7 @@
  # rgui_browser_directory =
  
  # Core directory for libretro core implementations.
diff --git a/emulators/retroarch/pkg/PLIST b/emulators/retroarch/pkg/PLIST
index 26238ce18a8..08a998a6185 100644
--- a/emulators/retroarch/pkg/PLIST
+++ b/emulators/retroarch/pkg/PLIST
@@ -3,6 +3,7 @@ bin/retroarch-cg2glsl
 @man man/man6/retroarch-cg2glsl.6
 @man man/man6/retroarch.6
 share/applications/retroarch.desktop
+share/doc/pkg-readmes/${PKGSTEM}
 share/doc/retroarch/
 share/doc/retroarch/COPYING
 share/doc/retroarch/README.md
diff --git a/emulators/retroarch/pkg/README b/emulators/retroarch/pkg/README
new file mode 100644
index 00000000000..b4d7ee76622
--- /dev/null
+++ b/emulators/retroarch/pkg/README
@@ -0,0 +1,19 @@
++-----------------------------------------------------------------------
+| Running ${PKGSTEM} on OpenBSD
++-----------------------------------------------------------------------
+
+By default, the UI assets are not available (icons in menus), you can
+download them from Retroarch:
+
+  Main Menu -> Online Updater -> Update assets
+
+
+If Retroarch does not offer a core when you try to load a content,
+although the according core is installed, it is recommended to create
+a playlist:
+
+  Import content -> Manual Scan
+
+    - choose a content directory
+    - choose a default core for the files in this directory
+    - Start Scan

Reply via email to