|
% make, build, projects, compile |
|
|
|
; variables are initialized by navi per rule BEFORE the commands run so one of these per repository is needed |
|
; this is the reason the fetch origin and ls-remote calls are here, to fetch the new data from the remote and fill correctly the options |
|
; navi is kind of weird in that it will abort the rule if there is a 'variable' with no possibilities, so most of this error handling will not trigger |
|
|
|
$ retroarch_config_dir: echo "$HOME/.config/retroarch" --- --prevent-extra |
|
$ retroarch_build_dir: echo "$HOME/Documents/Projects/RetroArch" --- --prevent-extra |
|
$ discord: echo "disable-discord enable-discord" | tr ' ' '\n' --- --prevent-extra |
|
$ qt: echo "disable-qt enable-qt" | tr ' ' '\n' --- --prevent-extra |
|
$ ffmpeg: echo "disable-ffmpeg enable-ffmpeg" | tr ' ' '\n' --- --prevent-extra |
|
$ flac: echo "disable-flac enable-flac" | tr ' ' '\n' --- --prevent-extra |
|
$ cdrom: echo "disable-cdrom enable-cdrom" | tr ' ' '\n' --- --prevent-extra |
|
$ wayland: echo "enable-wayland disable-wayland" | tr ' ' '\n' --- --prevent-extra |
|
$ kms: echo "disable-kms enable-kms" | tr ' ' '\n' --- --prevent-extra |
|
$ sdl2: echo "enable-sdl2 disable-sdl2" | tr ' ' '\n' --- --prevent-extra |
|
$ x11: echo "enable-x11 disable-x11" | tr ' ' '\n' --- --prevent-extra |
|
$ opengl: echo "enable-opengl disable-opengl" | tr ' ' '\n' --- --prevent-extra |
|
$ vulkan: echo "enable-vulkan disable-vulkan" | tr ' ' '\n' --- --prevent-extra |
|
$ use_debug: echo 'false true' | tr ' ' '\n' --- --prevent-extra |
|
$ retroarch_branch: git -C <retroarch_build_dir> fetch origin && { git -C <retroarch_build_dir> branch --no-column --format '%(refname)' -a | sed '/HEAD detached at/d' | sed 's/^refs\/\(heads\|remotes\)\///g' | sort -n ; } || echo "master" --- --prevent-extra |
|
$ retroarch_pr: git -C <retroarch_build_dir> ls-remote -q origin 'pull/*/head' 2>/dev/null | cut -f2 | sed -E 's/[^[:digit:]]*([[:digit:]]+)[^[:digit:]]+/pr\/\1/' | sort -rV --- --prevent-extra |
|
|
|
|
|
# kill leftover wine processes |
|
( kill -9 $(ps aux |grep -i '\.exe' |awk '{print $2}'|tr '\n' ' ') ) |
|
|
|
# retroarch |
|
( \ |
|
cd "<retroarch_build_dir>"; \ |
|
[[ <use_debug> == t* ]] && DBG=--enable-debug || DBG=; \ |
|
git-branch-pull -c "$DBG" -c --<cdrom> -c --<discord> -c --<qt> -c --<ffmpeg> -c --<flac> -c --<wayland> -c --<kms> -c --<sdl2> -c --<x11> -c --<opengl> -c --<vulkan> -m TARGET=retroarch "<retroarch_branch>"; printf "\a"; \ |
|
) |
|
|
|
$ scummvm_build_dir: echo "$HOME/Documents/Projects/scummvm" --- --prevent-extra |
|
$ scummvm_core_build_dir: echo "$HOME/Documents/Projects/scummvm/backends/platform/libretro/build" --- --prevent-extra |
|
$ scummvm_core_dat_dir: echo "$HOME/Documents/Projects/scummvm/backends/platform/libretro/aux-data" --- --prevent-extra |
|
|
|
$ scummvm_branch: git -C <scummvm_build_dir> fetch origin && { git -C <scummvm_build_dir> branch --no-column --format '%(refname)' -a | sed '/HEAD detached at/d' | sed 's/^refs\/\(heads\|remotes\)\///g' | sort -n ; } || echo "master" --- --prevent-extra |
|
$ scummvm_core_branch: git -C <scummvm_core_build_dir> fetch origin && { git -C <scummvm_core_build_dir> branch --no-column --format '%(refname)' -a | sed '/HEAD detached at/d' | sed 's/^refs\/\(heads\|remotes\)\///g' | sort -n ; } || echo "main" --- --prevent-extra |
|
|
|
# scummvm core |
|
( \ |
|
cd "<scummvm_build_dir>"; \ |
|
[[ <use_debug> == t* ]] && DBG=1 || DBG=0; \ |
|
git-branch-pull -s "<scummvm_branch>"; \ |
|
cd "<scummvm_core_build_dir>"; \ |
|
make clean; \ |
|
git-branch-pull -m DEBUG=$DBG "<scummvm_core_branch>"; \ |
|
"<scummvm_core_dat_dir>"/bundle_aux_data.bash && 7z x -y -o"<retroarch_config_dir>"/system/ "<scummvm_core_dat_dir>"/scummvm.zip && cp -v "<scummvm_core_build_dir>"/scummvm_libretro.so "<retroarch_config_dir>"/cores/; printf "\a"; \ |
|
) |
|
|
|
# scummvm core (no git update) |
|
( \ |
|
cd "<scummvm_build_dir>"; \ |
|
[[ <use_debug> == t* ]] && DBG=1 || DBG=0; \ |
|
git-branch-pull -s; \ |
|
cd "<scummvm_core_build_dir>"; \ |
|
make clean; \ |
|
git-branch-pull -m DEBUG=$DBG; \ |
|
"<scummvm_core_dat_dir>"/bundle_aux_data.bash && 7z x -y -o"<retroarch_config_dir>"/system/ "<scummvm_core_dat_dir>"/scummvm.zip && cp -v "<scummvm_core_build_dir>"/scummvm_libretro.so "<retroarch_config_dir>"/cores/; printf "\a"; \ |
|
) |
|
|
|
$ ppsspp_renderer: echo "enable-opengl31 enable-gles2" | tr ' ' '\n' --- --prevent-extra |
|
$ ppsspp_root_dir: echo "$HOME/Documents/Projects/ppsspp" --- --prevent-extra |
|
$ ppsspp_branch: git -C <ppsspp_root_dir> fetch origin && { git -C <ppsspp_root_dir> branch --no-column --format '%(refname)' -a | sed '/HEAD detached at/d' | sed 's/^refs\/\(heads\|remotes\)\///g' | sort -n ; } || echo "master" --- --prevent-extra |
|
|
|
# ppsspp RA core |
|
; to build gles use -DUSING_GLES2 instead of -DHAVE_OPENGL_CORE on DYNAFLAGS (no =1 or =ON at the end) |
|
( \ |
|
export CORE="$HOME/.config/retroarch/cores/ppsspp_libretro.so"; \ |
|
export CORE_ASSETS="$HOME/.config/retroarch/system/PPSSPP"; \ |
|
cd <ppsspp_root_dir>/libretro; \ |
|
[[ <ppsspp_renderer> == enable-opengl* ]] && REN="-DHAVE_OPENGL_CORE" || REN="-DUSING_GLES2"; \ |
|
[[ <use_debug> == t* ]] && DBG=1 || DBG=0; \ |
|
git-branch-pull -m DEBUG=$DBG -m DYNAFLAGS="$REN" "<ppsspp_branch>" && gio trash -f "$CORE" && mv -fT ./ppsspp_libretro.so "$CORE" && chmod -x "$CORE" && rsync -a --delete <ppsspp_root_dir>/assets "$CORE_ASSETS"; \ |
|
printf "\a"; \ |
|
) |
|
|
|
# retroarch pull request |
|
( \ |
|
cd "<retroarch_build_dir>"; \ |
|
[[ <use_debug> == t* ]] && DBG=--enable-debug || DBG=; \ |
|
;fill these first just to push the branch info last like in the non-pr build |
|
echo "<discord><qt><ffmpeg><flac><wayland><kms><sdl2><x11><opengl><vulkan><cdrom>" &>/dev/null; \ |
|
;remove prefix |
|
PR="<retroarch_pr>"; \ |
|
PR="${PR:3}"; \ |
|
;PRs are always deleted locally then downloaded. This is much simpler to update than messing around with git config and fail all the time in unexpected situations |
|
git checkout master &>/dev/null; \ |
|
git branch -D "pr/$PR" &>/dev/null; \ |
|
git fetch origin "pull/$PR/head:pr/$PR" >/dev/null || { echo "failed fetching branch" >&2; printf "\a"; exit 1; }; \ |
|
git-branch-pull -c "$DBG" -c --<cdrom> -c --<discord> -c --<qt> -c --<ffmpeg> -c --<flac> -c --<wayland> -c --<kms> -c --<sdl2> -c --<x11> -c --<opengl> -c --<vulkan> -m TARGET=retroarch "pr/$PR"; \ |
|
printf "\a"; \ |
|
) |
|
|
|
$ ags_build_dir: echo "$HOME/Documents/Projects/ags/Engine" --- --prevent-extra |
|
$ ags_branch: git -C <ags_build_dir> fetch origin && { git -C <ags_build_dir> branch --no-column --format '%(refname)' -a | sed '/HEAD detached at/d' | sed 's/^refs\/\(heads\|remotes\)\///g' | sort -n ; } || echo "master" --- --prevent-extra |
|
$ ags_pr: git -C <ags_build_dir> ls-remote -q origin 'pull/*/head' 2>/dev/null | cut -f2 | sed -E 's/[^[:digit:]]*([[:digit:]]+)[^[:digit:]]+/pr\/\1/' | sort -rV --- --prevent-extra |
|
|
|
# ags |
|
( \ |
|
cd "<ags_build_dir>"; \ |
|
[[ <use_debug> == t* ]] && DBG=debug || DBG=ags; \ |
|
; ags uses sdl2_sound which is not packaged by distros, so i built it with checkinstall. It places the headers in this weird directory, which is probably why it's not packaged |
|
git-branch-pull -m $DBG -m CPATH=/usr/local/include/SDL2/ -m USE_BUILT_IN_LIBSRC=0 -m TARGET=ags "<ags_branch>"; printf "\a"; \ |
|
) |
|
|
|
# ags pull request |
|
( \ |
|
cd "<ags_build_dir>"; \ |
|
[[ <use_debug> == t* ]] && DBG=debug || DBG=ags; \ |
|
PR="<ags_pr>"; \ |
|
PR="${PR:3}"; \ |
|
git checkout master &>/dev/null; \ |
|
git branch -D "pr/$PR" &>/dev/null; \ |
|
git fetch origin "pull/$PR/head:pr/$PR" >/dev/null || { echo "failed fetching branch" >&2; printf "\a"; exit 1; }; \ |
|
git-branch-pull -m "$DBG" -m CPATH=/usr/local/include/SDL2/ -m USE_BUILT_IN_LIBSRC=1 -m TARGET=ags "pr/$PR"; printf "\a"; \ |
|
) |
|
|
|
$ pcsx2_build_dir: echo "$HOME/Documents/Projects/pcsx2-git" --- --prevent-extra |
|
$ pcsx2_branch: git -C <pcsx2_build_dir> fetch origin && { git -C <pcsx2_build_dir> branch --no-column --format '%(refname)' -a | sed '/HEAD detached at/d' | sed 's/^refs\/\(heads\|remotes\)\///g' | sort -n ; } || echo "master" --- --prevent-extra |
|
$ pcsx2_pr: git -C <pcsx2_build_dir> ls-remote -q origin 'pull/*/head' 2>/dev/null | cut -f2 | sed -E 's/[^[:digit:]]*([[:digit:]]+)[^[:digit:]]+/pr\/\1/' | sort -rV --- --prevent-extra |
|
|
|
# pcsx2 core |
|
( \ |
|
cd "<pcsx2_build_dir>"/build; \ |
|
export CORE="$HOME/.config/retroarch/cores/pcsx2-aliaspider_libretro.so"; \ |
|
export CORE_ASSETS="$HOME/.config/retroarch/system/pcsx2"; \ |
|
git-branch-pull "<pcsx2_branch>" && gio trash -f "$CORE" && mv -fT ./bin/pcsx2_libretro.so "$CORE" && chmod -x "$CORE"; \ |
|
rsync -a --delete "<pcsx2_build_dir>"/bin/resources "$CORE_ASSETS"; \ |
|
printf "\a"; \ |
|
) |
|
|
|
# pcsx2 core pull request |
|
( \ |
|
cd "<pcsx2_build_dir>"/build; \ |
|
export CORE="$HOME/.config/retroarch/cores/pcsx2-aliaspider_libretro.so"; \ |
|
export CORE_ASSETS="$HOME/.config/retroarch/system/pcsx2"; \ |
|
PR="<pcsx2_pr>"; \ |
|
PR="${PR:3}"; \ |
|
git checkout master &>/dev/null; \ |
|
git branch -D "pr/$PR" &>/dev/null; \ |
|
git fetch origin "pull/$PR/head:pr/$PR" >/dev/null || { echo "failed fetching branch" >&2; printf "\a"; exit 1; }; \ |
|
git-branch-pull "pr/$PR" && gio trash -f "$CORE" && mv -fT ./bin/pcsx2_libretro.so "$CORE" && chmod -x "$CORE"; \ |
|
rsync -a --delete "<pcsx2_build_dir>"/bin/resources "$CORE_ASSETS"; \ |
|
printf "\a"; \ |
|
) |