emulators/pcsx2: New port: Free and open-source PlayStation 2 emulator

This commit is contained in:
Ganael LAPLANCHE 2022-09-19 16:23:19 +02:00
parent 1966544a80
commit 661ff228ca
9 changed files with 302 additions and 0 deletions

View File

@ -103,6 +103,7 @@
SUBDIR += parallels-tools
SUBDIR += pcem
SUBDIR += pcemu
SUBDIR += pcsx2
SUBDIR += pcsxr
SUBDIR += ppsspp
SUBDIR += ppsspp-qt5

70
emulators/pcsx2/Makefile Normal file
View File

@ -0,0 +1,70 @@
PORTNAME= pcsx2
PORTVERSION= 1.7.3274
CATEGORIES= emulators
MAINTAINER= martymac@FreeBSD.org
COMMENT= Free and open-source PlayStation 2 emulator
WWW= https://pcsx2.net
LICENSE= GPLv3 LGPL3
LICENSE_COMB= multi
ONLY_FOR_ARCHS= amd64
# Notes on dependencies (see cmake/SearchForStuff.cmake):
# - rapidyaml (and c4core) come from 3rdparty/ (0.4.0 is needed)
# - glad comes from 3rdparty/ (conflicts with libglvnd)
# - zstd comes from 3rdparty/ (not detected yet)
# - cubeb comes from 3rdparty/ (not available from ports yet)
LIB_DEPENDS= libpng.so:graphics/png \
libpulse.so:audio/pulseaudio \
libSoundTouch.so:audio/soundtouch \
libsamplerate.so:audio/libsamplerate \
libharfbuzz.so:print/harfbuzz \
libfmt.so:devel/libfmt \
libzip.so:archivers/libzip
# libryml.so:devel/rapidyaml \
# libglad.so:graphics/glad \
# libzstd.so:archivers/zstd
USES= cmake desktop-file-utils gl gnome pkgconfig sdl xorg
USE_GITHUB= yes
GH_PROJECT= pcsx2
GH_TAGNAME= v${PORTVERSION}
.include "${.CURDIR}/Makefile.tuples"
USE_GL= egl
USE_GNOME= glib20 gtk30
USE_SDL= sdl2
USE_XORG= ice x11 xcb xext xpm xrandr
USE_WX= 3.0+
# See: cmake/BuildParameters.cmake
CMAKE_ARGS+= -DCMAKE_INSTALL_DOCDIR=${DOCSDIR} \
-DPACKAGE_MODE:BOOL=ON \
-DUSE_VTUNE:BOOL=OFF \
-DUSE_VULKAN:BOOL=OFF \
-DQT_BUILD:BOOL=OFF \
-DENABLE_TESTS:BOOL=OFF \
-DDISABLE_PCSX2_WRAPPER:BOOL=ON
DATADIR= ${PREFIX}/share/PCSX2
OPTIONS_DEFINE= DOCS NLS
OPTIONS_SUB= yes
NLS_USES= gettext
NLS_CMAKE_ON= -DNO_TRANSLATION:BOOL=OFF
NLS_CMAKE_OFF= -DNO_TRANSLATION:BOOL=ON
# For maintainer (do not forget to clean up Makefile.tuples afterwards to
# remove useless submodules)
Makefile.tuples::
@${RM} -f ${.CURDIR}/Makefile.tuples
@${RM} -rf ${WRKDIR}/.maintainer.checkout
@${MKDIR} ${WRKDIR}/.maintainer.checkout && \
cd ${WRKDIR}/.maintainer.checkout && \
git clone --recursive --branch=v${PORTVERSION} \
https://github.com/${PORTNAME}/${PORTNAME} . && \
${SH} ${FILESDIR}/gen_gh_tuple.sh >> ${.CURDIR}/Makefile.tuples
.include <bsd.port.mk>

View File

