2015-02-14 01:55:27 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
# vim: set ts=3 sw=3 noet ft=sh : bash
|
2011-11-02 15:27:23 +00:00
|
|
|
|
2015-02-14 02:05:50 +00:00
|
|
|
SCRIPT="${0#./}"
|
|
|
|
BASE_DIR="${SCRIPT%/*}"
|
2015-02-22 00:55:31 +00:00
|
|
|
WORKDIR="$PWD"
|
2015-02-02 17:33:50 +00:00
|
|
|
|
2015-02-14 02:05:50 +00:00
|
|
|
if [ "$BASE_DIR" = "$SCRIPT" ]; then
|
|
|
|
BASE_DIR="$WORKDIR"
|
|
|
|
else
|
2015-02-15 22:34:42 +00:00
|
|
|
if [[ "$0" != /* ]]; then
|
|
|
|
# Make the path absolute
|
|
|
|
BASE_DIR="$WORKDIR/$BASE_DIR"
|
|
|
|
fi
|
2015-02-14 02:05:50 +00:00
|
|
|
fi
|
2015-02-02 17:33:50 +00:00
|
|
|
|
2015-02-22 00:55:31 +00:00
|
|
|
. "$BASE_DIR/libretro-config.sh"
|
2015-02-26 08:14:05 +00:00
|
|
|
. "$BASE_DIR/script-modules/util.sh"
|
2015-02-22 00:55:31 +00:00
|
|
|
. "$BASE_DIR/script-modules/fetch-rules.sh"
|
2013-05-01 02:11:22 +00:00
|
|
|
|
2015-02-25 02:38:00 +00:00
|
|
|
# Rules for fetching cores are in this file:
|
|
|
|
. "$BASE_DIR/core-rules.sh"
|
2015-02-02 04:24:14 +00:00
|
|
|
|
2015-02-21 08:55:22 +00:00
|
|
|
# libretro_fetch_core: Download the given core using its fetch rules
|
|
|
|
#
|
|
|
|
# $1 Name of the core to fetch
|
|
|
|
libretro_fetch_core() {
|
|
|
|
eval "core_name=\$libretro_${1}_name"
|
|
|
|
[ -z "$core_name" ] && core_name="$1"
|
|
|
|
echo "=== $core_name"
|
|
|
|
|
|
|
|
eval "core_fetch_rule=\$libretro_${1}_fetch_rule"
|
|
|
|
[ -z "$core_fetch_rule" ] && core_fetch_rule=fetch_git
|
|
|
|
|
|
|
|
eval "core_dir=\$libretro_${1}_dir"
|
|
|
|
[ -z "$core_dir" ] && core_dir="libretro-$1"
|
|
|
|
|
|
|
|
case "$core_fetch_rule" in
|
|
|
|
fetch_git)
|
|
|
|
eval "core_fetch_url=\$libretro_${1}_fetch_url"
|
|
|
|
if [ -z "$core_fetch_url" ]; then
|
|
|
|
echo "libretro_fetch_core:No URL set to fetch $1 via git."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
eval "core_git_submodules=\$libretro_${1}_git_submodules"
|
|
|
|
eval "core_git_submodules_update=\$libretro_${1}_git_submodules_update"
|
|
|
|
|
2015-02-26 08:14:05 +00:00
|
|
|
# TODO: Don't depend on fetch_rule being git
|
2015-02-21 08:55:22 +00:00
|
|
|
echo "Fetching ${1}..."
|
2015-02-26 08:14:05 +00:00
|
|
|
$core_fetch_rule "$core_fetch_url" "$core_dir" $core_git_submodules $core_git_submodules_update
|
2015-02-21 08:55:22 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "libretro_fetch_core:Unknown fetch rule for $1: \"$core_fetch_rule\"."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2015-02-21 09:16:30 +00:00
|
|
|
fetch_retroarch() {
|
2015-02-26 08:14:05 +00:00
|
|
|
echo "=== RetroArch"
|
|
|
|
echo "Fetching retroarch..."
|
|
|
|
fetch_git "https://github.com/libretro/RetroArch.git" "retroarch"
|
|
|
|
echo_cmd "cd \"$WORKDIR/retroarch\""
|
|
|
|
echo_cmd "./fetch-submodules.sh"
|
2015-02-02 04:24:14 +00:00
|
|
|
}
|
|
|
|
|
2015-02-23 23:37:45 +00:00
|
|
|
fetch_devkit() {
|
2015-02-26 08:14:05 +00:00
|
|
|
echo "=== libretro Developer's Kit"
|
|
|
|
echo "Fetching the libretro devkit..."
|
|
|
|
fetch_git "https://github.com/libretro/libretro-manifest.git" "libretro-manifest"
|
|
|
|
fetch_git "https://github.com/libretro/libretrodb.git" "libretrodb"
|
|
|
|
fetch_git "https://github.com/libretro/libretro-dat-pull.git" "libretro-dat-pull"
|
|
|
|
fetch_git "https://github.com/libretro/libretro-common.git" "libretro-common"
|
2015-02-19 05:55:56 +00:00
|
|
|
}
|
|
|
|
|
2015-02-14 01:55:27 +00:00
|
|
|
|
2015-02-18 07:17:47 +00:00
|
|
|
if [ -n "$1" ]; then
|
|
|
|
while [ -n "$1" ]; do
|
2015-02-21 08:55:22 +00:00
|
|
|
case "$1" in
|
2015-02-26 08:14:05 +00:00
|
|
|
fetch_retroarch|fetch_devkit)
|
|
|
|
# These don't have rule-based fetch yet.
|
|
|
|
$1
|
|
|
|
;;
|
2015-02-21 08:55:22 +00:00
|
|
|
fetch_libretro_*)
|
2015-02-21 09:16:30 +00:00
|
|
|
# "Old"-style
|
2015-02-21 08:55:22 +00:00
|
|
|
$1
|
|
|
|
;;
|
|
|
|
*)
|
2015-02-21 09:16:30 +00:00
|
|
|
# New style (just cores for now)
|
2015-02-21 08:55:22 +00:00
|
|
|
libretro_fetch_core $1
|
|
|
|
;;
|
|
|
|
esac
|
2015-02-14 01:27:24 +00:00
|
|
|
shift
|
|
|
|
done
|
2015-02-02 04:35:22 +00:00
|
|
|
else
|
2015-02-22 04:21:48 +00:00
|
|
|
libretro_fetch_core bsnes
|
2015-02-21 09:02:30 +00:00
|
|
|
libretro_fetch_core snes9x
|
|
|
|
libretro_fetch_core snes9x_next
|
|
|
|
libretro_fetch_core genesis_plus_gx
|
|
|
|
libretro_fetch_core fb_alpha
|
|
|
|
libretro_fetch_core vba_next
|
|
|
|
libretro_fetch_core vbam
|
|
|
|
libretro_fetch_core handy
|
|
|
|
libretro_fetch_core bnes
|
|
|
|
libretro_fetch_core fceumm
|
|
|
|
libretro_fetch_core gambatte
|
|
|
|
libretro_fetch_core meteor
|
|
|
|
libretro_fetch_core nxengine
|
|
|
|
libretro_fetch_core prboom
|
|
|
|
libretro_fetch_core stella
|
|
|
|
libretro_fetch_core desmume
|
|
|
|
libretro_fetch_core quicknes
|
|
|
|
libretro_fetch_core nestopia
|
|
|
|
libretro_fetch_core tyrquake
|
|
|
|
libretro_fetch_core pcsx_rearmed
|
|
|
|
libretro_fetch_core mednafen_gba
|
|
|
|
libretro_fetch_core mednafen_lynx
|
|
|
|
libretro_fetch_core mednafen_ngp
|
|
|
|
libretro_fetch_core mednafen_pce_fast
|
|
|
|
libretro_fetch_core mednafen_supergrafx
|
|
|
|
libretro_fetch_core mednafen_psx
|
|
|
|
libretro_fetch_core mednafen_pcfx
|
|
|
|
libretro_fetch_core mednafen_snes
|
|
|
|
libretro_fetch_core mednafen_vb
|
|
|
|
libretro_fetch_core mednafen_wswan
|
|
|
|
libretro_fetch_core scummvm
|
|
|
|
libretro_fetch_core yabause
|
|
|
|
libretro_fetch_core dosbox
|
|
|
|
libretro_fetch_core virtualjaguar
|
|
|
|
libretro_fetch_core mame078
|
|
|
|
libretro_fetch_core mame139
|
|
|
|
libretro_fetch_core mame
|
|
|
|
libretro_fetch_core ffmpeg
|
|
|
|
libretro_fetch_core bsnes_cplusplus98
|
|
|
|
libretro_fetch_core bsnes_mercury
|
|
|
|
libretro_fetch_core picodrive
|
|
|
|
libretro_fetch_core tgbdual
|
|
|
|
libretro_fetch_core mupen64plus
|
|
|
|
libretro_fetch_core dinothawr
|
|
|
|
libretro_fetch_core uae
|
|
|
|
libretro_fetch_core 3dengine
|
|
|
|
libretro_fetch_core remotejoy
|
|
|
|
libretro_fetch_core bluemsx
|
|
|
|
libretro_fetch_core fmsx
|
|
|
|
libretro_fetch_core 2048
|
|
|
|
libretro_fetch_core vecx
|
|
|
|
libretro_fetch_core ppsspp
|
|
|
|
libretro_fetch_core prosystem
|
|
|
|
libretro_fetch_core o2em
|
|
|
|
libretro_fetch_core 4do
|
|
|
|
libretro_fetch_core catsfc
|
|
|
|
libretro_fetch_core stonesoup
|
|
|
|
libretro_fetch_core hatari
|
|
|
|
libretro_fetch_core tempgba
|
|
|
|
libretro_fetch_core gpsp
|
|
|
|
libretro_fetch_core emux
|
|
|
|
libretro_fetch_core fuse
|
2015-02-26 05:59:18 +00:00
|
|
|
|
|
|
|
fetch_devkit
|
|
|
|
fetch_retroarch
|
2015-02-02 04:35:22 +00:00
|
|
|
fi
|