diff --git a/grout/component_functions.sh b/grout/component_functions.sh new file mode 100755 index 00000000..786be77e --- /dev/null +++ b/grout/component_functions.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# TODO + +_prepare_component::grout() { + local action="$1" + shift + + local component_config="$(get_own_component_path)/rd_config" + + case "$action" in + + reset) + log i "----------------------" + log i "Resetting Grout" + log i "----------------------" + + create_dir "$XDG_CONFIG_HOME/grout" + ;; + + esac +} + +_post_update::grout() { + local previous_version="$1" + +} + +_post_update_legacy::grout() { + # This function is to cover users upgrading from prior to 0.11.0, when per-component versioning was introduced. It can be removed once we are confident all users are running 0.11.0 or higher + + local previous_version="$1" + + if check_version_is_older_than "$previous_version" "0.10.0b"; then + # In version 0.10.0b, the following changes were made that required config file updates/reset or other changes to the filesystem: + # - Init GROUT as it is a new emulator + + log i "0.10.0b Upgrade - Reset: GROUT" + + prepare_component "reset" "grout" + fi +} diff --git a/grout/component_launcher.sh b/grout/component_launcher.sh new file mode 100755 index 00000000..3ecfeb6c --- /dev/null +++ b/grout/component_launcher.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +source /app/libexec/launcher_functions.sh + +# Setting component name and path based on the directory name +component_name="$(basename "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" +component_path="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)" + +export LD_LIBRARY_PATH="$component_path/lib:$rd_shared_libs/org.gnome.Platform/49/:${DEFAULT_LD_LIBRARY_PATH}" + +# Set plugin paths + +log i "RetroDECK is now launching $component_name" +log d "Library path is: $LD_LIBRARY_PATH" + +exec "$component_path/Grout.sh" "$@" diff --git a/grout/component_manifest.json b/grout/component_manifest.json new file mode 100644 index 00000000..1203d622 --- /dev/null +++ b/grout/component_manifest.json @@ -0,0 +1,20 @@ +{ + "grout": { + "name": "GROUT", + "core_framework_compatibility": "1", + "component_version": "0.3", + "capabilities": ["reset","open"], + "url_rdwiki": "https://retrodeck.readthedocs.io/en/latest/wiki_tool_guides/grout/grout-guide/", + "url_webpage": "https://grout.romm.app", + "url_donation_purchase": "https://ko-fi.com/kwallbmoc", + "url_source": "https://github.com/rommapp/grout", + "description": "A RomM Client for your Linux retro handheld.", + "component_type": "Tool", + "system_friendly_name": "GROUT", + "backup_data": { + "core": [ + {"path": "$XDG_CONFIG_HOME/grout"} + ] + } + } +} diff --git a/grout/component_recipe.json b/grout/component_recipe.json new file mode 100755 index 00000000..9d58d6ff --- /dev/null +++ b/grout/component_recipe.json @@ -0,0 +1,47 @@ +{ + "grout": [ + { + "source_url": "$REPO_ROOT/$COMPONENT_NAME/tmp_assets/Grout-RetroDECK.zip", + "source_type": "local", + "extraction_type": "archive", + "assets": [ + { + "type": "create", + "dest": "component_version", + "contents": "$FRAMEWORK_DESIRED_VERSION" + }, + { + "type": "file", + "source": "$REPO_ROOT/$COMPONENT_NAME/component_functions.sh", + "dest": "$COMPONENT_ARTIFACT_ROOT" + }, + { + "type": "file", + "source": "$REPO_ROOT/$COMPONENT_NAME/component_launcher.sh", + "dest": "$COMPONENT_ARTIFACT_ROOT" + }, + { + "type": "file", + "source": "$REPO_ROOT/$COMPONENT_NAME/component_manifest.json", + "dest": "$COMPONENT_ARTIFACT_ROOT" + }, + { + "type": "file", + "source": "$REPO_ROOT/$COMPONENT_NAME/component_recipe.json", + "dest": "$COMPONENT_ARTIFACT_ROOT" + }, + { + "type": "dir", + "source": "Grout", + "dest": "$COMPONENT_ARTIFACT_ROOT/Grout" + }, + { + "type": "file", + "source": "Grout.sh", + "dest": "$COMPONENT_ARTIFACT_ROOT" + } + ], + "libs": [] + } + ] +} diff --git a/grout/tmp_assets/Grout-RetroDECK.zip b/grout/tmp_assets/Grout-RetroDECK.zip new file mode 100644 index 00000000..2f66e7a1 Binary files /dev/null and b/grout/tmp_assets/Grout-RetroDECK.zip differ