From f8aac040f67e4871a9e99a2877d3105d4d5fe548 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Fri, 7 Apr 2023 16:10:12 -0400 Subject: [PATCH] SHA update tool for automation during building and also prepackage DOOOOOM! --- automation_tools/sha_update_list.cfg | 1 + automation_tools/update_sha.sh | 13 +++++++++++++ functions.sh | 3 +++ net.retrodeck.retrodeck.yml | 10 ++++++++++ post_update.sh | 3 +++ 5 files changed, 30 insertions(+) create mode 100644 automation_tools/sha_update_list.cfg create mode 100644 automation_tools/update_sha.sh diff --git a/automation_tools/sha_update_list.cfg b/automation_tools/sha_update_list.cfg new file mode 100644 index 00000000..e3d13efe --- /dev/null +++ b/automation_tools/sha_update_list.cfg @@ -0,0 +1 @@ +https://buildbot.libretro.com/assets/cores/DOOM/Doom%20%28Shareware%29.zip,DOOMSHAPLACEHOLDER \ No newline at end of file diff --git a/automation_tools/update_sha.sh b/automation_tools/update_sha.sh new file mode 100644 index 00000000..ae3af0e9 --- /dev/null +++ b/automation_tools/update_sha.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# For the file paths to work correctly, call this script with this command from the cloned repo folder root: +# sh automation_tools/update_sha.sh + +rd_manifest=net.retrodeck.retrodeck.yml +sha_update_list=automation_tools/sha_to_update.cfg + +while IFS="," read -r url placeholder +do + hash=$(curl -sL "$url" | sha256sum | cut -d ' ' -f1) + sed -i 's^'"$placeholder"'^'"$hash"'^' $rd_manifest +done < $sha_update_list \ No newline at end of file diff --git a/functions.sh b/functions.sh index 81765116..ec63d828 100644 --- a/functions.sh +++ b/functions.sh @@ -1898,6 +1898,9 @@ finit() { dir_prep "$roms_folder/pico8" "$bios_folder/pico-8/carts" # Symlink default game location to RD roms for cleanliness (this location is overridden anyway by the --root_path launch argument anyway) dir_prep "$saves_folder/pico-8" "$bios_folder/pico-8/cdata" # PICO-8 saves folder + # Add packaged extras, after the ROMS folder has been initialized + cp /app/retrodeck/extras/doom1.wad "$roms_folder/doom/doom1.wad" # No -f in case the user already has it + ra_init standalones_init ) | diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index f58238eb..390f4652 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -422,6 +422,16 @@ modules: url: https://buildbot.libretro.com/stable/1.15.0/linux/x86_64/RetroArch_cores.7z sha256: 2230bc38eaf87406efd0c2b7bdd1cf9e813ba113505600f14a7ef9eb06f8c7c0 + - name: doom-shareware + buildsystem: simple + build-commands: + - mkdir -p ${FLATPAK_DEST}/retrodeck/extras + - cp doom1.wad ${FLATPAK_DEST}/retrodeck/extras/ + sources: + - type: archive + url: https://buildbot.libretro.com/assets/cores/DOOM/Doom%20%28Shareware%29.zip + sha256: DOOMSHAPLACEHOLDER + # PPSSPP - START # https://github.com/flathub/org.ppsspp.PPSSPP diff --git a/post_update.sh b/post_update.sh index ef529153..e6dc455c 100644 --- a/post_update.sh +++ b/post_update.sh @@ -72,6 +72,7 @@ post_update() { # - New ~/retrodeck/mods and ~/retrodeck/texture_packs directories are added and symlinked to multiple different emulators (where supported) # - Expose ES-DE gamelists folder to user at ~/retrodeck/gamelists # - Add new sections [paths] and [options] headers to retrodeck.cfg + # - Prepackaged DOOM! mkdir -p "$mods_folder" mkdir -p "$texture_packs_folder" @@ -88,6 +89,8 @@ post_update() { sed -i '/version=.*/G' $rd_conf sed -i '3i [paths]' $rd_conf sed -i '/^power_user=.*/i [options]' $rd_conf + + cp /app/retrodeck/extras/doom1.wad "$roms_folder/doom/doom1.wad" # No -f in case the user already has it fi # The following commands are run every time.