Skip to content

Commit

Permalink
additional appimage generation for linux build (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
laamaa authored Mar 4, 2025
1 parent b379f65 commit 046ce1b
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 15 deletions.
45 changes: 30 additions & 15 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: m8c linux x64 build

env:
SDL_VERSION: 3.2.6
SDL_SHA256: "096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a SDL3-3.2.6.tar.gz"

on:
push:
pull_request:
Expand All @@ -8,27 +12,33 @@ on:
jobs:

build-linux:
env:
SDL_VERSION: 3.2.4
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: linux-x86_64
steps:
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install --fix-missing build-essential libserialport-dev zip git make pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev
sudo apt-get install --fix-missing build-essential libserialport-dev zip git make pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libpipewire-0.3-dev libwayland-dev libdecor-0-dev
- name: 'Checkout'
uses: actions/checkout@v4

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: 'Cache SDL3 files'
id: cache-x86_64-sdl3-files
uses: actions/cache@v4
with:
path: 'SDL3-3.2.4'
path: 'SDL3-${{ env.SDL_VERSION }}'
key: linux-x86_64-sdl3-files

- name: 'Download SDL3 sources'
if: steps.cache-x86_64-sdl3-files.outputs.cache-hit != 'true'
run: |
(curl https://www.libsdl.org/release/SDL3-$SDL_VERSION.tar.gz || curl -L https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL3-$SDL_VERSION.tar.gz) | tar zxvf -
(curl -O https://www.libsdl.org/release/SDL3-$SDL_VERSION.tar.gz || curl -O -L https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL3-$SDL_VERSION.tar.gz)
if ! echo $SDL_SHA256 | sha256sum -c --status -; then echo "SDL archive checksum failed"; exit 1; fi
tar zxvf SDL3-$SDL_VERSION.tar.gz
- name: 'Build SDL3'
if: steps.cache-x86_64-sdl3-files.outputs.cache-hit != 'true'
Expand All @@ -40,16 +50,10 @@ jobs:
sudo cmake --install build_x86_64
popd
- name: 'Checkout'
uses: actions/checkout@v4

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: 'Build package'
- name: 'Build binary'
run: |
make
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
Expand All @@ -59,4 +63,15 @@ jobs:
README.md
AUDIOGUIDE.md
m8c
gamecontrollerdb.txt
gamecontrollerdb.txt
- name: 'Build AppImage'
run: |
bash package/appimage/package.sh
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: m8c-${{ env.NOW }}-linux-x86_64.AppImage
path: |
m8c*.AppImage
1 change: 1 addition & 0 deletions package/appimage/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions package/appimage/m8c.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>m8c</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>m8c</name>
<summary>A Dirtywave M8 remote client</summary>
<description>
<p>m8c is a client for Dirtywave M8 tracker's remote (headless) mode and can mirror the display and route audio.</p>
</description>
<launchable type="desktop-id">m8c.desktop</launchable>
<url type="homepage">https://m8c.laamaa.fi</url>
<screenshots>
<screenshot type="default">
<image></image>
</screenshot>
</screenshots>
<provides>
<id>m8c.desktop</id>
</provides>
</component>
9 changes: 9 additions & 0 deletions package/appimage/m8c.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=m8c
Comment=
Exec=m8c
Icon=icon
Terminal=false
Categories=Audio
X-AppImage-Version=1.0
62 changes: 62 additions & 0 deletions package/appimage/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
set -xe

# Ubuntu 20.04

APP=m8c
VERSION=2.0.0

if [ "$1" == "build-sdl" ]; then

## Build SDL
SDL_VERSION=3.2.6
SDL_SHA256="096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a SDL3-3.2.6.tar.gz"

sudo apt-get install build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libserialport-dev python2

if [ ! -d SDL3-$SDL_VERSION ]; then

curl -O https://www.libsdl.org/release/SDL3-$SDL_VERSION.tar.gz

if ! echo $SDL_SHA256 | sha256sum -c --status -; then
echo "SDL archive checksum failed" >&2
exit 1
fi

tar zxvf SDL3-$SDL_VERSION.tar.gz
pushd SDL3-$SDL_VERSION
mkdir build_x86_64
cmake -S . -B build_x86_64
cmake --build build_x86_64
sudo cmake --install build_x86_64
popd

fi

fi

if [ "$2" == "build-m8c" ]; then
make
fi

mkdir -p $APP.AppDir/usr/bin
cp m8c $APP.AppDir/usr/bin/
cp gamecontrollerdb.txt $APP.AppDir

mkdir -p $APP.AppDir/usr/share/applications/ $APP.AppDir/usr/share/metainfo/
cp package/appimage/m8c.desktop $APP.AppDir/usr/share/applications/
#appstreamcli seems to crash
#cp package/appimage/m8c.appdata.xml $APP.AppDir/usr/share/metainfo/
cp package/appimage/icon.svg $APP.AppDir

wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
chmod +x ./appimagetool-*.AppImage
./appimagetool-*.AppImage deploy ./$APP.AppDir/usr/share/applications/m8c.desktop
./appimagetool-*.AppImage ./$APP.AppDir


0 comments on commit 046ce1b

Please sign in to comment.