From a2a9bd16faf7f0f9a2a1cd25238ab29c33bb0336 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Mon, 13 Apr 2020 21:22:32 -0700 Subject: [PATCH] AppImage: Add script for generating AppImages with desktop integration --- appimage/duckstation-qt.desktop | 10 +++ appimage/duckstation-sdl.desktop | 10 +++ appimage/generate-appimages.sh | 63 ++++++++++++++++++ appimage/icon-16px.png | Bin 0 -> 643 bytes appimage/icon-32px.png | Bin 0 -> 1389 bytes .../{duckstation-icon.png => icon-48px.png} | Bin appimage/icon-64px.png | Bin 0 -> 3115 bytes 7 files changed, 83 insertions(+) create mode 100644 appimage/duckstation-qt.desktop create mode 100644 appimage/duckstation-sdl.desktop create mode 100755 appimage/generate-appimages.sh create mode 100644 appimage/icon-16px.png create mode 100644 appimage/icon-32px.png rename appimage/{duckstation-icon.png => icon-48px.png} (100%) create mode 100644 appimage/icon-64px.png diff --git a/appimage/duckstation-qt.desktop b/appimage/duckstation-qt.desktop new file mode 100644 index 000000000..e1dfea5f3 --- /dev/null +++ b/appimage/duckstation-qt.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=DuckStation Qt +GenericName=PlayStation 1 Emulator +Comment=Fast-ish PlayStation 1 emulator +Icon=duckstation-qt +TryExec=duckstation-qt +Exec=duckstation-qt %f +Terminal=true +Categories=Game;Emulator;Qt; diff --git a/appimage/duckstation-sdl.desktop b/appimage/duckstation-sdl.desktop new file mode 100644 index 000000000..6c5983bd4 --- /dev/null +++ b/appimage/duckstation-sdl.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=DuckStation SDL +GenericName=PlayStation 1 Emulator +Comment=Fast-ish PlayStation 1 emulator +Icon=duckstation-sdl +TryExec=duckstation-sdl +Exec=duckstation-sdl %f +Terminal=true +Categories=Game;Emulator; diff --git a/appimage/generate-appimages.sh b/appimage/generate-appimages.sh new file mode 100755 index 000000000..d3cfc31fa --- /dev/null +++ b/appimage/generate-appimages.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +function get_tools_and_plugins() { + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + chmod a+x linuxdeploy-x86_64.AppImage + wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage + chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage +} + +# NOTE: Keep this script in the same directory as resources for AppImage creation +APPIMAGE_RESOURCES_DIR=$(dirname $(readlink -f $0)) +echo "APPIMAGE_RESOURCES_DIR set to ${APPIMAGE_RESOURCES_DIR}" + +if [[ "$#" -ne 1 ]]; then + echo "Wrong number of arguments (\$# = $# args) provided." + echo "Usage: create-appimage.sh " + exit 1 +else + BUILD_DIR=$1 + echo "BUILD_DIR set to ${BUILD_DIR}" +fi + +# Acquire linuxdeploy and linuxdeploy-plugin-qt +get_tools_and_plugins + +# Copy icons into the /. directory structure that linuxdeploy nominally expects, +# e.g. 16x16/duckstation-qt.png, 32x32/duckstation-qt.png, etc. +FRONTENDS=("qt" "sdl") +ICONS_QT=() +ICONS_SDL=() + +ICON_PNG_RESOLUTIONS=($(seq 16 16 64)) # 16, 32, 48, 64 +for res in ${ICON_PNG_RESOLUTIONS[@]}; do + mkdir -p ${BUILD_DIR}/AppImage-icons/${res}x${res} + for frontend in ${FRONTENDS[@]}; do + # Copy icon to proper directory + cp ${APPIMAGE_RESOURCES_DIR}/icon-${res}px.png ${BUILD_DIR}/AppImage-icons/${res}x${res}/duckstation-${frontend}.png + # Append icon filepath to array that will later be passed to linuxdeploy + eval "ICONS_${frontend^^}+=(${BUILD_DIR}/AppImage-icons/${res}x${res}/duckstation-${frontend}.png)" + done +done + +# Outputted file from linuxdeploy is named based on the .desktop file Name key; +# We rename it to something generic that buildbot or CI scripts can modify +# as they wish outside of this script, e.g. to distinguish between Release or +# Debug builds, since we don't have awareness of that inside this script + +./linuxdeploy-x86_64.AppImage --appdir=./AppDir-duckstation-qt \ + --executable=${BUILD_DIR}/src/duckstation-qt/duckstation-qt \ + --desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-qt.desktop \ + ${ICONS_QT[@]/#/--icon-file=} \ + --plugin=qt \ + --output=appimage \ + && mv DuckStation_Qt*.AppImage duckstation-qt-x64.AppImage + +./linuxdeploy-x86_64.AppImage --appdir=./AppDir-duckstation-sdl \ + --executable=${BUILD_DIR}/src/duckstation-sdl/duckstation-sdl \ + --desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-sdl.desktop \ + ${ICONS_SDL[@]/#/--icon-file=} \ + --output=appimage \ + && mv DuckStation_SDL*.AppImage duckstation-sdl-x64.AppImage + +# Resulting AppImage files will be located in the directory this script is called from diff --git a/appimage/icon-16px.png b/appimage/icon-16px.png new file mode 100644 index 0000000000000000000000000000000000000000..628d7afb186531bcb05e475f5a281589fa831215 GIT binary patch literal 643 zcmV-}0(||6P)o7fp;4 z660VP*l=e&!L5W0B+E5g$NT9TN?V~*Cd%X_O0;Oj<_nhDT z&ON^?*c0*tM@1Ja<#PlVDnoz|hf#46i;7T6i9JCSlO-8p6hOYE7nRSz6W}2#arvHG zl>kvnj6p1|6H{;FM_~?23)6?(?eC}yIJ^*77&!2PT9pw@R)MgZ;?loKgp&gbz!u<; zBZFX*;9jN+V10yorH8A!N;4KH0=#)xd;|VQINSze9p6k!!PYc4Z0`5KlOddma!zK+ zu`|{00=Ix{5?24fw`Gm!f{yMkI#o^dtm64OfzODMN1+H1(zbiAXAfa+s0<%jrzKJ7 zltXkK0MsZ@tHRnWp5Jj4yAjh<1G)k?+bsgq7WO9~Mu05ON4DQ(qOP$;E} zekfKcS`BTrg`!juv5HzKRuQp_f?pKHY8%@R8l@&_W1uZ!*U%+o(lwdMIy0GO)_46d znK+YW@)G)o3-4XdJ?F={=bZQ8E=V@9P`0paHfNP7oi?*dHc>E5V5e+h7b<5Ew8-Ne zl`T}v1VBu1+R6iH>;awzh7jx`kIzIE(J>o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