From 9c512119a86261ee3e8109e0364a51941617b484 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 20 Aug 2024 21:09:04 +0900 Subject: [PATCH 1/8] SHADPS4: added (missing ES-DE part) --- automation_tools/automation_task_list.cfg | 3 ++ automation_tools/pre_build_automation.sh | 39 ++++++++++++++++++- .../retrodeck/reference_lists/features.json | 9 +++++ net.retrodeck.retrodeck.yml | 16 ++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index 979b5998..3f70fe7e 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -24,3 +24,6 @@ hash^RETRODECKMELONDSLATEST^https://github.com/RetroDECK/net.kuribo64.melonDS/re hash^RETRODECKSOLARUSLATEST^https://github.com/RetroDECK/org.solarus_games.solarus.Launcher/releases/latest/download/RetroDECK-solarus-Artifact.tar.gz hash^RETRODECKGZDOOMLATEST^https://github.com/RetroDECK/org.zdoom.GZDoom/releases/latest/download/RetroDECK-gzdoom-Artifact.tar.gz hash^RETRODECKMAMELATEST^https://github.com/RetroDECK/MAME/releases/latest/download/RetroDECK-MAME-Artifact.tar.gz + +#This will replace RETRODECKSHADPS4LATESTURL with the URL of the latest artifact and RETRODECKSHADPS4LATESTSHA with its SHA256 hash. +latestghaartifact^RETRODECKSHADPS4LATESTURL^RETRODECKSHADPS4LATESTSHA^https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml^shadps4-linux-qt diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index c05a9879..dd8d63fd 100755 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -188,8 +188,44 @@ handle_thisrepo() { /bin/sed -i 's^'"$placeholder"'^'"$current_repo_url"'^g' "$rd_manifest" } +# New function to handle the latest artifact from GitHub Actions +handle_latestghaartifact() { + local placeholder_url="$1" + local placeholder_hash="$2" + local workflow_url="$3" + local artifact_name="$4" + + echo "Fetching workflow runs from: $workflow_url" + workflow_runs_url=$(echo "$workflow_url" | sed 's/github.com/api.github.com\/repos/' | sed 's/actions\/workflows\/[^\/]*$/actions\/runs/') + + local runs_data=$(curl -s "$workflow_runs_url") + local latest_run_url=$(echo "$runs_data" | jq -r ".workflow_runs[0].artifacts_url") + + if [[ -z "$latest_run_url" ]]; then + echo "Error: No workflow runs found" + exit 1 + fi + + echo "Fetching artifacts from the latest run: $latest_run_url" + local artifacts_data=$(curl -s "$latest_run_url") + local artifact_url=$(echo "$artifacts_data" | jq -r ".artifacts[] | select(.name == \"$artifact_name\").archive_download_url") + + if [[ -z "$artifact_url" ]]; then + echo "Error: No artifact found with name $artifact_name" + exit 1 + fi + + echo "Downloading the artifact to calculate the hash..." + local artifact_hash=$(curl -sL "$artifact_url" | sha256sum | cut -d ' ' -f1) + + echo "Replacing placeholder $placeholder_url with artifact URL $artifact_url" + echo "Replacing placeholder $placeholder_hash with artifact hash $artifact_hash" + /bin/sed -i 's^'"$placeholder_url"'^'"$artifact_url"'^g' "$rd_manifest" + /bin/sed -i 's^'"$placeholder_hash"'^'"$artifact_hash"'^g' "$rd_manifest" +} + # Process the task list -while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do +while IFS="^" read -r action placeholder url branch artifact_name || [[ -n "$action" ]]; do if [[ ! "$action" == "#"* ]] && [[ -n "$action" ]]; then case "$action" in "branch" ) handle_branch "$placeholder" ;; @@ -203,6 +239,7 @@ while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do "custom_command" ) handle_custom_command "$url" ;; "url" ) handle_url "$placeholder" "$url" ;; "THISREPO" ) handle_thisrepo "$placeholder" ;; + "latestghaartifact" ) handle_latestghaartifact "$placeholder" "$branch" "$url" "$artifact_name" ;; esac fi done < "$automation_task_list" diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index 619b0077..fac71c95 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -627,6 +627,9 @@ "ps3": { "name": "Sony PlayStation 3" }, + "ps4": { + "name": "Sony PlayStation 4" + }, "psp": { "name": "Sony PlayStation Portable" }, @@ -1092,6 +1095,12 @@ "name": "xemu", "system": "xbox", "launch": "xemu" + }, + "shadps4" : { + "description": "PS4 Emulator for Linux", + "name": "shadps4", + "system": "ps4", + "launch": "shadps4-qt" } } } diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 24ea13a4..7202b111 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -524,6 +524,22 @@ modules: url: https://github.com/RetroDECK/MAME/releases/latest/download/RetroDECK-MAME-Artifact.tar.gz sha256: RETRODECKMAMELATEST + # SHADPS4 + + - name: shadps4 + buildsystem: simple + build-commands: + - unzip shadps4-linux-qt.zip + - chmod +x *.AppImage + - ./*.AppImage --appimage-extract + - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" + - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" + - cp -r squashfs-root/usr/* "${FLATPAK_DEST}/" + sources: + - type: file + url: RETRODECKSHADPS4LATESTURL + sha256: RETRODECKSHADPS4LATESTSHA + # ES-DE - name: ES-DE From 496b387169b4cc125ae7a1acb5ef48d9034644a7 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 20 Aug 2024 21:31:16 +0900 Subject: [PATCH 2/8] SHADPS4: poiting to the feat for ES-DE --- net.retrodeck.retrodeck.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 7202b111..6c67b9a4 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -552,8 +552,10 @@ modules: - chmod +x "${FLATPAK_DEST}/bin/"* sources: - type: archive - url: https://github.com/RetroDECK/ES-DE/releases/latest/download/RetroDECK-ES-DE-Artifact.tar.gz - sha256: RETRODECKESDELATEST + url: https://github.com/RetroDECK/ES-DE/releases/download/feat%2Fshadps4-200824.04/RetroDECK-ES-DE-Artifact.tar.gz + sha256: 3aa0334b4542ca4ca36c15f8b583d3c0075a7a894d765cbb8da1670a5a1f637f + #url: https://github.com/RetroDECK/ES-DE/releases/latest/download/RetroDECK-ES-DE-Artifact.tar.gz + #sha256: RETRODECKESDELATEST - name: retrodeck-theme buildsystem: simple From 48450f84bdd2a359e07813c79ccd6d247de28d4b Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 21 Aug 2024 16:02:02 +0900 Subject: [PATCH 3/8] SHADPS4: pointing to the latest release as the workflow cannot be reached by a non authorized user --- automation_tools/automation_task_list.cfg | 1 + net.retrodeck.retrodeck.yml | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index 3f70fe7e..bfe81617 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -24,6 +24,7 @@ hash^RETRODECKMELONDSLATEST^https://github.com/RetroDECK/net.kuribo64.melonDS/re hash^RETRODECKSOLARUSLATEST^https://github.com/RetroDECK/org.solarus_games.solarus.Launcher/releases/latest/download/RetroDECK-solarus-Artifact.tar.gz hash^RETRODECKGZDOOMLATEST^https://github.com/RetroDECK/org.zdoom.GZDoom/releases/latest/download/RetroDECK-gzdoom-Artifact.tar.gz hash^RETRODECKMAMELATEST^https://github.com/RetroDECK/MAME/releases/latest/download/RetroDECK-MAME-Artifact.tar.gz +hash^RETRODECKSHADPS4LATESTSTABLE^https://github.com/shadps4-emu/shadPS4/releases/latest/download/shadps4-linux-qt.zip #This will replace RETRODECKSHADPS4LATESTURL with the URL of the latest artifact and RETRODECKSHADPS4LATESTSHA with its SHA256 hash. latestghaartifact^RETRODECKSHADPS4LATESTURL^RETRODECKSHADPS4LATESTSHA^https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml^shadps4-linux-qt diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 6c67b9a4..1d9e0403 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -529,16 +529,15 @@ modules: - name: shadps4 buildsystem: simple build-commands: - - unzip shadps4-linux-qt.zip - chmod +x *.AppImage - ./*.AppImage --appimage-extract - mkdir -p "${FLATPAK_DEST}/retrodeck/tmplib" "${FLATPAK_DEST}/retrodeck/tmplib/debug" - mv "squashfs-root/usr/lib/"* "${FLATPAK_DEST}/retrodeck/tmplib" - cp -r squashfs-root/usr/* "${FLATPAK_DEST}/" sources: - - type: file - url: RETRODECKSHADPS4LATESTURL - sha256: RETRODECKSHADPS4LATESTSHA + - type: archive + url: https://github.com/shadps4-emu/shadPS4/releases/latest/download/shadps4-linux-qt.zip + sha256: RETRODECKSHADPS4LATESTSTABLE # ES-DE From 1fdd934d23bf52617c6643577f24d609fc57230c Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 21 Aug 2024 16:50:58 +0900 Subject: [PATCH 4/8] SHADPS4: pointing to the latest release as the workflow cannot be reached by a non authorized user -fix --- automation_tools/automation_task_list.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index bfe81617..a86dac82 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -27,4 +27,4 @@ hash^RETRODECKMAMELATEST^https://github.com/RetroDECK/MAME/releases/latest/downl hash^RETRODECKSHADPS4LATESTSTABLE^https://github.com/shadps4-emu/shadPS4/releases/latest/download/shadps4-linux-qt.zip #This will replace RETRODECKSHADPS4LATESTURL with the URL of the latest artifact and RETRODECKSHADPS4LATESTSHA with its SHA256 hash. -latestghaartifact^RETRODECKSHADPS4LATESTURL^RETRODECKSHADPS4LATESTSHA^https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml^shadps4-linux-qt +#latestghaartifact^RETRODECKSHADPS4LATESTURL^RETRODECKSHADPS4LATESTSHA^https://github.com/shadps4-emu/shadPS4/actions/workflows/linux-qt.yml^shadps4-linux-qt From bea9660228f1d9e900606f2544b8593e1dfabaf2 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 22 Aug 2024 15:59:58 +0900 Subject: [PATCH 5/8] Triggering build From 1b81786d074624653adbd6febb6e618faee0bf6e Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 22 Aug 2024 16:25:22 +0900 Subject: [PATCH 6/8] Triggering build From 5bf713534c32d4119e90218835488a83a3dd9e24 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Fri, 23 Aug 2024 23:34:04 +0900 Subject: [PATCH 7/8] SHADPS4: added post_update reset and a placeholder resett function [skip ci] --- functions/post_update.sh | 1 + functions/prepare_component.sh | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/functions/post_update.sh b/functions/post_update.sh index 146a8d10..5c8c12f3 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -378,6 +378,7 @@ post_update() { # Placeholder for version 0.9.0b set_setting_value "$raconf" "libretro_info_path" "/var/config/retroarch/cores" "retroarch" + prepare_component "reset" "shadps4" # TODO: check this # rm /var/config/emulationstation/.emulationstation # remving the old symlink to .emulationstation as it might be not needed anymore diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 137a5bbe..5c41b644 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -857,6 +857,17 @@ prepare_component() { sed -i 's#RETRODECKSAVESDIR#'$saves_folder'#g' "/var/config/gzdoom/gzdoom.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON fi + if [[ "$component" =~ ^(gzdoom|all)$ ]]; then + component_found="true" + # This is just a placeholder script to test the emulator's flow + log i "----------------------" + log i "Prepearing SHADPS4" + log i "----------------------" + + # TODO: plceholder + + fi + if [[ $component_found == "false" ]]; then log e "Supplied component $component not found, not resetting" fi From 9b6b8d1c059d90850eb28f56155534c12c7787a0 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Sun, 1 Sep 2024 09:04:33 +0900 Subject: [PATCH 8/8] Triggering build