aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Beyer <beyert@cs.ucr.edu>2022-06-27 07:01:29 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2022-06-27 07:04:02 +0000
commit68b199480328b8073a1ff97f2b62597010cf8137 (patch)
treecb92007aeb1df5be9b0b26206aaa5f8b3f34f12a
parent93d4c539c9b9060fb4cd99f4e2efda0d4bc2597d (diff)
downloadports-68b199480328b8073a1ff97f2b62597010cf8137.tar.gz
ports-68b199480328b8073a1ff97f2b62597010cf8137.zip
Add emulators/libretro-kronos
Sega Saturn and ST-V emulator forked from uoYabause for libretro PR: 257171
-rw-r--r--emulators/Makefile1
-rw-r--r--emulators/libretro-kronos/Makefile60
-rw-r--r--emulators/libretro-kronos/distinfo3
-rw-r--r--emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile11
-rw-r--r--emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile.common36
-rw-r--r--emulators/libretro-kronos/files/patch-yabause_src_libretro_libretro-common_rthreads_rthreads.c11
-rw-r--r--emulators/libretro-kronos/pkg-descr6
-rw-r--r--emulators/libretro-kronos/pkg-message34
8 files changed, 162 insertions, 0 deletions
diff --git a/emulators/Makefile b/emulators/Makefile
index 20c3c7fbd15c..ae76495c5847 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -58,6 +58,7 @@
SUBDIR += libc6-shim
SUBDIR += libdsk
SUBDIR += libretro-flycast
+ SUBDIR += libretro-kronos
SUBDIR += libretro-mame
SUBDIR += libretro-pcsx2
SUBDIR += libretro-ppsspp
diff --git a/emulators/libretro-kronos/Makefile b/emulators/libretro-kronos/Makefile
new file mode 100644
index 000000000000..c6358da06895
--- /dev/null
+++ b/emulators/libretro-kronos/Makefile
@@ -0,0 +1,60 @@
+# Created by Timothy Beyer <beyert@cs.ucr.edu>
+
+PORTNAME= libretro-kronos
+PORTVERSION= 0.20210617
+CATEGORIES= emulators games
+
+MAINTAINER= beyert@cs.ucr.edu
+COMMENT= Sega Saturn and ST-V emulator forked from uoYabause for libretro
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/yabause/COPYING
+
+LIB_DEPENDS= libGL.so:graphics/mesa-libs
+
+# standalone version uses solely cmake, whereas the retroarch core uses both
+# cmake and gmake
+USES= cmake:noninja compiler:c++11-lib gl gmake pkgconfig qt:5 sdl
+
+USE_GITHUB= yes
+GH_ACCOUNT= FCare
+GH_PROJECT= Kronos
+GH_TAGNAME= a39f95a
+
+USE_GL= gl glew glu
+
+USE_LDCONFIG= yes
+
+USE_QT= core opengl buildtools_build qmake_build
+
+USE_SDL= sdl2
+
+CMAKE_SOURCE_PATH= ${WRKSRC}/yabause
+
+MAKE_ARGS= USE_RTHREADS=1
+
+CFLAGS+= -I${LOCALBASE}/include
+CXXFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+PLIST_FILES= lib/libretro/kronos_libretro.so
+
+pre-build:
+ cd ${CMAKE_SOURCE_PATH} && ${CMAKE_BIN} .
+ cd ${WRKSRC}/yabause/src && ${MAKE} m68kmake
+
+.include <bsd.port.pre.mk>
+
+do-build:
+ cd ${WRKSRC}/yabause/src/libretro && ${DO_MAKE_BUILD}
+
+post-patch:
+.if ${ARCH} != "amd64"
+ @${REINPLACE_CMD} -e "s/HAVE_SSE = 1/HAVE_SSE = 0/" ${WRKSRC}/yabause/src/libretro/Makefile
+.endif
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro;
+ ${INSTALL_LIB} ${WRKSRC}/yabause/src/libretro/kronos_libretro.so ${STAGEDIR}/${PREFIX}/lib/libretro;
+
+.include <bsd.port.post.mk>
diff --git a/emulators/libretro-kronos/distinfo b/emulators/libretro-kronos/distinfo
new file mode 100644
index 000000000000..0fd66c7ae29f
--- /dev/null
+++ b/emulators/libretro-kronos/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1623926653
+SHA256 (FCare-Kronos-0.20210617-a39f95a_GH0.tar.gz) = a9edd4b88b874f4b1d1fb0b9e66cf2bc8bc3b643ee02b127db84a79fce31a6e8
+SIZE (FCare-Kronos-0.20210617-a39f95a_GH0.tar.gz) = 36104449
diff --git a/emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile b/emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile
new file mode 100644
index 000000000000..b1ae06d0fa34
--- /dev/null
+++ b/emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile
@@ -0,0 +1,11 @@
+--- yabause/src/libretro/Makefile.orig 2021-06-01 21:12:00 UTC
++++ yabause/src/libretro/Makefile
+@@ -291,7 +291,7 @@ endif
+
+ OBJECTS += $(OBJECTS_C) $(OBJECTS_CXX) $(OBJECTS_S)
+
+-LDFLAGS += $(fpic) $(SHARED) -latomic
++LDFLAGS += $(fpic) $(SHARED)
+ FLAGS += $(fpic)
+
+ INCFLAGS := $(foreach dir,$(INCLUDE_DIRS),-I$(dir))
diff --git a/emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile.common b/emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile.common
new file mode 100644
index 000000000000..b7490c991cd8
--- /dev/null
+++ b/emulators/libretro-kronos/files/patch-yabause_src_libretro_Makefile.common
@@ -0,0 +1,36 @@
+--- yabause/src/libretro/Makefile.common.orig 2021-06-01 21:12:00 UTC
++++ yabause/src/libretro/Makefile.common
+@@ -182,6 +182,8 @@ ifeq ($(HAVE_CDROM), 1)
+ endif
+ endif
+
++SOURCES_C += $(LIBRETRO_COMM_DIR)/string/stdstring.c
++
+ ifeq ($(ARCH_IS_WINDOWS), 1)
+ SOURCES_C += $(FLAC_DIR)/src/libFLAC/windows_unicode_filenames.c
+ endif
+@@ -209,14 +211,16 @@ ifeq ($(USE_RTHREADS), 1)
+ SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-rthreads.c \
+ $(LIBRETRO_COMM_DIR)/rthreads/rthreads.c
+ else
+- ifeq ($(ARCH_IS_LINUX), 1)
+- SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-linux.c
+- else ifeq ($(ARCH_IS_MACOSX), 1)
+- SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-linux.c \
+- $(SOURCE_DIR)/ctrl/threads/linux/pthread_barrier.c
+- else
+- SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-windows.c
+- endif
++
++SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-dummy.c
++# ifeq ($(ARCH_IS_LINUX), 1)
++# SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-linux.c
++# else ifeq ($(ARCH_IS_MACOSX), 1)
++# SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-linux.c \
++# $(SOURCE_DIR)/ctrl/threads/linux/pthread_barrier.c
++# else
++# SOURCES_C += $(SOURCE_DIR)/ctrl/threads/thr-windows.c
++# endif
+ endif
+
+ M68KMAKE_EXE = m68kmake$(EXE_EXT)
diff --git a/emulators/libretro-kronos/files/patch-yabause_src_libretro_libretro-common_rthreads_rthreads.c b/emulators/libretro-kronos/files/patch-yabause_src_libretro_libretro-common_rthreads_rthreads.c
new file mode 100644
index 000000000000..a257dba8db83
--- /dev/null
+++ b/emulators/libretro-kronos/files/patch-yabause_src_libretro_libretro-common_rthreads_rthreads.c
@@ -0,0 +1,11 @@
+--- yabause/src/libretro/libretro-common/rthreads/rthreads.c.orig 2020-05-02 13:49:27 UTC
++++ yabause/src/libretro/libretro-common/rthreads/rthreads.c
+@@ -67,6 +67,8 @@
+ #include <mach/mach.h>
+ #endif
+
++#include <sys/time.h>
++
+ struct thread_data
+ {
+ void (*func)(void*);
diff --git a/emulators/libretro-kronos/pkg-descr b/emulators/libretro-kronos/pkg-descr
new file mode 100644
index 000000000000..faeee508c4e9
--- /dev/null
+++ b/emulators/libretro-kronos/pkg-descr
@@ -0,0 +1,6 @@
+Kronos is a Sega Saturn and ST-V emulator forked from uoYabause. Kronos is
+targetting Linux and Windows OS.
+
+This is the libretro port of Kronos.
+
+WWW: https://fcare.github.io
diff --git a/emulators/libretro-kronos/pkg-message b/emulators/libretro-kronos/pkg-message
new file mode 100644
index 000000000000..6e2b54053bae
--- /dev/null
+++ b/emulators/libretro-kronos/pkg-message
@@ -0,0 +1,34 @@
+[
+{ type: install
+ message: <<EOM
+For Sega Saturn, it is mandatory to install a supported Sega Saturn bios files
+(such as saturn_bios.bin) in ~/.config/retroarch/system or
+~/.config/retroarch/system/kronos.
+
+Kronos is broadly compatible with all major Saturn BIOSes regardless of region,
+although unlike Yabause, a BIOS dump is required. Due to the aforementioned
+BIOS compatibility, the BIOS guide for the beetle-saturn libretro core may be
+helpful:
+
+https://docs.libretro.com/library/beetle_saturn/
+
+For ST-V, it is necessary to add a compatible stvbios.zip either in
+~/.config/retroarch/system/kronos or in ~/.config/retroarch/system/. In
+contrast to MAME, Kronos will never search for this bios file in the local path
+of the game.
+
+If the emulator gets stuck on the BIOS screen, the screen remains blank, or
+shows audio track navigation controls, then the BIOS is likely incompatible.
+
+At present, Kronos is only compatible with a subset of the stvbios.zip files
+used by modern MAME versions. If the stvbios.zip is not present in the proper
+place, but one of the proper Sega Saturn BIOSes is instead available, it will
+try to default to one of those, and in the most optimistic case, merely reach
+the audio CD track navigation controls, but it will not work, since it is not
+the same hardware.
+
+If in doubt, running retroarch with the -v argument may help to acquire more
+diagnostic information.
+EOM
+}
+]