AppImage: Use user-specified build directory for linuxdeploy

This commit is contained in:
Albert Liu 2020-04-14 21:12:13 -07:00
parent a8e224d504
commit 0d84b5b9a2

View file

@ -9,15 +9,18 @@ if [[ "$#" -ne 1 ]]; then
echo "Usage: create-appimage.sh <build_directory_path>" echo "Usage: create-appimage.sh <build_directory_path>"
exit 1 exit 1
else else
BUILD_DIR=$1 BUILD_DIR=$(readlink -f $1)
echo "BUILD_DIR set to ${BUILD_DIR}" echo "BUILD_DIR set to ${BUILD_DIR}"
fi fi
# Acquire linuxdeploy and linuxdeploy-plugin-qt # Acquire linuxdeploy and linuxdeploy-plugin-qt
wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage wget --timestamping --directory-prefix=${BUILD_DIR} \
chmod a+x linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage chmod a+x ${BUILD_DIR}/linuxdeploy-x86_64.AppImage
chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage
wget --timestamping --directory-prefix=${BUILD_DIR} \
https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod a+x ${BUILD_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage
# Copy icons into the <resolution>/<app_name>.<ext> directory structure that linuxdeploy nominally expects, # Copy icons into the <resolution>/<app_name>.<ext> directory structure that linuxdeploy nominally expects,
# e.g. 16x16/duckstation-qt.png, 32x32/duckstation-qt.png, etc. # e.g. 16x16/duckstation-qt.png, 32x32/duckstation-qt.png, etc.
@ -41,19 +44,22 @@ done
# as they wish outside of this script, e.g. to distinguish between Release or # 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 # Debug builds, since we don't have awareness of that inside this script
./linuxdeploy-x86_64.AppImage --appdir=./AppDir-duckstation-qt \ ${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
--appdir=${BUILD_DIR}/AppDir-duckstation-qt \
--executable=${BUILD_DIR}/src/duckstation-qt/duckstation-qt \ --executable=${BUILD_DIR}/src/duckstation-qt/duckstation-qt \
--desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-qt.desktop \ --desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-qt.desktop \
${ICONS_QT[@]/#/--icon-file=} \ ${ICONS_QT[@]/#/--icon-file=} \
--plugin=qt \ --plugin=qt \
--output=appimage \ --output=appimage \
&& mv DuckStation_Qt*.AppImage duckstation-qt-x64.AppImage && mv DuckStation_Qt*.AppImage ${BUILD_DIR}/duckstation-qt-x64.AppImage
./linuxdeploy-x86_64.AppImage --appdir=./AppDir-duckstation-sdl \ ${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
--appdir=${BUILD_DIR}/AppDir-duckstation-sdl \
--executable=${BUILD_DIR}/src/duckstation-sdl/duckstation-sdl \ --executable=${BUILD_DIR}/src/duckstation-sdl/duckstation-sdl \
--desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-sdl.desktop \ --desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-sdl.desktop \
${ICONS_SDL[@]/#/--icon-file=} \ ${ICONS_SDL[@]/#/--icon-file=} \
--output=appimage \ --output=appimage \
&& mv DuckStation_SDL*.AppImage duckstation-sdl-x64.AppImage && mv DuckStation_SDL*.AppImage ${BUILD_DIR}/duckstation-sdl-x64.AppImage
# Resulting AppImage files will be located in the directory this script is called from # Resulting AppImages will be created in the directory this script is called from;
# move them into the user's specified build directory