Added UBPorts build support

This commit is contained in:
Paul Black 2022-03-16 10:31:56 -06:00
parent e97336cfed
commit bd24ea0f59
10 changed files with 160 additions and 0 deletions

76
build-ubports.sh Executable file
View file

@ -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

BIN
click/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

15
click/manifest.json Normal file
View file

@ -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 <alesvinciguerra@gmail.com>",
"name": "tanks.arc676",
"title": "Tanks",
"version": "1.0.0"
}

7
click/tanks.apparmor Normal file
View file

@ -0,0 +1,7 @@
{
"policy_groups": [
"audio",
"keep-display-on"
],
"policy_version": 16.04
}

9
click/tanks.desktop Normal file
View file

@ -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

29
clickable.json Normal file
View file

@ -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*"
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

24
export_presets.cfg Normal file
View file

@ -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