@ -0,0 +1,12 @@
GH_TUPLE= \
rtissera:libchdr:5de1a59019815ccdbba0fe07c71b31406d023248:libchdr/3rdparty/libchdr/libchdr \
mozilla:cubeb:dc511c6b3597b6384d28949285b9289e009830ea:cubeb/3rdparty/cubeb/cubeb \
biojppm:rapidyaml:213b201d264139cd1b887790197e08850af628e3:rapidyaml/3rdparty/rapidyaml/rapidyaml \
ocornut:imgui:60bea052a92cbb4a93b221002fdf04f0da3698e1:imgui/3rdparty/imgui/imgui \
facebook:zstd:e47e674cd09583ff0503f0f6defd6d23d8b718d3:zstd/3rdparty/zstd/zstd \
google:googletest:800f5422ac9d9e0ad59cd860a2ef3a679588acb4:googletest/3rdparty/cubeb/cubeb/googletest \
arsenm:sanitizers-cmake:aab6948fa863bc1cbe5d0850bc46b9ef02ed4c1a:sanitizerscmake/3rdparty/cubeb/cubeb/cmake/sanitizers-cmake \
biojppm:c4core:d35c7c9bf370134595699d791e6ff8db018ddc8d:c4core/3rdparty/rapidyaml/rapidyaml/ext/c4core \
biojppm:cmake:371982300ff5a076d7c3199057ebed77bbe3472f:cmake/3rdparty/rapidyaml/rapidyaml/ext/c4core/cmake \
biojppm:debugbreak:5dcbe41d2bd4712c8014aa7e843723ad7b40fd74:debugbreak/3rdparty/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/debugbreak \
fastfloat:fast_float:32d21dcecb404514f94fb58660b8029a4673c2c1:fast_float/3rdparty/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/fast_float

25
emulators/pcsx2/distinfo Normal file
View File

@ -0,0 +1,25 @@
TIMESTAMP = 1663532752
SHA256 (pcsx2-pcsx2-1.7.3274-v1.7.3274_GH0.tar.gz) = f7b9d64cdd32f95c37157f4b805ab8d1a162b0e481b16fc1857108d4488ccb37
SIZE (pcsx2-pcsx2-1.7.3274-v1.7.3274_GH0.tar.gz) = 18696918
SHA256 (rtissera-libchdr-5de1a59019815ccdbba0fe07c71b31406d023248_GH0.tar.gz) = e0df9f88cd93e673d384cbf7cf28ea396aba96c769b41ec149a259768b27b00c
SIZE (rtissera-libchdr-5de1a59019815ccdbba0fe07c71b31406d023248_GH0.tar.gz) = 414409
SHA256 (mozilla-cubeb-dc511c6b3597b6384d28949285b9289e009830ea_GH0.tar.gz) = e67aae13adcb84b1548e2a6de266e2daadaa26aff86d91e775749748c3894478
SIZE (mozilla-cubeb-dc511c6b3597b6384d28949285b9289e009830ea_GH0.tar.gz) = 223207
SHA256 (biojppm-rapidyaml-213b201d264139cd1b887790197e08850af628e3_GH0.tar.gz) = c206d4565ccfa721991a8df90821d1a1f747e68385a0f3f5b9ab995e191c06be
SIZE (biojppm-rapidyaml-213b201d264139cd1b887790197e08850af628e3_GH0.tar.gz) = 446070
SHA256 (ocornut-imgui-60bea052a92cbb4a93b221002fdf04f0da3698e1_GH0.tar.gz) = 53da3a145256434fa9c16720d03916a173a6bc447c3c4b53ab46159cd85283a3
SIZE (ocornut-imgui-60bea052a92cbb4a93b221002fdf04f0da3698e1_GH0.tar.gz) = 1477417
SHA256 (facebook-zstd-e47e674cd09583ff0503f0f6defd6d23d8b718d3_GH0.tar.gz) = 2a7b7e5d3f8c759894f0fea9917a590733600574d20cb53f3be827c7c62862e1
SIZE (facebook-zstd-e47e674cd09583ff0503f0f6defd6d23d8b718d3_GH0.tar.gz) = 1952167
SHA256 (google-googletest-800f5422ac9d9e0ad59cd860a2ef3a679588acb4_GH0.tar.gz) = 57bc26ac31e1bc47a12e4ae99a0f6e17506ba10f0f82ae16aa52cc7cc215a3b0
SIZE (google-googletest-800f5422ac9d9e0ad59cd860a2ef3a679588acb4_GH0.tar.gz) = 455806
SHA256 (arsenm-sanitizers-cmake-aab6948fa863bc1cbe5d0850bc46b9ef02ed4c1a_GH0.tar.gz) = 9f5b073625375322236a94ce8d2d803cdedad321c91e63845f487b9ebfb2c433
SIZE (arsenm-sanitizers-cmake-aab6948fa863bc1cbe5d0850bc46b9ef02ed4c1a_GH0.tar.gz) = 7234
SHA256 (biojppm-c4core-d35c7c9bf370134595699d791e6ff8db018ddc8d_GH0.tar.gz) = b768c8fb5dd4740317b7e1a3e43a0b32615d4d4e1e974d7ab515a80d2f1f318d
SIZE (biojppm-c4core-d35c7c9bf370134595699d791e6ff8db018ddc8d_GH0.tar.gz) = 262210
SHA256 (biojppm-cmake-371982300ff5a076d7c3199057ebed77bbe3472f_GH0.tar.gz) = 1d3ded3a552a5993c8ebe5059a9829e0e26ae4f4780c179a11882d25da203de6
SIZE (biojppm-cmake-371982300ff5a076d7c3199057ebed77bbe3472f_GH0.tar.gz) = 122880
SHA256 (biojppm-debugbreak-5dcbe41d2bd4712c8014aa7e843723ad7b40fd74_GH0.tar.gz) = 4b424d23dad957937c57c142648d32571a78a6c6b2e473709748e5c1bb8a0f92
SIZE (biojppm-debugbreak-5dcbe41d2bd4712c8014aa7e843723ad7b40fd74_GH0.tar.gz) = 7033
SHA256 (fastfloat-fast_float-32d21dcecb404514f94fb58660b8029a4673c2c1_GH0.tar.gz) = 8035a9ca28a8e3dfee332c7960af3c06ef0ab5169d5f31228b89c469e882bef7
SIZE (fastfloat-fast_float-32d21dcecb404514f94fb58660b8029a4673c2c1_GH0.tar.gz) = 76108

View File

@ -0,0 +1,29 @@
#!/bin/sh
echo "GH_TUPLE= \\"
for _sm_root in $(find . -type f -name .gitmodules | sed 's/\.gitmodules$//' | sort)
do
(
cd "${_sm_root}"
# Crawl name|path|url list of submodules within _sm_root
grep -e '^\[submodule "' -e 'path = ' -e 'url = ' .gitmodules | \
sed -E -e 's|.*"([^"]+)".*|\1|' -e 's|.*= ||' | \
paste - - - | \
sed -E 's/[[:space:]]+/|/g' | \
while read _sm
do
_sm_name=$(echo "${_sm}" | cut -d '|' -f 1)
_sm_path=$(echo "${_sm}" | cut -d '|' -f 2)
_sm_url=$(echo "${_sm}" | cut -d '|' -f 3)
_sm_prefix=$(echo "${_sm_root}" | sed 's|^\./||')
_account_project=$(echo "${_sm_url}" | sed -e 's|^https://github.com/||' -e 's|/|:|g' -e 's|\.git$||')
_group=$(echo "${_account_project}" | cut -d ':' -f 2 | tr -cd 'a-zA-Z0-9_')
_tagname_group_subdir=$(git submodule status "${_sm_path}" | sed -E -e 's|^.||' -e "s|[[:space:]]+|:${_group}/${_sm_prefix}|" -e 's|[[:space:]]+.*$||')
echo -e "\t${_account_project}:${_tagname_group_subdir} \\"
done
)
done
echo ""

