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 000000000..628d7afb1 Binary files /dev/null and b/appimage/icon-16px.png differ diff --git a/appimage/icon-32px.png b/appimage/icon-32px.png new file mode 100644 index 000000000..c1260ee56 Binary files /dev/null and b/appimage/icon-32px.png differ diff --git a/appimage/duckstation-icon.png b/appimage/icon-48px.png similarity index 100% rename from appimage/duckstation-icon.png rename to appimage/icon-48px.png diff --git a/appimage/icon-64px.png b/appimage/icon-64px.png new file mode 100644 index 000000000..6b73534da Binary files /dev/null and b/appimage/icon-64px.png differ