From nobody Thu May 19 17:49:25 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AB56C1AEEF06; Thu, 19 May 2022 17:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L3y6G15zJz3nnF; Thu, 19 May 2022 17:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652982566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bO8PfKbPXCM/72LXOJ/TJcbr7HCYq7dAw8gh/5cGE34=; b=wf0jnatn0UDG6cdLekUzQRXsnNyHsMpGHN4nDHYq9jZ5ZgF5IbMa90PSkKKJUTQ2s/8OlC yLIRh2M32ETtTp8rvABoqMaIZTziXDKizOfVrmjar9KqdU1U/3Tt0Qsnm+55990+FxNH1m ht627w8GNpvFUm6YUDXO1rf+pYruadb2+Az/qT5lcN3qD2njzzoHKkKbj69PrJDIPV/ruG mzJw3Tm+eSUakkFAJJ5LOEPmIgHQP5G66HR8t4DrS2v0anjpmMY0bY31u7gugZw3TWd3Tk HmdMHTmkuPUtj/QMxAnNKki+0Tg4T8lksmgQ3jxdSiQATCI9vzf55eEFfk/q4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0E81225A7; Thu, 19 May 2022 17:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24JHnP4n029569; Thu, 19 May 2022 17:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24JHnPsh029568; Thu, 19 May 2022 17:49:25 GMT (envelope-from git) Date: Thu, 19 May 2022 17:49:25 GMT Message-Id: <202205191749.24JHnPsh029568@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Neel Chauhan Subject: git: 316d2de4b5ea - main - emulators/libretro-flycast: New port: Standalone port of flycast to libretro List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 316d2de4b5ea9565b4b81bc3e6e00165454d792c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652982566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bO8PfKbPXCM/72LXOJ/TJcbr7HCYq7dAw8gh/5cGE34=; b=N97MmTuXajdy+fkddJbfwBx3q2F/qgn595uCRqJ1jNMpvPNFNjJLLS7/BX2bx9xCa9y3ho 7DjBZRIIr1UEETv3LfVBtzvDHHy4YAFIMWhEgmI62stvJ6J8zLzVsYH1vbcRxmrGHr0saT 5HWDkcXdR3I0QDjTTu/vQ3YO3j23TTdRhCiWjDsU5LOfgB7QgaIHCX21l06t7p1T5AHd2T u9LGNZPBQVmwGNBPGedk41m9F/53nprOw3xGDkWdNFy/helmjKeUuT4yI/TgL6s9NG+Lre UGbTe7CvtjASAhd6TMItSwzAkl+RvirgZNmaPnt1cC5k6mZCPRM6RC0ujUIIoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652982566; a=rsa-sha256; cv=none; b=fuKxtc7k89BricH9B7wHdUa02RH+lr+0ECdG2/UPwBRyXxjoQsRgcXMMaeb5+lXNj8edmh 6YfDxY8siI8mPjrsFrXuSfrpQa6F0GIWpU1r8SguWbvTQrsQiM5XTTBtn0ZYiHzjj9cODZ fvt1AqjT7rWrOm4StL+gy0DofxCdekUXgzLW4+YtcFHuNA5pUVCg1qdeIFr2FvS63bH0xs x1caFapDOBNrLPyha1NfeUdi7ZiebYSXzqofHqXnfcGhYMD9Y3uzFcBXYKkXI0Yy2e6ER5 JlWoTxDMOYgmtdQQW8T2ZPHoEDsFI1WiEYIfXT6l1jahlIJi1QL79hDa0xwpvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by nc: URL: https://cgit.FreeBSD.org/ports/commit/?id=316d2de4b5ea9565b4b81bc3e6e00165454d792c commit 316d2de4b5ea9565b4b81bc3e6e00165454d792c Author: Timothy Beyer AuthorDate: 2022-05-17 03:53:46 +0000 Commit: Neel Chauhan CommitDate: 2022-05-19 17:49:21 +0000 emulators/libretro-flycast: New port: Standalone port of flycast to libretro PR: 257170 --- emulators/Makefile | 1 + emulators/libretro-flycast/Makefile | 63 ++++++++++++++++++++++ emulators/libretro-flycast/distinfo | 3 ++ emulators/libretro-flycast/files/patch-Makefile | 33 ++++++++++++ .../files/patch-core_hw_aica_dsp__x64.cpp | 11 ++++ .../files/patch-core_hw_bba_rtl8139c.h | 18 +++++++ .../patch-core_libretro-common_rthreads_rthreads.c | 14 +++++ emulators/libretro-flycast/pkg-descr | 6 +++ emulators/libretro-flycast/pkg-message | 14 +++++ 9 files changed, 163 insertions(+) diff --git a/emulators/Makefile b/emulators/Makefile index b44c4738624a..574973a982a1 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -57,6 +57,7 @@ SUBDIR += lib765 SUBDIR += libc6-shim SUBDIR += libdsk + SUBDIR += libretro-flycast SUBDIR += libretro-mame SUBDIR += libretro-ppsspp SUBDIR += libretro-reicast diff --git a/emulators/libretro-flycast/Makefile b/emulators/libretro-flycast/Makefile new file mode 100644 index 000000000000..fe5e75d0f23f --- /dev/null +++ b/emulators/libretro-flycast/Makefile @@ -0,0 +1,63 @@ +# $FreeBSD$ + +PORTNAME= libretro-flycast +PORTVERSION= 0.20210608 +CATEGORIES= emulators games + +MAINTAINER= beyert@cs.ucr.edu +COMMENT= Standalone port of flycast to libretro + +LICENSE= GPLv2 +#LICENSE_COMB= multi +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= amd64 i386 + +LIB_DEPENDS+= libao.so:audio/libao \ + libasound.so:audio/alsa-lib \ + libcurl.so:ftp/curl \ + libevdev.so:devel/libevdev \ + libpulse.so:audio/pulseaudio \ + libudev.so:devel/libudev-devd \ + libvulkan.so:graphics/vulkan-loader + +USES= compiler:c++11-lib dos2unix gl gmake xorg +USE_LDCONFIG= yes + +USE_GITHUB= yes +GH_ACCOUNT= libretro +GH_PROJECT= flycast +GH_TAGNAME= 8e4fa54e + +USE_GL+= gl glew glu + +CFLAGS+= -I${LOCALBASE}/include +CXXFLAGS+= -I${LOCALBASE}/include + +.include + +DOS2UNIX_FILES= core/hw/bba/rtl8139c.h + +.if ${ARCH} == amd64 +CFLAGS+= -DLOW_END +CXXFLAGS+= -DLOW_END +.endif + +LDFLAGS+= -L${LOCALBASE}/lib +MAKE_ARGS= HAVE_GENERIC_JIT=0 \ + HAVE_VULKAN=0 + +.if ${ARCH} == amd64 +MAKE_ARGS+= WITH_DYNAREC=x86_64 +.elif ${ARCH} == i386 +MAKE_ARGS+= WITH_DYNAREC=x86 +.endif + +PLIST_FILES= lib/libretro/flycast_libretro.so + +do-install: + ${MKDIR} ${STAGEDIR}/${PREFIX}/lib/libretro; + ${INSTALL_LIB} ${WRKSRC}/flycast_libretro.so \ + ${STAGEDIR}/${PREFIX}/lib/libretro/flycast_libretro.so; + +.include diff --git a/emulators/libretro-flycast/distinfo b/emulators/libretro-flycast/distinfo new file mode 100644 index 000000000000..eab0e7f1dc9c --- /dev/null +++ b/emulators/libretro-flycast/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1623193824 +SHA256 (libretro-flycast-0.20210608-8e4fa54e_GH0.tar.gz) = c11f19e25cf605ca3a2df74d1595c1b21ef8fff52b7fa42fc9bfc7fde611059e +SIZE (libretro-flycast-0.20210608-8e4fa54e_GH0.tar.gz) = 6576666 diff --git a/emulators/libretro-flycast/files/patch-Makefile b/emulators/libretro-flycast/files/patch-Makefile new file mode 100644 index 000000000000..a0ba13f9b085 --- /dev/null +++ b/emulators/libretro-flycast/files/patch-Makefile @@ -0,0 +1,33 @@ +--- Makefile.orig 2021-05-17 21:23:19 UTC ++++ Makefile +@@ -45,12 +45,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") +@@ -70,7 +66,7 @@ endif + # Target Dynarec + WITH_DYNAREC = $(ARCH) + +-ifeq ($(ARCH), $(filter $(ARCH), i386 i686)) ++ifeq ($(ARCH), $(filter $(ARCH), i386 i486 i686)) + WITH_DYNAREC = x86 + endif + +@@ -145,7 +141,7 @@ ifneq (,$(findstring unix,$(platform))) + HAVE_CDROM = 1 + fpic = -fPIC + +- ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), x86_64 x64)) ++ ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), x86_64 x64 amd64)) + CFLAGS += -DTARGET_LINUX_x64 + SINGLE_PREC_FLAGS=1 + HAVE_GENERIC_JIT = 0 diff --git a/emulators/libretro-flycast/files/patch-core_hw_aica_dsp__x64.cpp b/emulators/libretro-flycast/files/patch-core_hw_aica_dsp__x64.cpp new file mode 100644 index 000000000000..e49c4888bf1d --- /dev/null +++ b/emulators/libretro-flycast/files/patch-core_hw_aica_dsp__x64.cpp @@ -0,0 +1,11 @@ +--- core/hw/aica/dsp_x64.cpp.orig 2021-05-17 21:23:19 UTC ++++ core/hw/aica/dsp_x64.cpp +@@ -37,6 +37,8 @@ DECL_ALIGN(4096) static u8 CodeBuffer[32 * 1024] + __attribute__((section(".text"))); + #elif defined(__MACH__) + __attribute__((section("__TEXT,.text"))); ++#elif defined(__FreeBSD__) ++ __attribute__((section(".text"))); + #else + #error CodeBuffer code section unknown + #endif diff --git a/emulators/libretro-flycast/files/patch-core_hw_bba_rtl8139c.h b/emulators/libretro-flycast/files/patch-core_hw_bba_rtl8139c.h new file mode 100644 index 000000000000..9f929eddba9b --- /dev/null +++ b/emulators/libretro-flycast/files/patch-core_hw_bba_rtl8139c.h @@ -0,0 +1,18 @@ +--- core/hw/bba/rtl8139c.h.orig 2021-06-18 06:17:55 UTC ++++ core/hw/bba/rtl8139c.h +@@ -58,6 +58,7 @@ struct MemoryRegion { + /* + * Byte swapping utilities + */ ++/* + static inline uint16_t bswap16(uint16_t x) + { + return (((x & 0x00ff) << 8) | +@@ -71,6 +72,7 @@ static inline uint32_t bswap32(uint32_t x) + ((x & 0x00ff0000U) >> 8) | + ((x & 0xff000000U) >> 24)); + } ++*/ + #define glue(a, b) _glue(a, b) + #define _glue(a, b) a ## b + diff --git a/emulators/libretro-flycast/files/patch-core_libretro-common_rthreads_rthreads.c b/emulators/libretro-flycast/files/patch-core_libretro-common_rthreads_rthreads.c new file mode 100644 index 000000000000..82c1108625e7 --- /dev/null +++ b/emulators/libretro-flycast/files/patch-core_libretro-common_rthreads_rthreads.c @@ -0,0 +1,14 @@ +--- core/libretro-common/rthreads/rthreads.c.orig 2021-05-17 21:23:19 UTC ++++ core/libretro-common/rthreads/rthreads.c +@@ -55,10 +55,9 @@ + #include + #else + #include +-#include + #endif + +-#if defined(VITA) || defined(BSD) || defined(ORBIS) ++#if defined(VITA) || defined(__FreeBSD__) || defined(ORBIS) + #include + #endif + diff --git a/emulators/libretro-flycast/pkg-descr b/emulators/libretro-flycast/pkg-descr new file mode 100644 index 000000000000..af0f3cff8768 --- /dev/null +++ b/emulators/libretro-flycast/pkg-descr @@ -0,0 +1,6 @@ +Standalone port of Flycast to libretro. + +Flycast is a multi-platform Sega Dreamcast, Naomi and Atomiswave emulator +derived from Reicast. + +WWW: https://git.libretro.com/libretro/flycast diff --git a/emulators/libretro-flycast/pkg-message b/emulators/libretro-flycast/pkg-message new file mode 100644 index 000000000000..4faa5801ca78 --- /dev/null +++ b/emulators/libretro-flycast/pkg-message @@ -0,0 +1,14 @@ +[ +{ type: install + message: <