Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/libretro-flycast emulators: Add libretro-fly...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/80710b979f7a
branches:  trunk
changeset: 433157:80710b979f7a
user:      nia <nia%pkgsrc.org@localhost>
date:      Sun May 31 15:20:22 2020 +0000

description:
emulators: Add libretro-flycast

Libretro is a simple but powerful development interface that allows for the
easy creation of emulators, games and multimedia applications that can plug
straight into any libretro-compatible frontend. This development interface is
open to others so that they can run these pluggable emulator and game cores
also in their own programs or devices.

Flycast is a multi-platform Sega Dreamcast emulator.

diffstat:

 emulators/libretro-flycast/DESCR                                     |   7 +
 emulators/libretro-flycast/MESSAGE                                   |  17 ++
 emulators/libretro-flycast/Makefile                                  |  70 ++++++++++
 emulators/libretro-flycast/PLIST                                     |   2 +
 emulators/libretro-flycast/distinfo                                  |  13 +
 emulators/libretro-flycast/options.mk                                |  23 +++
 emulators/libretro-flycast/patches/patch-Makefile                    |  19 ++
 emulators/libretro-flycast/patches/patch-Makefile.common             |  58 ++++++++
 emulators/libretro-flycast/patches/patch-core_hw_aica_dsp__x64.cpp   |  18 ++
 emulators/libretro-flycast/patches/patch-core_hw_sh4_dyna_driver.cpp |  15 ++
 emulators/libretro-flycast/patches/patch-core_libretro_common.cpp    |  22 +++
 emulators/libretro-flycast/patches/patch-core_log_StringUtil.h       |  47 ++++++
 emulators/libretro-flycast/patches/patch-core_rec-x64_rec__x64.cpp   |  15 ++
 13 files changed, 326 insertions(+), 0 deletions(-)

diffs (truncated from 378 to 300 lines):

diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/DESCR  Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,7 @@
+Libretro is a simple but powerful development interface that allows for the
+easy creation of emulators, games and multimedia applications that can plug
+straight into any libretro-compatible frontend. This development interface is
+open to others so that they can run these pluggable emulator and game cores
+also in their own programs or devices.
+
+Flycast is a multi-platform Sega Dreamcast emulator.
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/MESSAGE        Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,17 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+Flycast requires the following BIOS files in order to work:
+
+SHA256 (dc/dc_boot.bin) =
+88d6a666495ad14ab5988d8cb730533cfc94ec2cfd53a7eeda14642ab0d4abf9
+
+SHA256 (dc/dc_flash.bin) =
+dd8b365521a9c08bb4c170da3592212580f7251f35a45d6083774d1c030bc3e3
+
+In retroarch, you'll need to place them in the System Directory.
+
+Alternatively, you can place them in your Content Directory next to the
+software you are going to run.
+
+===========================================================================
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/Makefile       Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,70 @@
+# $NetBSD: Makefile,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+DISTNAME=      libretro-flycast-20200529
+CATEGORIES=    emulators
+GITHUB_PROJECT=        flycast
+GITHUB_TAG=    e595af5dfbff2e49fbcb95bec5b240785c8b4f4f
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://docs.libretro.com/library/flycast/
+COMMENT=       Libretro core based on the Reicast Sega Dreamcast emulator
+LICENSE=       gnu-gpl-v2
+
+LIBRETRO_CORE= flycast
+USE_LANGUAGES= c c++
+
+LDFLAGS+=      -lFLAC -lxxhash -lz
+
+MAKE_FLAGS+=   HAVE_OPENMP=0
+MAKE_FLAGS+=   HAVE_VULKAN=0
+MAKE_FLAGS+=   SINGLE_PREC_FLAGS=1
+MAKE_FLAGS+=   CC_AS=${AS}
+
+.if ${MACHINE_ARCH} != "x86_64"
+CFLAGS+=       -DLOW_END
+CXXFLAGS+=     -DLOW_END
+.endif
+
+CFLAGS+=       -DHAVE_POSIX_MEMALIGN=1
+CXXFLAGS+=     -DHAVE_POSIX_MEMALIGN=1
+
+.if ${MACHINE_ARCH} == "aarch64"
+MAKE_FLAGS+=   WITH_DYNAREC=arm64
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+.elif ${MACHINE_ARCH} == "i386"
+MAKE_FLAGS+=   WITH_DYNAREC=x86
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+.elif ${MACHINE_ARCH} == "x86_64"
+MAKE_FLAGS+=   WITH_DYNAREC=x86_64
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+.elif ${MACHINE_ARCH} == "earmv7hf"
+MAKE_FLAGS+=   WITH_DYNAREC=arm
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+MAKE_FLAGS+=   ARM_FLOAT_ABI_HARD=1
+MAKE_FLAGS+=   ARMV7A_FLAGS=1
+.elif ${MACHINE_ARCH} == "earmv6hf"
+CFLAGS+=       -marm
+CXXFLAGS+=     -marm
+MAKE_FLAGS+=   WITH_DYNAREC=arm
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+MAKE_FLAGS+=   ARM_FLOAT_ABI_HARD=1
+.elif !empty(MACHINE_ARCH:M*arm*)
+CFLAGS+=       -marm
+CXXFLAGS+=     -marm
+MAKE_FLAGS+=   WITH_DYNAREC=arm
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+MAKE_FLAGS+=   ARM_FLOAT_ABI_HARD=0
+.elif !empty(MACHINE_ARCH:M*mips*)
+MAKE_FLAGS+=   WITH_DYNAREC=mips
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=0
+.else
+MAKE_FLAGS+=   WITH_DYNAREC=
+MAKE_FLAGS+=   HAVE_GENERIC_JIT=1
+.endif
+
+.include "options.mk"
+.include "../../emulators/retroarch/core.mk"
+.include "../../audio/flac/buildlink3.mk"
+.include "../../devel/xxhash/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/PLIST  Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2020/05/31 15:20:22 nia Exp $
+lib/libretro/flycast_libretro.${SOEXT}
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/distinfo       Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+SHA1 (libretro-flycast-20200529-e595af5dfbff2e49fbcb95bec5b240785c8b4f4f.tar.gz) = b4c6492680fd84a8dc4d7ef025ab648438e305dc
+RMD160 (libretro-flycast-20200529-e595af5dfbff2e49fbcb95bec5b240785c8b4f4f.tar.gz) = 5545255f788358f03ab5340436d75a17e28d8523
+SHA512 (libretro-flycast-20200529-e595af5dfbff2e49fbcb95bec5b240785c8b4f4f.tar.gz) = 
0c6bf51960a36069912a0d44dfc96a0cc8fd352e6e06087bd11dd309045b8f0efbd83629f894f213f822efe73d3f94a9f3461cfc3f14c77c56ead664bcc23acd
+Size (libretro-flycast-20200529-e595af5dfbff2e49fbcb95bec5b240785c8b4f4f.tar.gz) = 4301350 bytes
+SHA1 (patch-Makefile) = 8159fc931d8514bd100ead06c3fe1ae4d11dfac0
+SHA1 (patch-Makefile.common) = 4bfdaae74db7672f11698040bbb29d851006c2b3
+SHA1 (patch-core_hw_aica_dsp__x64.cpp) = 2ed58220ac214136879bc4aa8939c11b8d6f0916
+SHA1 (patch-core_hw_sh4_dyna_driver.cpp) = 6067ac4c8009759baeffc71049e7987c5441947b
+SHA1 (patch-core_libretro_common.cpp) = c3cf6bcfa2e2f9a74459517f8d9e3d0a562cf479
+SHA1 (patch-core_log_StringUtil.h) = b0726f1ab856adb27ba672f8a9ca3ef9f369e583
+SHA1 (patch-core_rec-x64_rec__x64.cpp) = c0074b495a15f3cc8b4772a7b51a1100cff04286
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/options.mk     Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,23 @@
+# $NetBSD: options.mk,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+PKG_OPTIONS_VAR=               PKG_OPTIONS.libretro-flycast
+PKG_OPTIONS_REQUIRED_GROUPS=   gl
+PKG_OPTIONS_GROUP.gl=          opengl
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:M*arm*)
+PKG_OPTIONS_GROUP.gl+=         rpi
+.endif
+
+PKG_SUGGESTED_OPTIONS+=                opengl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mopengl)
+.  include "../../graphics/MesaLib/buildlink3.mk"
+.elif !empty(PKG_OPTIONS:Mrpi)
+MAKE_FLAGS+=   GLES=1
+MAKE_FLAGS+=   GL_LIB="-lbrcmGLESv2"
+.  include "../../misc/raspberrypi-userland/buildlink3.mk"
+.endif
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/patches/patch-Makefile Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-Makefile,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+Don't override things we want to pass through from pkgsrc cleanly.
+
+--- Makefile.orig      2020-05-29 12:45:55.000000000 +0000
++++ Makefile
+@@ -40,12 +40,8 @@ CC_AS    ?= ${CC_PREFIX}as
+ 
+ MFLAGS   := 
+ ASFLAGS  := 
+-LDFLAGS  :=
+ LDFLAGS_END :=
+ INCFLAGS :=
+-LIBS     :=
+-CFLAGS   := 
+-CXXFLAGS :=
+ 
+ GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
+ ifneq ($(GIT_VERSION)," unknown")
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/patches/patch-Makefile.common
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/patches/patch-Makefile.common  Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,58 @@
+$NetBSD: patch-Makefile.common,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+Avoid bundling depends.
+
+--- Makefile.common.orig       2020-05-29 12:45:55.000000000 +0000
++++ Makefile.common
+@@ -191,8 +191,7 @@ SOURCES_C +=   \
+                                       $(DEPS_DIR)/picotcp/stack/pico_socket_multicast.c \
+                                       $(DEPS_DIR)/picotcp/stack/pico_socket.c \
+                                       $(DEPS_DIR)/picotcp/stack/pico_stack.c \
+-                                      $(DEPS_DIR)/picotcp/stack/pico_tree.c \
+-                                      $(DEPS_DIR)/xxhash/xxhash.c
++                                      $(DEPS_DIR)/picotcp/stack/pico_tree.c
+ 
+ SOURCES_ASM :=
+ 
+@@ -401,21 +400,6 @@ SOURCES_CXX += $(DEPS_DIR)/xbrz/xbrz.cpp
+ endif
+ 
+ ifeq ($(HAVE_CHD),1)
+-INCFLAGS += -I$(DEPS_DIR)/flac/include
+-
+-SOURCES_C += \
+-                               $(DEPS_DIR)/flac/bitmath.c \
+-                               $(DEPS_DIR)/flac/bitreader.c \
+-                               $(DEPS_DIR)/flac/cpu.c \
+-                               $(DEPS_DIR)/flac/crc.c \
+-                               $(DEPS_DIR)/flac/fixed.c \
+-                               $(DEPS_DIR)/flac/float.c \
+-                               $(DEPS_DIR)/flac/format.c \
+-                               $(DEPS_DIR)/flac/lpc.c \
+-                               $(DEPS_DIR)/flac/md5.c \
+-                               $(DEPS_DIR)/flac/memory.c \
+-                               $(DEPS_DIR)/flac/stream_decoder.c
+-
+ SOURCES_C += $(DEPS_DIR)/lzma/C/7zArcIn.c \
+                                $(DEPS_DIR)/lzma/C/7zBuf.c \
+                                $(DEPS_DIR)/lzma/C/7zCrc.c \
+@@ -440,19 +424,3 @@ SOURCES_C += $(DEPS_DIR)/lzma/C/7zArcIn.
+                                $(DEPS_DIR)/lzma/C/Sort.c
+ 
+ endif
+-
+-SOURCES_C +=   $(DEPS_DIR)/zlib/deflate.c \
+-                                      $(DEPS_DIR)/zlib/gzlib.c \
+-                                      $(DEPS_DIR)/zlib/uncompr.c \
+-                                      $(DEPS_DIR)/zlib/zutil.c \
+-                                      $(DEPS_DIR)/zlib/inffast.c \
+-                                      $(DEPS_DIR)/zlib/gzread.c \
+-                                      $(DEPS_DIR)/zlib/crc32.c \
+-                                      $(DEPS_DIR)/zlib/gzwrite.c \
+-                                      $(DEPS_DIR)/zlib/inflate.c \
+-                                      $(DEPS_DIR)/zlib/infback.c \
+-                                      $(DEPS_DIR)/zlib/inftrees.c \
+-                                      $(DEPS_DIR)/zlib/trees.c \
+-                                      $(DEPS_DIR)/zlib/gzclose.c \
+-                                      $(DEPS_DIR)/zlib/compress.c \
+-                                      $(DEPS_DIR)/zlib/adler32.c
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/patches/patch-core_hw_aica_dsp__x64.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/patches/patch-core_hw_aica_dsp__x64.cpp        Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-core_hw_aica_dsp__x64.cpp,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+Add support for more operating systems.
+
+--- core/hw/aica/dsp_x64.cpp.orig      2020-05-29 12:45:55.000000000 +0000
++++ core/hw/aica/dsp_x64.cpp
+@@ -33,7 +33,10 @@
+ DECL_ALIGN(4096) static u8 CodeBuffer[32 * 1024]
+ #if defined(_WIN32) || defined(__HAIKU__)
+       ;
+-#elif defined(__linux__)
++#elif defined(__linux__) || \
++      defined(__FreeBSD__) || \
++      defined(__DragonFly__) || \
++      defined(__NetBSD__)
+       __attribute__((section(".text")));
+ #elif defined(__MACH__)
+       __attribute__((section("__TEXT,.text")));
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/patches/patch-core_hw_sh4_dyna_driver.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/patches/patch-core_hw_sh4_dyna_driver.cpp      Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-core_hw_sh4_dyna_driver.cpp,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+Add support for NetBSD.
+
+--- core/hw/sh4/dyna/driver.cpp.orig   2020-05-29 12:45:55.000000000 +0000
++++ core/hw/sh4/dyna/driver.cpp
+@@ -28,7 +28,7 @@ u8 SH4_TCB[CODE_SIZE + TEMP_CODE_SIZE + 
+ #if defined(_WIN32) || FEAT_SHREC != DYNAREC_JIT
+       ;
+ #elif defined(__linux__) || defined(__HAIKU__) || \
+-      defined(__FreeBSD__) || defined(__DragonFly__) || \
++      defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || \
+         defined(HAVE_LIBNX)
+       __attribute__((section(".text")));
+ #elif defined(__MACH__)
diff -r af85c19b7886 -r 80710b979f7a emulators/libretro-flycast/patches/patch-core_libretro_common.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/libretro-flycast/patches/patch-core_libretro_common.cpp Sun May 31 15:20:22 2020 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-core_libretro_common.cpp,v 1.1 2020/05/31 15:20:22 nia Exp $
+
+Add support for NetBSD.
+
+--- core/libretro/common.cpp.orig      2020-05-29 12:45:55.000000000 +0000
++++ core/libretro/common.cpp
+@@ -298,7 +298,7 @@ static void sigill_handler(int sn, sigin
+ #endif
+ 
+ #if defined(__MACH__) || defined(__linux__) || defined(__HAIKU__) || \
+-   defined(__FreeBSD__) || defined(__DragonFly__) || defined(HAVE_LIBNX)
++   defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(HAVE_LIBNX)
+ //#define LOG_SIGHANDLER
+ 



Home | Main Index | Thread Index | Old Index