diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 98d45f4..4fdad13 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -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: @@ -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' @@ -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: @@ -59,4 +63,15 @@ jobs: README.md AUDIOGUIDE.md m8c - gamecontrollerdb.txt \ No newline at end of file + 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 diff --git a/package/appimage/icon.svg b/package/appimage/icon.svg new file mode 100644 index 0000000..ffd3af2 --- /dev/null +++ b/package/appimage/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/package/appimage/m8c.appdata.xml b/package/appimage/m8c.appdata.xml new file mode 100644 index 0000000..180ad50 --- /dev/null +++ b/package/appimage/m8c.appdata.xml @@ -0,0 +1,21 @@ + + + m8c + MIT + MIT + m8c + A Dirtywave M8 remote client + + m8c is a client for Dirtywave M8 tracker's remote (headless) mode and can mirror the display and route audio. + + m8c.desktop + https://m8c.laamaa.fi + + + + + + + m8c.desktop + + \ No newline at end of file diff --git a/package/appimage/m8c.desktop b/package/appimage/m8c.desktop new file mode 100644 index 0000000..bd2da4f --- /dev/null +++ b/package/appimage/m8c.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=m8c +Comment= +Exec=m8c +Icon=icon +Terminal=false +Categories=Audio +X-AppImage-Version=1.0 diff --git a/package/appimage/package.sh b/package/appimage/package.sh new file mode 100644 index 0000000..22c2309 --- /dev/null +++ b/package/appimage/package.sh @@ -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 + +
m8c is a client for Dirtywave M8 tracker's remote (headless) mode and can mirror the display and route audio.