From 7010cb3306f0fb2e63fd1f52d256ada4c9cfb9e6 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sun, 8 Aug 2021 10:51:17 +0200 Subject: games-emulation/dolphin: Make bundled dep removal less reverse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- .../dolphin/dolphin-5.0_p20210506-r1.ebuild | 19 ++++++++++--------- games-emulation/dolphin/dolphin-9999.ebuild | 17 +++++++++-------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'games-emulation/dolphin') diff --git a/games-emulation/dolphin/dolphin-5.0_p20210506-r1.ebuild b/games-emulation/dolphin/dolphin-5.0_p20210506-r1.ebuild index 835487042033..009f64178fa8 100644 --- a/games-emulation/dolphin/dolphin-5.0_p20210506-r1.ebuild +++ b/games-emulation/dolphin/dolphin-5.0_p20210506-r1.ebuild @@ -78,7 +78,7 @@ src_prepare() { # Remove all the bundled libraries that support system-installed # preference. See CMakeLists.txt for conditional 'add_subdirectory' calls. - local KEEP_SOURCES=( + local keep_sources=( Bochs_disasm FreeSurround @@ -111,16 +111,17 @@ src_prepare() { # No code to detect shared library. zstd ) - local s - for s in "${KEEP_SOURCES[@]}"; do - mv -v "Externals/${s}" . || die - done - einfo "removing sources: $(echo Externals/*)" - rm -r Externals/* || die "Failed to delete Externals dir." - for s in "${KEEP_SOURCES[@]}"; do - mv -v "${s}" "Externals/" || die + local s remove=() + for s in Externals/*; do + [[ -f ${s} ]] && continue + if ! has "${s#Externals/}" "${keep_sources[@]}"; then + remove+=( "${s}" ) + fi done + einfo "removing sources: ${remove[*]}" + rm -r "${remove[@]}" || die + # About 50% compile-time speedup if ! use vulkan; then sed -i -e '/Externals\/glslang/d' CMakeLists.txt || die diff --git a/games-emulation/dolphin/dolphin-9999.ebuild b/games-emulation/dolphin/dolphin-9999.ebuild index c37e6af106c0..28cc6679d931 100644 --- a/games-emulation/dolphin/dolphin-9999.ebuild +++ b/games-emulation/dolphin/dolphin-9999.ebuild @@ -113,16 +113,17 @@ src_prepare() { # This is a stripped-down mGBA for integrated GBA support mGBA ) - local s - for s in "${KEEP_SOURCES[@]}"; do - mv -v "Externals/${s}" . || die - done - einfo "removing sources: $(echo Externals/*)" - rm -r Externals/* || die "Failed to delete Externals dir." - for s in "${KEEP_SOURCES[@]}"; do - mv -v "${s}" "Externals/" || die + local s remove=() + for s in Externals/*; do + [[ -f ${s} ]] && continue + if ! has "${s#Externals/}" "${keep_sources[@]}"; then + remove+=( "${s}" ) + fi done + einfo "removing sources: ${remove[*]}" + rm -r "${remove[@]}" || die + # About 50% compile-time speedup if ! use vulkan; then sed -i -e '/Externals\/glslang/d' CMakeLists.txt || die -- cgit v1.2.3-65-gdbad