2023-11-30 15:15:31 +00:00
#!/bin/bash
2024-03-08 19:36:39 +00:00
# WARNING: run this script from the project root folder, not from here!!
2024-03-08 19:31:38 +00:00
2025-01-15 01:10:28 +00:00
# Check if ccache is installed
if ! command -v ccache & > /dev/null; then
echo "Compiler cache (ccache) is not installed. Install it to be able to use the cache and speed up your builds"
else
read -rp "Do you want to use ccache? If you're unsure just say no [Y/n] " use_ccache_input
use_ccache_input = ${ use_ccache_input :- Y }
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
2024-07-12 23:47:29 +00:00
2025-01-09 01:31:53 +00:00
read -rp "Do you want to use the hashes cache? If you're unsure just say no [Y/n] " use_cache_input
2025-01-09 00:45:59 +00:00
use_cache_input = ${ use_cache_input :- Y }
if [ [ " $use_cache_input " = ~ ^[ Yy] $ ] ] ; then
export use_cache = "true"
else
export use_cache = "false"
2025-01-09 00:49:47 +00:00
rm -f "placeholders.cache"
2025-01-09 00:45:59 +00:00
fi
2025-01-09 01:31:53 +00:00
echo "Do you want to clear the build cache?"
read -rp "Keeping the build cache can speed up the build process, but it might cause issues and should be cleared occasionally [y/N] " clear_cache_input
2025-01-09 01:17:40 +00:00
clear_cache_input = ${ clear_cache_input :- N }
if [ [ " $clear_cache_input " = ~ ^[ Yy] $ ] ] ; then
# User chose to clear the build cache
echo "Clearing build cache..."
rm -rf "retrodeck-repo" "retrodeck-flatpak-cooker" ".flatpak-builder"
fi
2024-03-06 07:24:34 +00:00
git submodule update --init --recursive
2023-11-30 15:15:31 +00:00
export GITHUB_WORKSPACE = "."
2024-07-12 08:02:56 +00:00
# Initialize the Flatpak repo
ostree init --mode= archive-z2 --repo= ${ GITHUB_WORKSPACE } /retrodeck-repo
2024-12-11 05:53:38 +00:00
# Backing up original manifest
2025-01-30 04:36:33 +00:00
cp net.retrodeck.retrodeck.metainfo.xml net.retrodeck.retrodeck.metainfo.xml.bak
2023-11-30 16:04:21 +00:00
cp net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml.bak
2023-11-30 15:15:31 +00:00
automation_tools/install_dependencies.sh
automation_tools/cooker_build_id.sh
2025-01-09 00:45:59 +00:00
automation_tools/manifest_placeholder_replacer.sh
2023-11-30 15:15:31 +00:00
automation_tools/cooker_flatpak_portal_add.sh
2024-07-12 08:26:45 +00:00
# THIS SCRIPT IS BROKEN HENCE DISABLED FTM
2025-01-30 04:36:33 +00:00
# automation_tools/metainfo_management.sh
2023-11-30 15:15:31 +00:00
automation_tools/flatpak_build_download_only.sh
2024-12-11 05:53:38 +00:00
automation_tools/flatpak_build_only.sh " ${ @ } "
2023-11-30 15:15:31 +00:00
automation_tools/flatpak_build_bundle.sh
2025-01-30 04:36:33 +00:00
mv -f net.retrodeck.retrodeck.metainfo.xml.bak net.retrodeck.retrodeck.metainfo.xml
2025-01-15 01:10:28 +00:00
mv -f net.retrodeck.retrodeck.yml.bak net.retrodeck.retrodeck.yml