View File

@ -0,0 +1,10 @@
--- 3rdparty/glad/CMakeLists.txt.orig 2022-09-02 10:21:30 UTC
+++ 3rdparty/glad/CMakeLists.txt
@@ -12,6 +12,7 @@ elseif(X11_API OR WAYLAND_API)
)
endif()
+target_include_directories(glad PRIVATE "${CMAKE_INSTALL_PREFIX}/include")
target_include_directories(glad PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(glad INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(glad PRIVATE Threads::Threads "${CMAKE_DL_LIBS}")

View File

@ -0,0 +1,31 @@
--- pcsx2/CMakeLists.txt.orig 2022-09-02 10:21:30 UTC
+++ pcsx2/CMakeLists.txt
@@ -1581,8 +1581,14 @@ endif()
# MacOSX/BSD
if(UNIX AND NOT Linux)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
target_sources(PCSX2 PRIVATE
- ${pcsx2OSXSources}
+ ${pcsx2FreeBSDSources})
+ else()
+ target_sources(PCSX2 PRIVATE
+ ${pcsx2OSXSources})
+ endif()
+ target_sources(PCSX2 PRIVATE
${pcsx2LinuxHeaders}
${pcsx2USBNullSources}
${pcsx2USBNullHeaders})
@@ -1599,12 +1605,6 @@ else()
${pcsx2USBNullSources}
${pcsx2USBNullHeaders})
endif()
-endif()
-
-if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
- target_sources(PCSX2 PRIVATE
- ${pcsx2FreeBSDSources}
- ${pcsx2LinuxHeaders})
endif()
target_link_libraries(PCSX2_FLAGS INTERFACE

View File

@ -0,0 +1,5 @@
PCSX2 is a free and open-source PlayStation 2 (PS2) emulator.
Its purpose is to emulate the PS2's hardware, using a combination of MIPS CPU
Interpreters, Recompilers and a Virtual Machine which manages hardware states
and PS2 system memory.

119
emulators/pcsx2/pkg-plist Normal file
View File

@ -0,0 +1,119 @@
bin/pcsx2
%%DATADIR%%/resources/GameIndex.yaml
%%DATADIR%%/resources/cover-placeholder.png
%%DATADIR%%/resources/fonts/Roboto-Regular-copyright
%%DATADIR%%/resources/fonts/Roboto-Regular.ttf
%%DATADIR%%/resources/fonts/RobotoMono-Medium.ttf
%%DATADIR%%/resources/fonts/fa-solid-900.ttf
%%DATADIR%%/resources/fullscreenui/applications-system.png
%%DATADIR%%/resources/fullscreenui/media-cdrom.png
%%DATADIR%%/resources/fullscreenui/placeholder.png
%%DATADIR%%/resources/game_controller_db.txt
%%DATADIR%%/resources/icons/AppIconLarge.png
%%DATADIR%%/resources/icons/flags/NTSC-B.png
%%DATADIR%%/resources/icons/flags/NTSC-C.png
%%DATADIR%%/resources/icons/flags/NTSC-HK.png
%%DATADIR%%/resources/icons/flags/NTSC-J.png
%%DATADIR%%/resources/icons/flags/NTSC-K.png
%%DATADIR%%/resources/icons/flags/NTSC-T.png
%%DATADIR%%/resources/icons/flags/NTSC-U.png
%%DATADIR%%/resources/icons/flags/Other.png
%%DATADIR%%/resources/icons/flags/PAL-A.png
%%DATADIR%%/resources/icons/flags/PAL-AF.png
%%DATADIR%%/resources/icons/flags/PAL-AU.png
%%DATADIR%%/resources/icons/flags/PAL-BE.png
%%DATADIR%%/resources/icons/flags/PAL-E.png
%%DATADIR%%/resources/icons/flags/PAL-F.png
%%DATADIR%%/resources/icons/flags/PAL-FI.png
%%DATADIR%%/resources/icons/flags/PAL-G.png
%%DATADIR%%/resources/icons/flags/PAL-GR.png
%%DATADIR%%/resources/icons/flags/PAL-I.png
%%DATADIR%%/resources/icons/flags/PAL-IN.png
%%DATADIR%%/resources/icons/flags/PAL-M.png
%%DATADIR%%/resources/icons/flags/PAL-NL.png
%%DATADIR%%/resources/icons/flags/PAL-NO.png
%%DATADIR%%/resources/icons/flags/PAL-P.png
%%DATADIR%%/resources/icons/flags/PAL-R.png
%%DATADIR%%/resources/icons/flags/PAL-S.png
%%DATADIR%%/resources/icons/flags/PAL-SC.png
%%DATADIR%%/resources/icons/flags/PAL-SW.png
%%DATADIR%%/resources/icons/flags/PAL-SWI.png
%%DATADIR%%/resources/icons/flags/PAL-UK.png
%%DATADIR%%/resources/icons/star-0.png
%%DATADIR%%/resources/icons/star-1.png
%%DATADIR%%/resources/icons/star-2.png
%%DATADIR%%/resources/icons/star-3.png
%%DATADIR%%/resources/icons/star-4.png
%%DATADIR%%/resources/icons/star-5.png
%%NLS%%%%DATADIR%%/resources/locale/ar_SA/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/ar_SA/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/ca_ES/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/ca_ES/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/cs_CZ/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/cs_CZ/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/da_DK/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/da_DK/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/de_DE/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/de_DE/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/es_ES/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/es_ES/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/fi_FI/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/fi_FI/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/fr_FR/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/fr_FR/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/hr_HR/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/hr_HR/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/hu_HU/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/hu_HU/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/id_ID/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/id_ID/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/it_IT/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/it_IT/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/ja_JP/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/ja_JP/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/ko_KR/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/ko_KR/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/lt_LT/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/lt_LT/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/ms_MY/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/ms_MY/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/nb_NO/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/nb_NO/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/nl_NL/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/nl_NL/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/pl_PL/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/pl_PL/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/pt_BR/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/pt_BR/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/ru_RU/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/ru_RU/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/sv_SE/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/sv_SE/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/th_TH/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/th_TH/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/tr_TR/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/tr_TR/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/zh_CN/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/zh_CN/pcsx2_Main.mo
%%NLS%%%%DATADIR%%/resources/locale/zh_TW/pcsx2_Iconized.mo
%%NLS%%%%DATADIR%%/resources/locale/zh_TW/pcsx2_Main.mo
%%DATADIR%%/resources/shaders/common/fxaa.fx
%%DATADIR%%/resources/shaders/opengl/common_header.glsl
%%DATADIR%%/resources/shaders/opengl/convert.glsl
%%DATADIR%%/resources/shaders/opengl/interlace.glsl
%%DATADIR%%/resources/shaders/opengl/merge.glsl
%%DATADIR%%/resources/shaders/opengl/present.glsl
%%DATADIR%%/resources/shaders/opengl/shadeboost.glsl
%%DATADIR%%/resources/shaders/opengl/tfx_fs.glsl
%%DATADIR%%/resources/shaders/opengl/tfx_vgs.glsl
%%DATADIR%%/resources/shaders/vulkan/convert.glsl
%%DATADIR%%/resources/shaders/vulkan/interlace.glsl
%%DATADIR%%/resources/shaders/vulkan/merge.glsl
%%DATADIR%%/resources/shaders/vulkan/present.glsl
%%DATADIR%%/resources/shaders/vulkan/shadeboost.glsl
%%DATADIR%%/resources/shaders/vulkan/tfx.glsl
share/applications/PCSX2.desktop
%%PORTDOCS%%%%DOCSDIR%%/Configuration_Guide.pdf
%%PORTDOCS%%%%DOCSDIR%%/PCSX2_FAQ.pdf
share/man/man1/PCSX2.1.gz
share/pixmaps/PCSX2.xpm