# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit cmake desktop git-r3 xdg DESCRIPTION="Advanced cross-platform rhythm game focused on keyboard play" HOMEPAGE="https://etternaonline.com" EGIT_REPO_URI="https://github.com/etternagame/etterna.git" EGIT_BRANCH="develop" LICENSE="MIT" SLOT="0" KEYWORDS="" IUSE="alsa jack pulseaudio" RDEPEND=" dev-libs/openssl:= media-libs/libglvnd media-libs/libogg net-misc/curl x11-libs/libX11 x11-libs/libXrandr alsa? ( media-libs/alsa-lib ) jack? ( virtual/jack ) pulseaudio? ( media-libs/libpulse ) " DEPEND="${RDEPEND}" BDEPEND=" dev-util/patchelf " src_prepare() { default sed -i \ -e '/add_subdirectory(crashpad)/d' \ extern/CMakeLists.txt || die sed -i \ -e 's/\(set(OPENSSL_USE_STATIC_LIBS\) ON/\1 OFF/' \ CMakeLists.txt || die sed -i \ -e 's/if (ANDROID AND (\${CMAKE_SYSTEM_VERSION} LESS 21))/if (ANDROID)/' \ extern/luajit/src/CMakeLists.txt || die sed -i \ -e '1i #include ' \ extern/mad-0.15.1b/global.h || die cmake_src_prepare } src_install() { local bin local dir bin=$(find "${S}" \ -maxdepth 1 \ -type f \ -name 'Etterna*' \ -perm -111 \ -print -quit) || die [[ -n ${bin} ]] || die "Unable to locate Etterna executable" exeinto /opt/etterna newexe "${bin}" Etterna # Discord Rich Presence SDK if [[ -f ${S}/extern/discord/lib/release/libdiscord_partner_sdk.so ]]; then doexe "${S}/extern/discord/lib/release/libdiscord_partner_sdk.so" patchelf \ --force-rpath \ --set-rpath '$ORIGIN' \ "${ED}/opt/etterna/Etterna" || die fi if [[ -f ${S}/crashpad_handler ]]; then doexe "${S}/crashpad_handler" fi insinto /opt/etterna for dir in \ Announcers \ Assets \ BackgroundEffects \ BackgroundTransitions \ BGAnimations \ Data \ NoteSkins \ Scripts \ Songs \ Themes; do cp -a "${S}/${dir}" "${T}/Default_${dir}" || die doins -r "${T}/Default_${dir}" done dobin "${FILESDIR}/etterna" newicon \ "${S}/Themes/_fallback/Graphics/Common window icon.png" \ etterna.png make_desktop_entry \ etterna \ Etterna \ etterna \ "Game;ArcadeGame;" } pkg_postinst() { xdg_pkg_postinst elog "Etterna stores user data in ~/.etterna." elog "Default assets are copied from /opt/etterna" elog "to ~/.etterna the first time the launcher is started." } pkg_postrm() { xdg_pkg_postrm }