forked from hrydgard/ppsspp
-
Notifications
You must be signed in to change notification settings - Fork 0
257 lines (227 loc) · 9.03 KB
/
appimage.yml
File metadata and controls
257 lines (227 loc) · 9.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
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@v4
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 upstream || exit 0
- name: Set up ccache for ${{ matrix.id }}
uses: actions/cache@v4.2.3
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
sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf
ARCH=$(uname -m)
echo "ARCH=$ARCH" >> $GITHUB_ENV # Export ARCH to be reused on other steps
if [[ "$ARCH" == "x86_64" ]]; then
PKG_TYPE='x86_64.pkg.tar.zst'
else
PKG_TYPE='aarch64.pkg.tar.xz'
fi
LLVM_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/llvm-libs-nano-$PKG_TYPE"
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-$PKG_TYPE"
OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/opus-nano-$PKG_TYPE"
echo "Installing build dependencies..."
echo "---------------------------------------------------------------"
pacman -Syu --noconfirm \
base-devel \
curl \
desktop-file-utils \
git \
cmake \
ninja \
clang \
ccache \
llvm-libs \
llvm \
lld \
libxss \
mesa \
fontconfig \
gcc-libs \
glibc \
libc++ \
libc++abi \
glew \
sdl2_ttf \
python \
patchelf \
pipewire \
pipewire-audio \
pulseaudio \
pulseaudio-alsa \
strace \
wget \
xorg-server-xvfb \
zsync \
vulkan-nouveau \
vulkan-radeon \
vulkan-headers \
alsa-lib sndio hidapi ibus jack libdecor libgl libpulse libusb \
libx11 libxcursor libxext libxinerama libxkbcommon libxrandr libxrender libxss libxtst \
wayland wayland-protocols
if [[ "$ARCH" == "x86_64" ]]; then
pacman -Syu --noconfirm vulkan-intel
fi
echo "Installing debloated pckages..."
echo "---------------------------------------------------------------"
wget --retry-connrefused --tries=30 "$LLVM_URL" -O ./llvm-libs.pkg.tar.zst
wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2.pkg.tar.zst
wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus-nano.pkg.tar.zst
pacman -U --noconfirm ./*.pkg.tar.zst
rm -f ./*.pkg.tar.zst
echo "All done!"
echo "---------------------------------------------------------------"
- 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 --tags)" >> $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
# Install SDL2 from AUR
sed -i 's|EUID == 0|EUID == 69|g' /usr/bin/makepkg # because the docker image is ran as root this is needed lol
git clone https://aur.archlinux.org/sdl2.git
pushd sdl2
sed -i "s|x86_64|$ARCH|" ./PKGBUILD
makepkg -f
pacman --noconfirm -Rsndd sdl2-compat
pacman --noconfirm -U *.pkg.tar.*
popd
# End of Install SDL2 from AUR
# Build ppsspp
#./b.sh --release --no-sdl2 --no-png
mkdir -p build
pushd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_SYSTEM_LIBSDL2=OFF -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@v4
with:
name: linux-${{ steps.version.outputs.tag }}-${{ matrix.id }} AppImage
path: artifacts/
- name: Upload release
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
if: github.ref_type == 'tag'
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
artifacts/*.AppImage
artifacts/*.AppImage.zsync