Thursday, May 26, 2022

Re: UPDATE: emulators/retroarch

On Fri, May 13, 2022 at 06:43:18PM -0700, Ryan Freeman wrote:
> Hello ports@,
>
> Here is an attempt to update retroarch to 1.10.3. Lots has changed, but
> it still works with the existing libretro-* core packages that I tested**.
>
> ** libretro-pcsx-rearmed, libretro-mgba
>
> These are my notes about the changes to patches:
> patch-Makefile_common: upstream uses HAVE_LIBUSB now, links ok, removed
> patch-audio_audio_driver_c: applied with fuzz, regen'd
> patch-deps_glslang_glslang_glslang_Include_PoolAlloc_h: upstreamed, removed
> patch-gfx_common_x11_common_c: applied with fuzz, regen'd
> patch-input_drivers_x11_input_c: manually fixed, regen'd
> patch-input_input_keymaps_c: applied with fuzz, regen'd
> patch-libretro-common_audio_audio_mix_c: applied with fuzz, regen'd
> patch-libretro-common_features_features_cpu_c: appears to be mostly upstream,
> except for #include <sys/time.h>. it compiled without on amd64, but
> i don't have powerpc to test with. it also compiles with, so kept.
> patch-retroarch_cfg: applied with fuzz, regen'd
>
> Other various changes as follows:
> - RUN_DEPENDS on p5-Net-DBus and p5-X11-Protocol added, solves:
> Can't locate X11/Protocol.pm in @INC (you may need to install the X11::Protocol module) (@INC contains: /usr/local/libdata/perl5/site_perl/amd64-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/amd64-openbsd /usr/libdata/perl5) at -e line 6.
> BEGIN failed--compilation aborted at -e line 6.
>
> - CONFIGURE_ENV relied on {INCLUDE,LIBRARY}_DIRS, upstream now hard-sets these
> to ''. Switching CONFIGURE_ENV to CFLAGS/CXXFLAGS/LDFLAGS worked.
> - WANTLIB regen'd, fontconfig, fribidi, mbedcrypto, mbedtls, mbedx509 added
> - LIB_DEPENDS adds security/polarssl(mbedtls)
> - post-extract had the menu_osk_utf8_pages.h file fix removed, that file
> no-longer exists.
> - Upstream stopped providing a non-generated release archive, so this switches
> to using the GH_ variables.
> - Assets are no-longer included (huge PLIST reduction), but end up in your
> $HOME/.config/retroarch/assets directory when using the online updater.
>
> In testing, I had to move my existing .config/retroarch dir out of the way
> before things seemed to work good.
>
> port-lib-depends, lib-depends-check, portcheck all seem happy.
>
> All tests done on amd64. I'm not sure this is ready as-is.

Ping, applied the patch to a fresh ports checkout and current snapshot
and everything still builds OK.

Also now tested with the libretro-nestopia, libretro-genesis-gx-plus,
libretro-sameboy.

Any comments? Diff reattached for convenience.

-ryan


Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/retroarch/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- Makefile 11 Mar 2022 18:59:41 -0000 1.23
+++ Makefile 14 May 2022 01:31:02 -0000
@@ -1,9 +1,10 @@
COMMENT = generic multi-emulator frontend

