libretro-super/environment/psp-env.sh

85 lines
2.3 KiB
Bash
Raw Normal View History

2017-12-15 22:17:42 +00:00
display_usage() {
2017-12-15 22:27:57 +00:00
echo -e "\nSetup a RetroArch PSP build environment on Debian/Ubuntu or MSYS2 (MINGW64 only)"
2017-12-15 22:48:36 +00:00
echo -e "\nUsage: [install] [build] [export]\n"
echo -e "It will install the toolchain in /home/buildbot/tools\n"
echo -e "Arguments:\n"
echo -e "install:\n install or re(install) the toolchain"
echo -e "build:\n update the source tree and build everything"
echo -e "export:\n setup the environment for local building, run with source psp-env.sh"
2017-12-15 22:17:42 +00:00
}
2017-12-15 22:48:36 +00:00
fetch()
{
cd ~
if [ ! -d ~/libretro/psp ]; then
mkdir libretro
cd libretro
git clone https://github.com/libretro/libretro-super.git psp
fi
}
2017-12-15 22:17:42 +00:00
#!/bin/bash
2017-12-15 22:48:36 +00:00
platform=psp1
2017-12-15 22:17:42 +00:00
if [ "$1" = "install" ]; then
if [[ "$MSYSTEM" == *"MINGW64"* ]]; then
2017-12-15 22:48:36 +00:00
2017-12-15 22:17:42 +00:00
pacman -S git make p7zip tar wget
mkdir -p /home/buildbot/tools/devkitpro
cd /home/buildbot/tools/devkitpro
wget https://bot.libretro.com/.dev/psp/devkitPSP_r16-1-x86_64-win.tar.gz
tar zxvf devkitPSP_r16-1-x86_64-win.tar.gz
rm devkitPSP_r16-1-x86_64-win.tar.gz
2017-12-15 22:48:36 +00:00
fetch
2017-12-15 22:17:42 +00:00
else
2017-12-15 22:48:36 +00:00
sudo apt install build-essential git p7zip tar wget
2017-12-15 22:17:42 +00:00
mkdir -p tools/devkitpro
cd tools/devkitpro
wget https://bot.libretro.com/.dev/psp/devkitPSP_r16-1-x86_64-linux.tar.bz2
tar jxvf devkitPSP_r16-1-x86_64-linux.tar.bz2
rm devkitPSP_r16-1-x86_64-linux.tar.bz2
2017-12-15 22:48:36 +00:00
fetch
2017-12-15 22:17:42 +00:00
2017-12-15 22:48:36 +00:00
if [ ! -d "/home/buildbot/tools" ]; then
sudo mkdir -p /home/buildbot
sudo ln -s ~/tools /home/buildbot/tools
fi;
2017-12-15 22:17:42 +00:00
fi;
2017-12-15 22:48:36 +00:00
echo $platform environment ready...
2017-12-15 22:17:42 +00:00
fi;
if [ "$1" = "build" ]; then
2017-12-15 22:48:36 +00:00
if [ -d "/home/buildbot/tools/devkitpro/" ]; then
cd ~/libretro/psp
git pull
./libretro-buildbot-recipe.sh recipes/playstation/psp
else
echo $platform environment not found, run with install again...
fi
2017-12-15 22:17:42 +00:00
fi;
2017-12-15 22:23:16 +00:00
if [ "$1" = "export" ]; then
2017-12-15 22:48:36 +00:00
if [ -d "/home/buildbot/tools/devkitpro/" ]; then
export PATH=$PATH:/home/buildbot/tools/devkitpro/devkitPSP/bin/
export DEVKITPRO=/home/buildbot/tools/devkitpro/
export DEVKITPSP=/home/buildbot/tools/devkitpro/devkitPSP/
export platform=psp1
export PLATFORM=psp1
export CC=psp-gcc
export CXX=psp-g++
echo $platform environment ready...
else
echo $platform environment not found, run with install again...
fi;
2017-12-15 22:23:16 +00:00
fi
if [ $# -le 0 ]; then
2017-12-15 22:17:42 +00:00
display_usage
fi
2017-12-15 22:23:16 +00:00