diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6262933c..67564093 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,6 +95,35 @@ jobs: name: Mesen (Linux - ${{ matrix.os }} - ${{ matrix.compiler }}) path: bin/linux-x64/Release/linux-x64/publish/Mesen + appimage: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.x + + - name: Install dependencies + run: | + sudo apt-get update -qy + sudo apt-get install -qy libsdl2-dev libfuse2 # The compilers are already installed on GitHub's runners. + + - name: Build Mesen (AppImage) + run: | + Linux/appimage/appimage.sh + - name: Upload Mesen (AppImage) + uses: actions/upload-artifact@v3 + with: + name: Mesen (Linux x64 - AppImage) + path: Mesen.AppImage + + macos: strategy: matrix: diff --git a/Linux/appimage/Mesen.48x48.png b/Linux/appimage/Mesen.48x48.png new file mode 100644 index 00000000..789a54ad Binary files /dev/null and b/Linux/appimage/Mesen.48x48.png differ diff --git a/Linux/appimage/Mesen.desktop b/Linux/appimage/Mesen.desktop new file mode 100644 index 00000000..8d2033e9 --- /dev/null +++ b/Linux/appimage/Mesen.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Icon=Mesen +Exec=Mesen %f +Terminal=false +Type=Application +Categories=Game;Emulator; +Name=Mesen +GenericName=Multi-system emulator +Comment=Multi-system emulator (NES, SNES, GB, PCE) diff --git a/Linux/appimage/appimage.sh b/Linux/appimage/appimage.sh new file mode 100755 index 00000000..a98979e4 --- /dev/null +++ b/Linux/appimage/appimage.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +export PUBLISHFLAGS="-r linux-x64 --no-self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true" +make -j$(nproc) -O LTO=true STATICLINK=true SYSTEM_LIBEVDEV=false + +curl -SL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o appimagetool + +mkdir -p AppDir/usr/bin +cp bin/linux-x64/Release/linux-x64/publish/Mesen AppDir/usr/bin +chmod +x AppDir/usr/bin +ln -sr AppDir/usr/bin/Mesen AppDir/AppRun + +cp Linux/appimage/Mesen.48x48.png AppDir/Mesen.png +cp Linux/appimage/Mesen.desktop AppDir/Mesen.desktop +mkdir -p AppDir/usr/share/applications && cp ./AppDir/Mesen.desktop ./AppDir/usr/share/applications +mkdir -p AppDir/usr/share/icons && cp ./AppDir/Mesen.png ./AppDir/usr/share/icons +mkdir -p AppDir/usr/share/icons/hicolor/48x48/apps && cp ./AppDir/Mesen.png ./AppDir/usr/share/icons/hicolor/48x48/apps + +chmod a+x appimagetool +./appimagetool AppDir/ Mesen.AppImage diff --git a/makefile b/makefile index bfd7594a..62fcb695 100644 --- a/makefile +++ b/makefile @@ -98,7 +98,7 @@ CFLAGS = -fPIC -Wall $(MESENFLAGS) OBJFOLDER := obj.$(MESENPLATFORM) RELEASEFOLDER := bin/$(MESENPLATFORM)/Release -PUBLISHFLAGS := -r $(MESENPLATFORM) --no-self-contained true -p:PublishSingleFile=true +PUBLISHFLAGS ?= -r $(MESENPLATFORM) --no-self-contained true -p:PublishSingleFile=true CORESRC := $(shell find Core -name '*.cpp') COREOBJ := $(CORESRC:.cpp=.o)