# Template file for 'eden'
pkgname=eden
version=0.2.1
revision=1
archs="x86_64* aarch64*"
build_style=cmake
configure_args="-DBUILD_TESTING=OFF -DDYNARMIC_TESTS=OFF
 -DENABLE_UPDATE_CHECKER=OFF -DUSE_DISCORD_PRESENCE=OFF -DYUZU_CMD=OFF
 -DYUZU_ROOM_STANDALONE=OFF -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_FFMPEG=OFF
 -DYUZU_USE_BUNDLED_QT=OFF -DYUZU_USE_BUNDLED_SDL2=OFF
 -DYUZU_USE_EXTERNAL_SDL2=OFF -DUSE_FASTER_LINKER=ON -DCPM_USE_LOCAL_PACKAGES=ON
 -DYUZU_USE_QT_MULTIMEDIA=OFF -DYUZU_USE_QT_WEB_ENGINE=OFF
 -DENABLE_LTO=ON -DENABLE_QT_TRANSLATION=ON"
hostmakedepends="cmake glslang mold pkg-config qt6-base qt6-tools"
makedepends="SDL2-devel SPIRV-Headers SPIRV-Tools-devel Vulkan-Headers
 Vulkan-Utility-Libraries boost-devel-minimal ffmpeg6-devel fmt-devel json-c++
 libenet-devel libgamemode-devel liblz4-devel libva-devel libzstd-devel
 mbedtls-devel opus-devel qt6-base-private-devel zlib-devel qt6-charts-devel
 qt6-qt5compat-devel quazip-qt6-devel"
short_desc="Nintendo Switch video game console emulator"
maintainer="chrysos349 <chrysostom349@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://eden-emu.dev"
changelog="https://git.eden-emu.dev/eden-emu/eden/releases"
distfiles="https://git.eden-emu.dev/eden-emu/eden/archive/v${version}.tar.gz"
checksum=a43ea2886b75204438f691a4ddfad99e88b508e30431978dd13fba1c22440d19

build_options="clang"
build_options_default="clang"
desc_option_clang="Use Clang to build"

if [ "$build_option_clang" ]; then
	_llvm=22
	configure_args+=" -DCMAKE_AR=llvm-ar -DCMAKE_CXX_COMPILER=clang++
	 -DCMAKE_C_COMPILER=clang -DCMAKE_RANLIB=llvm-ranlib"
	hostmakedepends+=" clang${_llvm} lld${_llvm} llvm${_llvm}"
fi

export TITLEBARFORMATRUNNING="Eden | v${version}"
export TITLEBARFORMATIDLE=$TITLEBARFORMATRUNNING

post_patch() {
	vsed -i src/CMakeLists.txt -e "/Werror=shadow/d" \
		-e "s/-Wno-attributes/& -Wno-unnecessary-virtual-specifier/"
}

post_install() {
	vinstall dist/72-yuzu-input.rules 644 usr/lib/udev/rules.d
}
