Skip to content

Instantly share code, notes, and snippets.

@dpanter
Last active January 30, 2024 18:44
Show Gist options
  • Save dpanter/ce3fe27388df11c3fdf47af1533a70a8 to your computer and use it in GitHub Desktop.
Save dpanter/ce3fe27388df11c3fdf47af1533a70a8 to your computer and use it in GitHub Desktop.
git-mangohud.sh - Easily download, build and install latest MangoHud master from Github
#!/bin/bash
# git-mangohud.sh
# Easily download, build and install latest MangoHud master from Github
# Created 2023-04-21 - updated 2024-01-30
# Written for Siduction (Debian sid based distro)
# By dpanter https://gist.github.com/dpanter
# Meson install requires elevated privileges
PROJECT="MangoHud"
RUNDATE="`date +%Y%m%d`"
COMMIT="`curl -v --silent https://github.com/flightlessmango/MangoHud/commits/master 2>&1 | grep -m 1 'href="/flightlessmango/MangoHud/commit/' | awk -F"/commit/" '{print $2}' | cut -c 1-7`"
# check if project/commit dir already exists, wildcarded rundate. if no match, download/build project
if [ ! -n "$(/bin/ls -d $PROJECT-*-$COMMIT)" ]; then
git clone --recurse-submodules https://github.com/flightlessmango/MangoHud.git $PROJECT-$RUNDATE-$COMMIT
cd $PROJECT-$RUNDATE-$COMMIT
meson build
meson build32 --libdir lib32
ninja -C build install
ninja -C build32 install
# if project/commit dir already exists, print message and quit
else
echo "Directory for latest commit already exists: $(/bin/ls -d $PROJECT-*-$COMMIT)"
echo "No actions taken this run."
fi
# meson build -Dmangoapp=true -Dmangoapp_layer=true //needed for mangoapp, gamescope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment