PORTNAME=	vita3k
DISTVERSIONPREFIX=	v
DISTVERSION=	0.2.1.g20261130
CATEGORIES=	emulators

MAINTAINER=	kenrap@FreeBSD.org
COMMENT=	Experimental PlayStation Vita emulator
WWW=		https://vita3k.org/

LICENSE=	GPLv2+
LICENSE_FILE=	${WRKSRC}/COPYING.txt

BUILD_DEPENDS=	${LOCALBASE}/include/boost/version.hpp:devel/boost-libs

LIB_DEPENDS=	libavformat.so:multimedia/ffmpeg \
		libcurl.so:ftp/curl \
		libwayland-client.so:graphics/wayland \
		libxkbcommon.so:x11/libxkbcommon

USES=		cmake compiler:c++23-lang pkgconfig qt:6 ssl xorg

USE_GITHUB=	yes
GH_ACCOUNT=	Vita3K
GH_PROJECT=	Vita3K
GH_TAGNAME=	ba1e77e529da011638e421e5093e61e10361a08a

GH_TUPLE=	Vita3K:LibAtrac9:82767fe3:libatrac9/external/LibAtrac9 \
		KhronosGroup:SPIRV-Cross:d8e3e2b1:spirvcross/external/SPIRV-Cross \
		YaaZ:VulkanMemoryAllocator-Hpp:3843082e:vulkanmemoryallocatorhpp/external/VulkanMemoryAllocator-Hpp \
		KhronosGroup:Vulkan-Headers:19725e4:vulkanheaders/external/VulkanMemoryAllocator-Hpp/Vulkan-Headers \
		GPUOpen-LibrariesAndSDKs:VulkanMemoryAllocator:c788c52:vulkanmemoryallocator/external/VulkanMemoryAllocator-Hpp/VulkanMemoryAllocator \
		Vita3K:ext-boost:ff5f55bd:extboost/external/boost \
		aquynh:capstone:02257584:capstone/external/capstone \
		cameron314:concurrentqueue:9afb9974:concurrentqueue/external/concurrentqueue \
		mozilla:cubeb:4274d032:cubeb/external/cubeb \
		arsenm:sanitizers-cmake:aab6948:sanitizerscmake/external/cubeb/cmake/sanitizers-cmake \
		google:googletest:40412d8:googletest/external/cubeb/googletest \
		mozilla:cubeb-coreaudio-rs:840f69c:cubebcoreaudiors/external/cubeb/src/cubeb-coreaudio-rs \
		mozilla:cubeb-pulse-rs:88194f9:cubebpulsers/external/cubeb/src/cubeb-pulse-rs \
		tronkko:dirent:31db6474:dirent/external/dirent \
		Vita3K:dlmalloc:e98f4ee1:dlmalloc/external/dlmalloc \
		Vita3K:dynarmic:dfa9202:dynarmic/external/dynarmic \
		Vita3K:ffmpeg-core:eaf918c9:ffmpegcore/external/ffmpeg \
		fmtlib:fmt:1be298e1:fmt/external/fmt \
		KhronosGroup:glslang:fc9889c8:glslang/external/glslang \
		google:googletest:52eb8108:googletest/external/googletest \
		bylaws:libadrenotools:8fae8ce2:libadrenotools/external/libadrenotools \
		bylaws:liblinkernsbypass:aa39758:liblinkernsbypass/external/libadrenotools/lib/linkernsbypass \
		Vita3K:libfat16:d9a890b7:libfat16/external/libfat16 \
		btzy:nativefiledialog-extended:fc168e86:nativefiledialogextended/external/nativefiledialog-extended \
		Vita3K:printf:f08e577d:printf/external/printf \
		Vita3K:psvpfstools:e9c5c7c4:psvpfstools/external/psvpfstools \
		korewawatchful:libb64:3896b7a:libb64/external/psvpfstools/libb64 \
		KorewaWatchful:libzRIF:7d1e69b:libzrif/external/psvpfstools/libzrif \
		Vita3K:psvpfsparser:05d43a0:psvpfsparser/external/psvpfstools/psvpfsparser \
		korewawatchful:zlib:cb21008:zlib/external/psvpfstools/zlib \
		zeux:pugixml:c8033ce9:pugixml/external/pugixml \
		libsdl-org:SDL:fa2c02bb:sdl/external/sdl \
		gabime:spdlog:d6c93f38:spdlog/external/spdlog \
		nothings:stb:31c1ad37:stb/external/stb \
		Vita3K:substitute:319da6b5:substitute/external/substitute \
		wolfpld:tracy:f2a4f252:tracy/external/tracy \
		vitasdk:vita-toolchain:43fc1e3c:vitatoolchain/external/vita-toolchain \
		Princess-of-Sleeping:psp2rela:9e0f491:psp2rela/external/vita-toolchain/psp2rela \
		Cyan4973:xxHash:e626a72b:xxhash/external/xxHash \
		jbeder:yaml-cpp:56e3bb55:yamlcpp/external/yaml-cpp

USE_QT=		base multimedia svg tools:build
USE_XORG=	ice sm x11 xext

CMAKE_ARGS=	-DSDL_X11_XSCRNSAVER=OFF \
		-DVITA3K_FORCE_SYSTEM_BOOST=ON \
		-DVITA3K_FORCE_SYSTEM_FFMPEG=ON

post-stage:
	@${RMDIR} ${STAGEDIR}${PREFIX}/share/Vita3K/translations

.include <bsd.port.mk>
