diff --git a/build-ubports.sh b/build-ubports.sh new file mode 100755 index 0000000..af916ec --- /dev/null +++ b/build-ubports.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +BUILD_DIR=$PWD +CACHE_DIR=$PWD/../.godot-ubports +ARCH='arm64' + +# The latest build can always be obtained from this URL +URL_LATEST=https://gitlab.com/abmyii/ubports-godot/-/jobs/1808536472/artifacts/download + +# Determine the ID of the latest successful pipeline +function getNewestVersion() { + wget -qO - https://gitlab.com/api/v4/projects/23065313/pipelines?status=success | tr ',' '\n' | grep id | head -n 1 | cut -d ':' -f 2 > newest +} + +# Download a build +function download() { + # Accept job ID as single argument + if [ $# = 1 ]; then + # Check if the most recently downloaded build for this architecture is from the same pipeline + if [ -f $1.* ]; then + echo "Already downloaded artifacts from from job $1. Using cached files." + else + # Download requested build and update version indicator + wget https://gitlab.com/api/v4/projects/23065313/jobs/$1/artifacts -O temp.zip + DOWNLOADED=`unzip -Z -1 temp.zip` + DOWNLOADED=${DOWNLOADED##*.} + rm -f *.$DOWNLOADED + touch "$1.$DOWNLOADED" + echo "Downloaded build for $DOWNLOADED from job $JOB." + unzip -o temp.zip + rm temp.zip + fi + # If no argument given, download latest build + else + echo "Removing references to other builds..." + rm -f *.${ARCH} + echo "Downloading latest build..." + wget $URL_LATEST -O temp.zip + unzip -o temp.zip + rm temp.zip + fi +} + +# Store everything in a separate cache directory +mkdir -p "$CACHE_DIR" +cd "$CACHE_DIR" + +# If single argument given, download from that pipeline +if [ $# = 1 ]; then + wget -qO - https://gitlab.com/api/v4/projects/23065313/pipelines/$1/jobs | tr ',' '\n' | grep -E -e "^\W+id" | sed -e 's/[^0-9]//g' | while read JOB; do + echo "Downloading artifacts from job $JOB in pipeline $1..." + download $JOB + done +# If nothing has been downloaded before, download newest build +elif [ ! -f "local-version.${ARCH}" ]; then + echo "No local copy found." + getNewestVersion + download + mv newest local-version.${ARCH} +# Otherwise, check if there's a newer version available +else + getNewestVersion + diff newest local-version.${ARCH} > /dev/null + if [ $? = 0 ]; then + echo "No newer version to download. Using cached build." + rm newest + else + echo "Newer version available." + download + mv newest local-version.${ARCH} + fi +fi + +# Copy Godot executable to build directory +cd "$BUILD_DIR" +cp "$CACHE_DIR"/godot.ubports.${ARCH} godot diff --git a/click/icon.png b/click/icon.png new file mode 100644 index 0000000..e1cf2a6 Binary files /dev/null and b/click/icon.png differ diff --git a/click/manifest.json b/click/manifest.json new file mode 100644 index 0000000..c702914 --- /dev/null +++ b/click/manifest.json @@ -0,0 +1,15 @@ +{ + "architecture": "@CLICK_ARCH@", + "description": "Tank combat game built with Godot based on a flash game of the same name", + "framework": "ubuntu-sdk-16.04.5", + "hooks": { + "tanks": { + "apparmor": "tanks.apparmor", + "desktop": "tanks.desktop" + } + }, + "maintainer": "Arc676/Alessandro Vinciguerra ", + "name": "tanks.arc676", + "title": "Tanks", + "version": "1.0.0" +} diff --git a/click/tanks.apparmor b/click/tanks.apparmor new file mode 100644 index 0000000..ced97c4 --- /dev/null +++ b/click/tanks.apparmor @@ -0,0 +1,7 @@ +{ + "policy_groups": [ + "audio", + "keep-display-on" + ], + "policy_version": 16.04 +} diff --git a/click/tanks.desktop b/click/tanks.desktop new file mode 100644 index 0000000..d98ce5d --- /dev/null +++ b/click/tanks.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Tanks +Comment=Tank combat game built with Godot based on a flash game of the same name +Exec=godot --main-pack tanks.pck +Icon=icon.png +Terminal=false +Type=Application +X-Ubuntu-Touch=true +X-Ubuntu-Supported-Orientations=landscape diff --git a/clickable.json b/clickable.json new file mode 100644 index 0000000..f20b3f1 --- /dev/null +++ b/clickable.json @@ -0,0 +1,29 @@ +{ + "clickable_minimum_required": "6.17.1", + "kill": "Tank Blaster", + "builder": "custom", + "build": "${ROOT}/build-ubports.sh", + "build_dir": "${ROOT}/build", + "dependencies_host": [ + "wget" + ], + "dependencies_target": [ + "libvpx3", + "libsdl2-2.0-0", + "libasound2", + "libglib2.0-0", + "libpng16-16", + "libfreetype6" + ], + "install_data": { + "${BUILD_DIR}/godot": "${INSTALL_DIR}", + "${ROOT}/click/*": "${INSTALL_DIR}", + "${ROOT}/export/PCK/Tank-blaster.pck": "${INSTALL_DIR}" + }, + "install_lib": [ + "/usr/lib/${ARCH_TRIPLET}/libvpx.so.3*", + "/usr/lib/${ARCH_TRIPLET}/libsndio.so.6.1", + "/usr/lib/${ARCH_TRIPLET}/libvorbis.so.0*", + "/usr/lib/${ARCH_TRIPLET}/libSDL2-2.0.so*" + ] +} diff --git a/export/Tank-blaster.pck b/export/Tank-blaster.pck deleted file mode 100644 index c4f7883..0000000 Binary files a/export/Tank-blaster.pck and /dev/null differ diff --git a/export/Tank-blaster.x86_64 b/export/Tank-blaster.x86_64 deleted file mode 100755 index be71c1b..0000000 Binary files a/export/Tank-blaster.x86_64 and /dev/null differ diff --git a/export/libgitapi.so b/export/libgitapi.so deleted file mode 100644 index 30876b5..0000000 Binary files a/export/libgitapi.so and /dev/null differ diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..1f143ad --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,24 @@ +[preset.0] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="export/Tank-blaster.x86_64" +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true