BUILD_LOCALLY: added ccache support

This commit is contained in:
XargonWan 2025-01-15 10:10:28 +09:00
parent 5d68c2e07b
commit e19d4fc16f
2 changed files with 17 additions and 9 deletions

View file

@ -23,7 +23,7 @@ command="flatpak-builder --user --force-clean $FLATPAK_BUILD_EXTRA_ARGS \
--install-deps-from=flathub \ --install-deps-from=flathub \
--install-deps-from=flathub-beta \ --install-deps-from=flathub-beta \
--repo=${GITHUB_WORKSPACE}/retrodeck-repo \ --repo=${GITHUB_WORKSPACE}/retrodeck-repo \
--disable-download \ --disable-download $FLATPAK_BUILDER_CCACHE\
\"${GITHUB_WORKSPACE}/$FOLDER\" \ \"${GITHUB_WORKSPACE}/$FOLDER\" \
net.retrodeck.retrodeck.yml" net.retrodeck.retrodeck.yml"

View file

@ -2,13 +2,21 @@
# WARNING: run this script from the project root folder, not from here!! # WARNING: run this script from the project root folder, not from here!!
# Check if script is running with elevated privileges # Check if ccache is installed
# if [ "$EUID" -ne 0 ]; then if ! command -v ccache &> /dev/null; then
# read -rp "The build might fail without some superuser permissions, please run me with sudo. Continue WITHOUT sudo (not suggested)? [y/N] " continue_without_sudo echo "Compiler cache (ccache) is not installed. Install it to be able to use the cache and speed up your builds"
# if [[ "$continue_without_sudo" != "y" ]]; then else
# exit 1 read -rp "Do you want to use ccache? If you're unsure just say no [Y/n] " use_ccache_input
# fi use_ccache_input=${use_ccache_input:-Y}
# fi if [[ "$use_ccache_input" =~ ^[Yy]$ ]]; then
# Use ccache
export CC="ccache gcc"
export CXX="ccache g++"
export FLATPAK_BUILDER_CCACHE="--ccache"
else
echo "Proceeding without ccache"
fi
fi
read -rp "Do you want to use the hashes cache? If you're unsure just say no [Y/n] " use_cache_input read -rp "Do you want to use the hashes cache? If you're unsure just say no [Y/n] " use_cache_input
use_cache_input=${use_cache_input:-Y} use_cache_input=${use_cache_input:-Y}
@ -51,4 +59,4 @@ automation_tools/flatpak_build_only.sh "${@}"
automation_tools/flatpak_build_bundle.sh automation_tools/flatpak_build_bundle.sh
mv -f net.retrodeck.retrodeck.appdata.xml.bak net.retrodeck.retrodeck.appdata.xml mv -f net.retrodeck.retrodeck.appdata.xml.bak net.retrodeck.retrodeck.appdata.xml
mv -f net.retrodeck.retrodeck.yml.bak net.retrodeck.retrodeck.yml mv -f net.retrodeck.retrodeck.yml.bak net.retrodeck.retrodeck.yml