mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-03 07:25:43 -04:00
Merge pull request #285 from ggdrt/appimage
AppImage: Add desktop integration
This commit is contained in:
commit
442b2bcf7c
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@
|
|||||||
/bin/
|
/bin/
|
||||||
/Build/
|
/Build/
|
||||||
/build/
|
/build/
|
||||||
|
/build-*/
|
||||||
|
|
||||||
# vs stuff
|
# vs stuff
|
||||||
.vs
|
.vs
|
||||||
|
10
appimage/duckstation-qt.desktop
Normal file
10
appimage/duckstation-qt.desktop
Normal file
@ -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;
|
10
appimage/duckstation-sdl.desktop
Normal file
10
appimage/duckstation-sdl.desktop
Normal file
@ -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;
|
65
appimage/generate-appimages.sh
Executable file
65
appimage/generate-appimages.sh
Executable file
@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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 <build_directory_path>"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
BUILD_DIR=$(readlink -f $1)
|
||||||
|
echo "BUILD_DIR set to ${BUILD_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Acquire linuxdeploy and linuxdeploy-plugin-qt
|
||||||
|
wget --timestamping --directory-prefix=${BUILD_DIR} \
|
||||||
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
|
chmod a+x ${BUILD_DIR}/linuxdeploy-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,
|
||||||
|
# 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
|
||||||
|
|
||||||
|
${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
|
||||||
|
--appdir=${BUILD_DIR}/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 ${BUILD_DIR}/duckstation-qt-x64.AppImage
|
||||||
|
|
||||||
|
${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
|
||||||
|
--appdir=${BUILD_DIR}/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 ${BUILD_DIR}/duckstation-sdl-x64.AppImage
|
||||||
|
|
||||||
|
# Resulting AppImages will be created in the directory this script is called from;
|
||||||
|
# move them into the user's specified build directory
|
BIN
appimage/icon-16px.png
Normal file
BIN
appimage/icon-16px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 643 B |
BIN
appimage/icon-32px.png
Normal file
BIN
appimage/icon-32px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
appimage/icon-64px.png
Normal file
BIN
appimage/icon-64px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
22
appveyor.yml
22
appveyor.yml
@ -56,26 +56,24 @@ build_script:
|
|||||||
|
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
../appimage/generate-appimages.sh $(pwd)
|
||||||
|
|
||||||
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
if [ $? -eq 0 ]; then
|
||||||
|
|
||||||
chmod +x linuxdeploy-x86_64.AppImage
|
mv duckstation-qt-x64.AppImage duckstation-qt-x64-release.AppImage
|
||||||
|
|
||||||
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
|
mv duckstation-sdl-x64.AppImage duckstation-sdl-x64-release.AppImage
|
||||||
|
|
||||||
cp ../appimage/duckstation-icon.png ../appimage/duckstation-qt.png
|
|
||||||
|
|
||||||
cp ../appimage/duckstation-icon.png ../appimage/duckstation-sdl.png
|
|
||||||
|
|
||||||
./linuxdeploy-x86_64.AppImage --appdir=./AppDir-duckstation-qt --executable=./src/duckstation-qt/duckstation-qt --create-desktop-file --icon-file=../appimage/duckstation-qt.png --plugin=qt --output=appimage
|
|
||||||
|
|
||||||
./linuxdeploy-x86_64.AppImage --appdir=./AppDir-duckstation-sdl --executable=./src/duckstation-sdl/duckstation-sdl --create-desktop-file --icon-file=../appimage/duckstation-sdl.png --output=appimage
|
|
||||||
|
|
||||||
7za a -r duckstation-linux-x64-release.7z duckstation-*.AppImage
|
7za a -r duckstation-linux-x64-release.7z duckstation-*.AppImage
|
||||||
|
|
||||||
appveyor PushArtifact duckstation-linux-x64-release.7z
|
appveyor PushArtifact duckstation-linux-x64-release.7z
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
echo "Failed to create AppImages, no AppImage artifact will be pushed"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
elif [ "$APPVEYOR_BUILD_WORKER_IMAGE" == "macOS" ]; then
|
elif [ "$APPVEYOR_BUILD_WORKER_IMAGE" == "macOS" ]; then
|
||||||
|
|
||||||
mkdir build-release
|
mkdir build-release
|
||||||
|
Loading…
x
Reference in New Issue
Block a user