-V = 1.7.6
-DISTNAME = RetroArch-$V
-PKGNAME = retroarch-$V
-REVISION = 4
+PKGNAME = retroarch-${GH_TAGNAME:S/v//}
+
+GH_ACCOUNT = libretro
+GH_PROJECT = RetroArch
+GH_TAGNAME = v1.10.3

CATEGORIES = emulators

@@ -15,19 +16,21 @@ PERMIT_PACKAGE = Yes
WANTLIB += ${COMPILER_LIBCXX} EGL GL Qt5Concurrent Qt5Core Qt5Gui
WANTLIB += Qt5Network Qt5Widgets SDL2 X11 X11-xcb Xext Xinerama
WANTLIB += Xrandr Xv Xxf86vm ass avcodec avformat avutil c crypto
-WANTLIB += drm freetype gbm m openal ssl swresample swscale usb-1.0
-WANTLIB += xcb xkbcommon z
-
-MASTER_SITES = https://github.com/libretro/RetroArch/releases/download/v$V/
-EXTRACT_SUFX
= .tar.xz
+WANTLIB += drm fontconfig freetype fribidi gbm m openal ssl swresample
+WANTLIB += swscale usb-1.0 xcb xkbcommon z
+WANTLIB += mbedcrypto mbedtls mbedx509

MODULES = x11/qt5
-RUN_DEPENDS = devel/desktop-file-utils
+RUN_DEPENDS = devel/desktop-file-utils \
+ net/p5-Net-DBus \
+ x11/p5-X11-Protocol
+
BUILD_DEPENDS = graphics/vulkan-tools
LIB_DEPENDS = audio/openal \
devel/libusb1 \
devel/sdl2 \
graphics/ffmpeg \
+ security/polarssl \
x11/xkbcommon

MAKE_FLAGS = V=1 \
@@ -40,8 +43,9 @@ FAKE_FLAGS = GLOBAL_CONFIG_DIR=${PREFIX
USE_GMAKE = Yes
CONFIGURE_STYLE = simple
CONFIGURE_ENV = MAN_DIR=${PREFIX}/man \
- INCLUDE_DIRS="-I${LOCALBASE}/include -I${X11BASE}/include" \
- LIBRARY_DIRS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
+ CFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
+ CXXFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
CONFIGURE_ARGS = --disable-discord \
--disable-jack \
--disable-wayland \
@@ -54,8 +58,7 @@ NO_TEST = Yes

# strip out byte order marks that break GCC 4.2
post-extract:
- sed -i s/$$(printf '\xef\xbb\xbf')// ${WRKSRC}/intl/msg_* \
- ${WRKSRC}/menu/widgets/menu_osk_utf8_pages.h
+ sed -i s/$$(printf '\xef\xbb\xbf')// ${WRKSRC}/intl/msg_*

pre-build:
${SUBST_CMD} ${WRKSRC}/retroarch.cfg
Index: distinfo
===================================================================
RCS file: /cvs/ports/emulators/retroarch/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- distinfo 5 Feb 2019 07:54:16 -0000 1.9
+++ distinfo 14 May 2022 01:31:02 -0000
@@ -1,2 +1,2 @@
-SHA256 (RetroArch-1.7.6.tar.xz) = hChvgRKd2WYVj6C/KreNEPaUzObRcg4ELKgYbnabqHA=
-SIZE (RetroArch-1.7.6.tar.xz) = 222780336
+SHA256 (RetroArch-1.10.3.tar.gz) = KvRClOVfVjYmIoTWUMtf/1XJBwrDpwDU+lXB8VLcs/I=
+SIZE (RetroArch-1.10.3.tar.gz) = 43353256
Index: patches/patch-Makefile_common
===================================================================
RCS file: patches/patch-Makefile_common
diff -N patches/patch-Makefile_common
--- patches/patch-Makefile_common 11 Mar 2022 18:59:41 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-Explicitly link with libusb-1.0
-
-Index: Makefile.common
---- Makefile.common.orig
-+++ Makefile.common
-@@ -957,11 +957,7 @@ ifeq ($(HAVE_LIBUSB), 1)
- ifeq ($(HAVE_HID), 1)
- DEFINES += -DHAVE_LIBUSB
- OBJ += input/drivers_hid/libusb_hid.o
-- ifneq ($(findstring BSD,$(OS)),)
-- LIBS += -lusb
-- else
-- LIBS += -lusb-1.0
-- endif
-+ LIBS += -lusb-1.0
- endif
- endif
- endif
Index: patches/patch-audio_audio_driver_c
===================================================================
RCS file: /cvs/ports/emulators/retroarch/patches/patch-audio_audio_driver_c,v
retrieving revision 1.6
diff -u -p -r1.6 patch-audio_audio_driver_c
--- patches/patch-audio_audio_driver_c 11 Mar 2022 18:59:41 -0000 1.6
+++ patches/patch-audio_audio_driver_c 14 May 2022 01:31:02 -0000
@@ -1,7 +1,7 @@
Index: audio/audio_driver.c
--- audio/audio_driver.c.orig
+++ audio/audio_driver.c
-@@ -80,7 +80,7 @@ static const audio_driver_t *audio_drivers[] = {
+@@ -93,7 +93,7 @@ audio_driver_t *audio_drivers[] = {
#if defined(HAVE_AUDIOIO)
&audio_audioio,

No comments:

Post a Comment