Skip to content

Instantly share code, notes, and snippets.

@dpanter
Last active January 30, 2024 12:30
Show Gist options
  • Save dpanter/618af3479d2273a84fb3d5dd02d65e0c to your computer and use it in GitHub Desktop.
Save dpanter/618af3479d2273a84fb3d5dd02d65e0c to your computer and use it in GitHub Desktop.
git-gamescope.sh - Easily download, build and install latest gamescope master from Github
#!/bin/bash
# git-gamescope.sh
# Easily download, build and install latest gamescope 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
# Dependency list https://github.com/ValveSoftware/gamescope/issues/838
PROJECT="gamescope"
RUNDATE="`date +%Y%m%d`"
COMMIT="`curl -v --silent https://github.com/ValveSoftware/gamescope/commits/master 2>&1 | grep -m 1 '"/ValveSoftware/gamescope/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 https://github.com/ValveSoftware/gamescope.git $PROJECT-$RUNDATE-$COMMIT
cd $PROJECT-$RUNDATE-$COMMIT
git submodule update --init
meson build/
ninja -C build/
meson install -C build/ --skip-subprojects
#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment