mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
222 lines
7.7 KiB
YAML
222 lines
7.7 KiB
YAML
name: Generate Linux AppImage
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
# For testing.
|
|
#- test_arch
|
|
tags:
|
|
- "v*.*"
|
|
paths-ignore:
|
|
- '*.{txt,md}'
|
|
- 'Tools/**'
|
|
- '.{editorconfig,gitattributes,gitignore}'
|
|
- 'appveyor.yml'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '*.{txt,md}'
|
|
- 'Tools/**'
|
|
- '.{editorconfig,gitattributes,gitignore}'
|
|
- 'appveyor.yml'
|
|
|
|
env:
|
|
SDL_AUDIODRIVER: "dummy" #"disk"
|
|
#SDL_VIDEODRIVER: "dummy"
|
|
#BUILD_CONFIGURATION: Release #RelWithDebInfo
|
|
|
|
jobs:
|
|
build:
|
|
name: build (${{ matrix.id }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-24.04
|
|
id: x86_64
|
|
- os: ubuntu-24.04-arm
|
|
id: aarch64
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
container: ghcr.io/pkgforge-dev/archlinux:latest
|
|
env:
|
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
|
CCACHE_COMPILERCHECK: content
|
|
CCACHE_SLOPPINESS: time_macros
|
|
steps:
|
|
- name: Install git
|
|
run: pacman -Syu --noconfirm git
|
|
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Check Valid Version Tags
|
|
id: valid-tags
|
|
shell: bash
|
|
run: |
|
|
# Fix dubious ownership issue when running git describe inside a container
|
|
git config --global --add safe.directory "$PWD" # Alternatively, chown -R $(id -u):$(id -g) $PWD
|
|
echo "count=$(git tag -l 'v[0-9]*' | wc -l | tr -d ' ')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Fetch upstream tags # required for git describe to return a valid version and to preevnt androidGitVersion from crashing on a new fork
|
|
if: steps.valid-tags.outputs.count == '0'
|
|
run: |
|
|
# TODO: should try to fetch tags from whereever this repo was forked from before fetching from official repo
|
|
git remote add upstream https://github.com/hrydgard/ppsspp.git # fetching from official repo as a fallback
|
|
git fetch --deepen=15000 --no-recurse-submodules --tags --force upstream || exit 0
|
|
|
|
- name: Set up ccache for ${{ matrix.id }}
|
|
uses: actions/cache@v6.1.0
|
|
with:
|
|
path: ${{ env.CCACHE_DIR }}
|
|
key: ${{ runner.os }}-ccache-${{ matrix.id }}-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-ccache-${{ matrix.id }}-
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: |
|
|
#sudo su # Why sudo is needed?
|
|
#sudo rm -rf /var/lib/apt/lists/lock # due to permisson issue, why there is such issue?
|
|
|
|
# Debian-based
|
|
#sudo apt-get update -y -qq
|
|
#sudo apt-get install -q -y zsync patchelf xvfb strace
|
|
#sudo apt-get install -q -y libstdc++6 ffmpeg libvulkan-dev libglew-dev libsdl2-ttf-dev libsdl2-dev libasound2-dev alsa-base alsa-utils libglu1-mesa pulseaudio linux-modules-extra-$(uname -r) #build-essential #plocate
|
|
#sudo updatedb # to update locate database
|
|
|
|
# Archlinux
|
|
set -ex
|
|
|
|
ARCH=$(uname -m)
|
|
echo "ARCH=$ARCH" >> $GITHUB_ENV # Export ARCH to be reused on other steps
|
|
EXTRA_PACKAGES="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh"
|
|
|
|
echo "Installing build dependencies..."
|
|
echo "---------------------------------------------------------------"
|
|
pacman -Syu --noconfirm \
|
|
base-devel \
|
|
curl \
|
|
git \
|
|
cmake \
|
|
ninja \
|
|
clang \
|
|
ccache \
|
|
lld \
|
|
libxss \
|
|
fontconfig \
|
|
gcc-libs \
|
|
glibc \
|
|
libc++ \
|
|
libc++abi \
|
|
glew \
|
|
sdl3 \
|
|
sdl3_ttf \
|
|
python \
|
|
patchelf \
|
|
pipewire \
|
|
pipewire-audio \
|
|
pulseaudio \
|
|
pulseaudio-alsa \
|
|
strace \
|
|
wget \
|
|
xorg-server-xvfb \
|
|
zsync \
|
|
vulkan-headers \
|
|
alsa-lib sndio hidapi ibus jack libdecor libgl libpulse libusb \
|
|
libx11 libxcursor libxext libxinerama libxkbcommon libxrandr libxrender libxss libxtst \
|
|
wayland wayland-protocols
|
|
|
|
echo "Installing debloated packages..."
|
|
echo "---------------------------------------------------------------"
|
|
wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
|
|
chmod +x ./get-debloated-pkgs.sh
|
|
./get-debloated-pkgs.sh --add-mesa libxml2-mini opus-mini llvm-libs-nano
|
|
|
|
- name: Build Release
|
|
id: version
|
|
env:
|
|
CC: gcc #clang
|
|
CXX: g++ #clang++
|
|
CPPFLAGS: -fno-pie -no-pie -static -Wl,-no_pie -Wl,-rpath,'$ORIGIN/../lib' -Wl,--disable-new-dtags -Wl,--no-undefined #-fno-unwind-tables -fno-exceptions -fno-threadsafe-statics -fno-rtti # -static-libgcc -static-libstdc++ # -fno-plt # -fPIC -D_XOPEN_SOURCE=700 #-D_GNU_SOURCE # -fno-split-stack
|
|
#CXXFLAGS: -stdlib=libc++ -lc++abi # clang only
|
|
LDFLAGS: -no-pie -static-libgcc -static-libstdc++ #-fuse-ld=lld #-static
|
|
USE_CCACHE: 1
|
|
APPIMAGE_EXTRACT_AND_RUN: 1
|
|
run: |
|
|
echo "Building..."
|
|
uname -m
|
|
echo "tag=$(git describe --always)" >> $GITHUB_OUTPUT
|
|
|
|
# Export ccache env var(s)
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
export CCACHE_SLOPPINESS=clang_index_store,ivfsoverlay,include_file_ctime,include_file_mtime,modules,system_headers,time_macros
|
|
|
|
gcc --version
|
|
g++ --version
|
|
|
|
#clang --version
|
|
#clang++ --version
|
|
|
|
# Build ppsspp
|
|
#./b.sh --release --no-sdl2 --no-png
|
|
mkdir -p build
|
|
pushd build
|
|
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_SYSTEM_LIBPNG=OFF -DUSE_SYSTEM_FFMPEG=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
|
|
make -j$(nproc)
|
|
popd
|
|
ccache -s -v
|
|
|
|
- name: Create AppImage
|
|
shell: bash
|
|
run: |
|
|
# Use dummy soundcard
|
|
#sudo locate snd-dummy
|
|
#sudo modprobe snd-dummy fake_buffer=0
|
|
|
|
# Test for missing modules
|
|
ldd ./build/PPSSPPSDL
|
|
|
|
# Create AppImage package
|
|
echo "Creating AppImage..."
|
|
chmod +x ./build/PPSSPPSDL
|
|
chmod +x ./scripts/makeappimage_64-bit.sh
|
|
VERSION=$([[ ${GITHUB_REF_TYPE} == tag ]] && echo "$GITHUB_REF_NAME" || echo "${{ steps.version.outputs.tag }}")
|
|
echo "Version = $VERSION"
|
|
./scripts/makeappimage_64-bit.sh "$VERSION"
|
|
|
|
- name: Prepare artifacts
|
|
run: |
|
|
find . -name "PPSSPPSDL"
|
|
find . -name "PPSSPP*.AppImage" -exec chmod +x '{}' \;
|
|
find . -name "PPSSPP*.AppBundle" -exec chmod +x '{}' \;
|
|
find . -name "PPSSPP*.zsync"
|
|
mkdir artifacts
|
|
if [ -e ./PPSSPP*.AppImage ]; then
|
|
cp -a ./PPSSPP*.AppImage artifacts/
|
|
fi
|
|
if [ -e ./PPSSPP*.AppBundle ]; then
|
|
cp -a ./PPSSPP*.AppBundle artifacts/
|
|
fi
|
|
if [ -e ./PPSSPP*.zsync ]; then
|
|
cp ./PPSSPP*.zsync artifacts/
|
|
fi
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-${{ steps.version.outputs.tag }}-${{ matrix.id }} AppImage
|
|
path: artifacts/
|
|
|
|
- name: Upload release
|
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
|
if: github.ref_type == 'tag'
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
files: |
|
|
artifacts/*.AppImage
|
|
artifacts/*.AppImage.zsync
|