# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit git-r3 cmake

DESCRIPTION="Tool for automatic PS5 executables porting to Linux"
HOMEPAGE="https://github.com/boykopovar/AnyPS5"
EGIT_REPO_URI="https://github.com/boykopovar/AnyPS5.git"
EGIT_SUBMODULES=('*')

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""

RESTRICT="strip"

src_compile() {
	cmake_src_compile
	cmake_build libs
}

src_install() {
	src_install() {
		dobin "${BUILD_DIR}/core/relinker/relinker"

		exeinto /usr/lib/anyps5/libs
		doexe "${BUILD_DIR}"/core/libs/libs/*.prx
	}
}

pkg_postinst() {
	elog "In order to convert a executable link, you can do"
	elog " relinker --rpath /usr/lib/anyps5/libs input.elf output.elf"
}