--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- katawa-shoujo-1.2.ebuild +++ katawa-shoujo-1.2.ebuild @@ -17,6 +17,8 @@ KEYWORDS="~amd64 ~x86" IUSE="doc system-renpy" +DEPEND="dev-util/patchelf" + # make system-renpy optional due to #459742 :( RDEPEND="system-renpy? ( games-engines/renpy ) !system-renpy? ( @@ -30,6 +32,18 @@ S="${WORKDIR}/Katawa Shoujo-linux-x86" +src_prepare() { + # Set RPATH for preserve-libs handling (bug #528086). + local x + while read -r x ; do + # Use \x7fELF header to separate ELF executables and libraries + [[ $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] || continue + patchelf --set-rpath \ + "${EPREFIX}${GAMES_PREFIX_OPT}/${PN}/lib" "${x}" || \ + die "patchelf failed on ${x}" + done < <(find . -type f) +} + src_install() { if use system-renpy ; then insinto "${GAMES_DATADIR}/${PN}"