Skip to content

Commit 305d7f5

Browse files
WIP
1 parent b1ef6dc commit 305d7f5

File tree

133 files changed

+30733
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+30733
-112
lines changed

.github/workflows/arch-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
echo "ParallelDownloads = 10" >> /etc/pacman.conf
2020
echo "\n" && echo "[multilib]" >> /etc/pacman.conf
2121
echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
22-
pacman -Syu base-devel sudo meson python-mako glslang hub python-numpy python-matplotlib --noconfirm
22+
pacman -Syu base-devel --noconfirm
2323
- name: makepkg
2424
run: |
2525
useradd -m builduser

.github/workflows/build-debug.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build debug release package
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-24.04
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install build tools
15+
shell: bash
16+
run: |
17+
set -euxo pipefail
18+
sudo dpkg --add-architecture i386
19+
sudo apt update
20+
source ./build_deps.sh
21+
sudo apt -o Acquire::Queue-Mode=access -y install ${DEPS_DEBIAN//,/ }
22+
- name: Prepare artifact variables
23+
id: git-vars
24+
shell: bash
25+
run: |
26+
set -euxo pipefail
27+
short_sha="$(git rev-parse --short=12 "$GITHUB_SHA")"
28+
# For push events, this is the branch or tag name without refs/* prefix
29+
ref_name="${GITHUB_REF_NAME}"
30+
31+
artifact_name="MangoHud-debug-${ref_name}-${short_sha}-${GITHUB_RUN_NUMBER}"
32+
echo "artifact-name=$artifact_name" >> "$GITHUB_OUTPUT"
33+
34+
- name: Build and package
35+
shell: bash
36+
run: |
37+
set -euxo pipefail
38+
./build-source.sh
39+
./build.sh build_dbg -Dwerror=true package release
40+
41+
- name: Upload artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: ${{ steps.git-vars.outputs.artifact-name }}
45+
path: build/MangoHud-*.tar.gz
46+
if-no-files-found: error
47+
retention-days: 30

.github/workflows/build-package.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ jobs:
1414
set -x
1515
sudo dpkg --add-architecture i386
1616
sudo apt update
17-
sudo apt -y install gcc-multilib g++-multilib ninja-build python3-setuptools \
18-
python3-wheel mesa-common-dev libxnvctrl-dev libdbus-1-dev \
19-
python3-numpy python3-matplotlib unzip libxkbcommon-dev libwayland-dev wget unzip \
20-
libxkbcommon-dev:i386 libwayland-dev:i386 gh python3-mako meson pkgconf pkg-config
21-
wget https://github.com/KhronosGroup/glslang/releases/download/SDK-candidate-26-Jul-2020/glslang-master-linux-Release.zip
22-
unzip glslang-master-linux-Release.zip bin/glslangValidator
23-
sudo install -m755 bin/glslangValidator /usr/local/bin/
24-
command -v pkg-config && pkg-config --version
17+
source ./build_deps.sh
18+
sudo apt -o Acquire::Queue-Mode=access -y install ${DEPS_DEBIAN//,/ }
2519
- name: Prepare Artifact Git Info
2620
shell: bash
2721
run: |
@@ -39,15 +33,23 @@ jobs:
3933
- name: Build and package
4034
run: |
4135
./build-source.sh
42-
./build.sh build -Dwerror=true package release
36+
if [ -d /out ]; then
37+
./build.sh build_dbg -Dwerror=true package release
38+
else
39+
./build.sh build -Dwerror=true package release
40+
fi
4341
- name: Upload assets to release
4442
env:
4543
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4644
run: |
47-
tag_name="${GITHUB_REF##*/}"
48-
for pkg in ./build/*.tar.*; do
49-
gh release upload "$tag_name" "$pkg" --clobber
50-
done
45+
if [ -d /out ]; then
46+
cp ./build/*.tar.* /out
47+
else
48+
tag_name="${GITHUB_REF##*/}"
49+
for pkg in ./build/*.tar.*; do
50+
gh release upload "$tag_name" "$pkg" --clobber
51+
done
52+
fi
5153
5254
- name: Upload artifact
5355
uses: actions/upload-artifact@v4

.github/workflows/build-source.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
run: |
1616
set -x
1717
apt update
18-
apt -y install gcc g++ ninja-build python3-pip python3-setuptools \
19-
python3-wheel pkg-config mesa-common-dev libx11-dev \
20-
libxnvctrl-dev libdbus-1-dev glslang-tools hub libxkbcommon-dev \
21-
libwayland-dev wget unzip python3-mako meson
18+
source ./build_deps.sh
19+
DEPS_NO_I386="$(printf '%s' "$DEPS_DEBIAN" \
20+
| tr ',' '\n' \
21+
| grep -v ':i386' \
22+
| tr '\n' ' ')"
23+
sudo apt -o Acquire::Queue-Mode=access -y install hub $DEPS_NO_I386
2224
./build-source.sh
2325
assets=()
2426
for asset in ./MangoHud-*-Source*.tar.*; do

.github/workflows/mingw.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/ubuntu.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,12 @@ jobs:
1515
- name: 'Install prerequisites'
1616
run: |
1717
sudo apt-get update
18-
sudo apt-get install -y \
19-
appstream \
20-
glslang-tools \
21-
ninja-build \
22-
python3-mako \
23-
python3-setuptools \
24-
python3-wheel \
25-
mesa-common-dev \
26-
libcmocka-dev \
27-
libdbus-1-dev \
28-
libglfw3-dev \
29-
libwayland-dev \
30-
libxnvctrl-dev \
31-
libxkbcommon-dev \
32-
meson
18+
source ./build_deps.sh
19+
DEPS_NO_I386="$(printf '%s' "$DEPS_DEBIAN" \
20+
| tr ',' '\n' \
21+
| grep -v ':i386' \
22+
| tr '\n' ' ')"
23+
sudo apt -o Acquire::Queue-Mode=access -y install $DEPS_NO_I386
3324
- name: 'Install clang'
3425
if: ${{ (matrix.compiler == 'clang') }}
3526
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ subprojects/spdlog-*/
4444
subprojects/nlohmann_json-*/
4545
subprojects/implot-*/
4646
subprojects/cmocka/
47+
subprojects/yaml-cpp*
48+
pkgbuild/*
49+
!pkgbuild/PKGBUILD
4750

4851
#GNU Global Metadata
4952
**/GPATH

bin/mangohud-setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ mangohud_uninstall() {
3838
rm -frv "/usr/share/doc/mangohud"
3939
rm -fv "/usr/share/man/man1/mangohud.1"
4040
rm -fv "/usr/bin/mangohud"
41+
rm -fv "/usr/bin/mangohud-server"
4142
rm -fv "/usr/bin/mangoplot"
4243
rm -fv "/usr/bin/mangohud.x86"
4344
}
@@ -73,6 +74,7 @@ mangohud_install() {
7374
/usr/bin/install -Dvm644 ./usr/share/man/man1/mangohud.1 /usr/share/man/man1/mangohud.1
7475
/usr/bin/install -Dvm644 ./usr/share/doc/mangohud/MangoHud.conf.example /usr/share/doc/mangohud/MangoHud.conf.example
7576
/usr/bin/install -vm755 ./usr/bin/mangohud /usr/bin/mangohud
77+
/usr/bin/install -vm755 ./usr/bin/mangohud-server /usr/bin/mangohud-server
7678
/usr/bin/install -vm755 ./usr/bin/mangoplot /usr/bin/mangoplot
7779

7880
ln -sv $DEFAULTLIB /usr/lib/mangohud/lib

bin/mangohud.in

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cs2.sh
1515
RiseOfTheTombRaider.sh
1616
"
1717

18-
MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_shim.so"
18+
MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud.so"
1919

2020
if [ "$1" = "--version" ]; then
2121
echo @version@
@@ -39,6 +39,11 @@ for exe in $DISABLE_LD_PRELOAD; do
3939
break
4040
fi
4141
done
42+
# TODO This is experimental and we might break steam overlay
43+
is_proton=false
44+
if [ -n "${STEAM_COMPAT_PROTON-}" ] || [ -n "${STEAM_COMPAT_DATA_PATH-}" ]; then
45+
is_proton=true
46+
fi
4247

4348
if [ "$disable_preload" = true ]; then
4449
exec env MANGOHUD=1 "$@"
@@ -51,7 +56,11 @@ else
5156
(*)
5257
# Preload using the plain filenames of the libs, the dynamic linker will
5358
# figure out whether the 32 or 64 bit version should be used
54-
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
59+
if [ "$is_proton" = true ]; then
60+
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
61+
else
62+
LD_PRELOAD="${MANGOHUD_LIB_NAME}${LD_PRELOAD:+$LD_PRELOAD:}"
63+
fi
5564
esac
5665

5766
exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"

build.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ configure() {
151151
if [[ ! -f "build/meson32/build.ninja" && "$MACHINE" = "x86_64" ]]; then
152152
export CC="gcc -m32"
153153
export CXX="g++ -m32"
154+
export LDFLAGS=-m32
154155
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH_32}"
155-
meson setup build/meson32 --libdir lib/mangohud/lib32 --prefix /usr -Dappend_libdir_mangohud=false $@ ${CONFIGURE_OPTS}
156+
meson setup build/meson32 --libdir lib/mangohud/lib32 --prefix /usr -Dappend_libdir_mangohud=false -Dwith_server=false $@ ${CONFIGURE_OPTS}
156157
fi
157158
}
158159

@@ -163,7 +164,7 @@ build() {
163164
DESTDIR="$PWD/build/release" ninja -C build/meson64 install
164165

165166
if [ "$MACHINE" = "x86_64" ]; then
166-
DESTDIR="$PWD/build/release" ninja -C build/meson32 install
167+
DESTDIR="$PWD/build/release"/ ninja -C build/meson32 install
167168
fi
168169

169170
sed -i 's:/usr/\\$LIB:/usr/lib/mangohud/\\$LIB:g' "$PWD/build/release/usr/bin/mangohud"
@@ -194,6 +195,7 @@ uninstall() {
194195
rm -rfv "/usr/lib/mangohud"
195196
rm -rfv "/usr/share/doc/mangohud"
196197
rm -fv "/usr/share/man/man1/mangohud.1"
198+
rm -fv "/usr/bin/mangohud-server"
197199
rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json"
198200
rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.json"
199201
rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json"
@@ -229,19 +231,20 @@ install() {
229231

230232
echo DEFAULTLIB: $DEFAULTLIB
231233
/usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud.so /usr/lib/mangohud/lib64/libMangoHud.so
232-
/usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud_opengl.so /usr/lib/mangohud/lib64/libMangoHud_opengl.so
233-
/usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud_shim.so /usr/lib/mangohud/lib64/libMangoHud_shim.so
234+
# /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud_opengl.so /usr/lib/mangohud/lib64/libMangoHud_opengl.so
235+
# /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud_shim.so /usr/lib/mangohud/lib64/libMangoHud_shim.so
234236
if [ "$MACHINE" = "x86_64" ]; then
235237
/usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud.so /usr/lib/mangohud/lib32/libMangoHud.so
236-
/usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud_opengl.so /usr/lib/mangohud/lib32/libMangoHud_opengl.so
237-
/usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud_shim.so /usr/lib/mangohud/lib32/libMangoHud_shim.so
238+
# /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud_opengl.so /usr/lib/mangohud/lib32/libMangoHud_opengl.so
239+
# /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud_shim.so /usr/lib/mangohud/lib32/libMangoHud_shim.so
238240
fi
239241

240242
/usr/bin/install -Dvm644 ./build/release/usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json /usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json
241243
/usr/bin/install -Dvm644 ./build/release/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json /usr/share/vulkan/implicit_layer.d/MangoHud.x86.json
242244
/usr/bin/install -Dvm644 ./build/release/usr/share/man/man1/mangohud.1 /usr/share/man/man1/mangohud.1
243245
/usr/bin/install -Dvm644 ./build/release/usr/share/doc/mangohud/MangoHud.conf.example /usr/share/doc/mangohud/MangoHud.conf.example
244246
/usr/bin/install -vm755 ./build/release/usr/bin/mangohud /usr/bin/mangohud
247+
/usr/bin/install -vm755 ./build/release/usr/bin/mangohud-server /usr/bin/mangohud-server
245248
/usr/bin/install -vm755 ./build/release/usr/bin/mangoplot /usr/bin/mangoplot
246249

247250
ln -sv $DEFAULTLIB /usr/lib/mangohud/lib
@@ -288,7 +291,7 @@ reinstall() {
288291

289292
clean() {
290293
rm -rf "build"
291-
rm -rf subprojects/*/
294+
find subprojects -mindepth 1 -maxdepth 1 -type d ! -name packagefiles -exec rm -rf -- {} +
292295
}
293296

294297
usage() {

0 commit comments

Comments
 (0)