Skip to content

Instantly share code, notes, and snippets.

@fusion809
Last active May 14, 2019 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fusion809/c73856cfc60aab54f5c63e6b2a8063e0 to your computer and use it in GitHub Desktop.
Save fusion809/c73856cfc60aab54f5c63e6b2a8063e0 to your computer and use it in GitHub Desktop.
AppImage builder for OpenRA, with OpenRA/OpenRA#16516 applied and the AppImage name reflecting its commit number and hash.
#!/bin/bash
latest_commit_on_branch () {
git log | head -n 1 | cut -d ' ' -f 2
}
current_git_branch () {
git rev-parse --abbrev-ref HEAD
}
update_git_repo () {
git pull origin $(current_git_branch) -q
}
latest_commit_number () {
update_git_repo
git rev-list --branches "$(current_git_branch)" --count
}
# Remove old AppImages
rm ~/Applications/OpenRA/OpenRA-{Red-Alert,Dune-2000,Tiberian-Dawn}-*-x86_64.AppImage
# Change to my local copy of the OpenRA repo that's not used by the i3bar update checker scripts
cd ~/GitHub/others/OpenRA.copy20190510
# Stash any past changes
git stash
# Update repo to the latest commit upstream
git fetch origin
git rebase origin
# Apply patch
patch -Np1 -i 16516.patch
# Clean up from any past runs of the 'make' command
make clean
# Build engine and mods
make
# Build AppImage
cd packaging/linux
./buildpackage.sh $(latest_commit_number).git.$(latest_commit_on_branch | head -c 7) ~/Applications/OpenRA
# Rename AppImages to a name reflecting the commit number and hash
for i in "Red Alert" "Dune 2000" "Tiberian Dawn"
do
mv ~/Applications/OpenRA/OpenRA-${i/ /-}-devel-x86_64.AppImage ~/Applications/OpenRA/OpenRA-${i/ /-}-$(latest_commit_number).git.$(latest_commit_on_branch | head -c 7)-x86_64.AppImage
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment