Adds AppImage build

This commit is contained in:
markmental 2026-03-28 15:20:18 -04:00
commit 0eb9ddc1be
6 changed files with 89 additions and 1 deletions

View file

@ -24,7 +24,7 @@ BIN := passport-c-media-player
CPPFLAGS += -I./src $(SDL_CFLAGS) $(FFMPEG_CFLAGS)
LDLIBS += $(SDL_LIBS) $(FFMPEG_LIBS) -lm
.PHONY: all run clean
.PHONY: all run clean appimage
all: $(BIN)
@ -36,3 +36,6 @@ run: $(BIN)
clean:
rm -f $(OBJ) $(BIN)
appimage: $(BIN)
./build-appimage.sh

85
build-appimage.sh Executable file
View file

@ -0,0 +1,85 @@
#!/bin/bash
set -e
APP_NAME="Passport-C-Media-Player"
APP_VERSION="0.1"
OUTPUT_NAME="${APP_NAME}-${APP_VERSION}-x86_64.AppImage"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}Building ${APP_NAME} AppImage...${NC}"
# Check if binary exists
if [ ! -f "passport-c-media-player" ]; then
echo -e "${YELLOW}Binary not found. Building first...${NC}"
make clean
make
fi
# Create AppDir structure
echo -e "${GREEN}Setting up AppDir...${NC}"
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
# Copy binary
cp passport-c-media-player AppDir/usr/bin/
chmod +x AppDir/usr/bin/passport-c-media-player
# Copy desktop file
cp AppDir/usr/share/applications/passport-c-media-player.desktop AppDir/
# Copy and convert icon
echo -e "${GREEN}Setting up icon...${NC}"
if [ -f "logo.png" ]; then
cp logo.png AppDir/usr/share/icons/hicolor/256x256/apps/passport-c-media-player.png
cp logo.png AppDir/passport-c-media-player.png
else
echo -e "${RED}Warning: logo.png not found!${NC}"
fi
# Create AppRun symlink
cd AppDir
ln -sf usr/bin/passport-c-media-player AppRun
cd ..
# Download linuxdeploy if not present
if [ ! -f "linuxdeploy-x86_64.AppImage" ]; then
echo -e "${GREEN}Downloading linuxdeploy...${NC}"
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
fi
# Download ffmpeg plugin if not present
if [ ! -f "linuxdeploy-plugin-ffmpeg.sh" ]; then
echo -e "${GREEN}Downloading ffmpeg plugin...${NC}"
wget -q https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-ffmpeg/master/linuxdeploy-plugin-ffmpeg.sh
chmod +x linuxdeploy-plugin-ffmpeg.sh
fi
# Build AppImage
echo -e "${GREEN}Creating AppImage...${NC}"
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--plugin ffmpeg \
--output appimage \
-d AppDir/usr/share/applications/passport-c-media-player.desktop \
-i AppDir/usr/share/icons/hicolor/256x256/apps/passport-c-media-player.png
# Rename output file
if [ -f "Passport_C_Media_Player-x86_64.AppImage" ]; then
mv "Passport_C_Media_Player-x86_64.AppImage" "${OUTPUT_NAME}"
fi
if [ -f "${OUTPUT_NAME}" ]; then
echo -e "${GREEN}Success! Created ${OUTPUT_NAME}${NC}"
ls -lh "${OUTPUT_NAME}"
else
echo -e "${RED}Error: AppImage creation failed!${NC}"
exit 1
fi

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
passport_spectrum.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
screenshotguide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
screenshotvideo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB