Skip to content

Commit

Permalink
games/retroarch: fix build on all versions and enable on non-x86
Browse files Browse the repository at this point in the history
Do not depend on svgalib where svgalib is not supported.
Do not enable code using memfd_create() where that is not supported.

PR:		274647
  • Loading branch information
clausecker committed Nov 7, 2023
1 parent 841f9af commit 30a1253
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
9 changes: 7 additions & 2 deletions games/retroarch/Makefile
Expand Up @@ -35,8 +35,13 @@ LDFLAGS_i386= -Wl,-znotext
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME:tl}
SUB_FILES= pkg-message

OPTIONS_DEFINE= CACA FFMPEG OSS JACK PULSEAUDIO ALSA SDL OPENGL OPENAL V4L FREETYPE WAYLAND UDEV QT X11 DOCS
OPTIONS_DEFAULT=FFMPEG OSS SDL OPENGL OPENAL V4L FREETYPE WAYLAND UDEV QT X11
OPTIONS_DEFINE= CACA FFMPEG OSS JACK PULSEAUDIO ALSA SDL OPENGL OPENAL V4L FREETYPE UDEV QT X11 DOCS
OPTIONS_DEFINE_amd64= WAYLAND # svgalib is x86 only
OPTIONS_DEFINE_i386= WAYLAND
OPTIONS_DEFAULT=FFMPEG OSS SDL OPENGL OPENAL V4L FREETYPE UDEV QT X11
OPTIONS_DEFAULT_amd64= WAYLAND
OPTIONS_DEFAULT_i386= WAYLAND
OPTIONS_EXCLUDE_FreeBSD_12= WAYLAND # requires memfd_create()
FFMPEG_DESC= On-the-fly recording of gameplay with libavcodec
WAYLAND_DESC= Wayland display support
UDEV_DESC= udev device hotplug support
Expand Down
11 changes: 11 additions & 0 deletions games/retroarch/files/patch-gfx_common_wayland__common.c
@@ -0,0 +1,11 @@
--- gfx/common/wayland_common.c.orig 2023-11-06 19:16:56 UTC
+++ gfx/common/wayland_common.c
@@ -419,7 +419,7 @@ bool gfx_ctx_wl_get_metrics_common(void *data,
static int create_shm_file(off_t size)
{
int fd, ret;
- if ((fd = syscall(SYS_memfd_create, SPLASH_SHM_NAME,
+ if ((fd = memfd_create(SPLASH_SHM_NAME,
MFD_CLOEXEC | MFD_ALLOW_SEALING)) >= 0)
{
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
20 changes: 20 additions & 0 deletions games/retroarch/files/patch-input_input__keymaps.c
@@ -0,0 +1,20 @@
--- input/input_keymaps.c.orig 2023-11-06 19:58:13 UTC
+++ input/input_keymaps.c
@@ -54,7 +54,7 @@
#include "SDL.h"
#endif

-#if defined(__linux__) || defined(HAVE_WAYLAND)
+#if defined(__linux__) || defined(HAVE_WAYLAND) || defined(__FreeBSD__)
#if defined(__linux__)
#include <linux/input.h>
#include <linux/kd.h>
@@ -1130,7 +1130,7 @@ const struct rarch_key_map rarch_key_map_x11[] = {
};
#endif

-#if defined(__linux__) || defined(HAVE_WAYLAND)
+#if defined(__linux__) || defined(HAVE_WAYLAND) || defined(__FreeBSD__)
/* Note: Only one input can be mapped to each
* RETROK_* key. If several physical inputs
* correspond to the same key, these inputs

0 comments on commit 30a1253

Please sign in to comment.