From 77cbd3cc548d16b3577150cdb15655b918124269 Mon Sep 17 00:00:00 2001 From: Radius Date: Wed, 17 Dec 2014 13:32:42 -0500 Subject: [PATCH 1/4] make sure RA PSP only builds when there are changes --- libretro-buildbot-recipe.sh | 114 +++++++++++++++++++++++++++++++----- recipes/recipes.pspsdk.conf | 2 +- recipes/recipes.pspsdk.ra | 2 + 3 files changed, 102 insertions(+), 16 deletions(-) create mode 100644 recipes/recipes.pspsdk.ra diff --git a/libretro-buildbot-recipe.sh b/libretro-buildbot-recipe.sh index c1de4b87..c88c8e03 100644 --- a/libretro-buildbot-recipe.sh +++ b/libretro-buildbot-recipe.sh @@ -397,7 +397,7 @@ while read line; do ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" - echo ARGS: $ARGS + echo ARGS: $ARGS echo echo @@ -451,7 +451,7 @@ while read line; do then BUILD="NO" else - BUILD="YES" + BUILD="YES" fi cd .. @@ -462,7 +462,7 @@ while read line; do git checkout $TYPE cd .. BUILD="YES" - fi + fi elif [ "${TYPE}" == "SUBMODULE" ]; then @@ -514,7 +514,6 @@ while read line; do PREVCORE=$NAME PREVBUILD=$BUILD - done < $1 echo "Building RetroArch" @@ -523,18 +522,103 @@ echo ============================================ if [ "${PLATFORM}" == "psp1" ]; then - cd retroarch - git pull - rm -rfv psp1/pkg/ - cd dist-scripts - rm *.a - cp -v $RARCH_DIST_DIR/* . - sh ./psp1-cores.sh - - - + while read line; do + + NAME=`echo $line | cut --fields=1 --delimiter=" "` + DIR=`echo $line | cut --fields=2 --delimiter=" "` + URL=`echo $line | cut --fields=3 --delimiter=" "` + TYPE=`echo $line | cut --fields=4 --delimiter=" "` + ENABLED=`echo $line | cut --fields=5 --delimiter=" "` + SUBDIR=`echo $line | cut --fields=8 --delimiter=" "` + + if [ "${ENABLED}" == "YES" ]; + then + echo "Processing $NAME" + echo ============================================ + echo NAME: $NAME + echo DIR: $DIR + echo SUBDIR: $SUBDIR + echo URL: $URL + echo REPO TYPE: $TYPE + echo ENABLED: $ENABLED + + ARGS="" + + TEMP=`echo $line | cut --fields=9 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=10 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=11 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=12 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=13 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=14 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + + ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" + + echo ARGS: $ARGS + + if [ -d "${DIR}/.git" ]; + then + + cd $DIR + echo "pulling from repo... " + OUT=`git pull` + if [[ $OUT == *"Already up-to-date"* ]] + then + BUILD="NO" + else + BUILD="YES" + fi + cd .. + + else + echo "cloning repo..." + git clone "$URL" "$DIR" + cd $DIR + BUILD="YES" + cd .. + fi + fi + + if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; + then + cd $DIR + rm -rfv psp1/pkg/ + cd dist-scripts + rm *.a + cp -v $RARCH_DIST_DIR/* . + sh ./psp1-cores.sh + fi + + done < $1.ra fi - PATH=$ORIGPATH diff --git a/recipes/recipes.pspsdk.conf b/recipes/recipes.pspsdk.conf index 72f71754..32d65319 100644 --- a/recipes/recipes.pspsdk.conf +++ b/recipes/recipes.pspsdk.conf @@ -1,4 +1,4 @@ -PATH /c/Toolchains/pspsdk/bin +PATH /c/Toolchains/devkitPro/devkitPSP/bin/ platform psp1 CC psp-gcc CXX psp-g++ diff --git a/recipes/recipes.pspsdk.ra b/recipes/recipes.pspsdk.ra new file mode 100644 index 00000000..58520036 --- /dev/null +++ b/recipes/recipes.pspsdk.ra @@ -0,0 +1,2 @@ +retroarch retroarch https://github.com/libretro/Retroarch.git PROJECT YES . + From d9445671245265f8be9fe7954200a3011e0ba52d Mon Sep 17 00:00:00 2001 From: Radius Date: Wed, 17 Dec 2014 13:55:44 -0500 Subject: [PATCH 2/4] fix --- recipes/recipes.pspsdk.ra | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/recipes.pspsdk.ra b/recipes/recipes.pspsdk.ra index 58520036..96f2ab66 100644 --- a/recipes/recipes.pspsdk.ra +++ b/recipes/recipes.pspsdk.ra @@ -1,2 +1 @@ retroarch retroarch https://github.com/libretro/Retroarch.git PROJECT YES . - From 74b96d8cd8aef356448c2c4ffa18491ecb473c1b Mon Sep 17 00:00:00 2001 From: Radius Date: Wed, 17 Dec 2014 13:56:09 -0500 Subject: [PATCH 3/4] add Verbose OUT of git output --- libretro-buildbot-recipe.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/libretro-buildbot-recipe.sh b/libretro-buildbot-recipe.sh index c88c8e03..58a92d21 100644 --- a/libretro-buildbot-recipe.sh +++ b/libretro-buildbot-recipe.sh @@ -590,6 +590,7 @@ then cd $DIR echo "pulling from repo... " OUT=`git pull` + echo $OUT if [[ $OUT == *"Already up-to-date"* ]] then BUILD="NO" From b03f10e905bdb191ab1e9835db24a5dd2419300f Mon Sep 17 00:00:00 2001 From: Radius Date: Wed, 17 Dec 2014 18:59:08 -0500 Subject: [PATCH 4/4] android APK build script --- libretro-buildbot-recipe.sh | 145 ++++++++++++++++++++++++++++++++++- recipes/recipes-android.conf | 7 ++ recipes/recipes-android.ra | 4 + 3 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 recipes/recipes-android.conf create mode 100644 recipes/recipes-android.ra diff --git a/libretro-buildbot-recipe.sh b/libretro-buildbot-recipe.sh index 58a92d21..61f78f33 100644 --- a/libretro-buildbot-recipe.sh +++ b/libretro-buildbot-recipe.sh @@ -12,6 +12,7 @@ echo "Setting up Environment for $1" echo ============================================ ORIGPATH=$PATH +WORK=$PWD echo Original PATH: $PATH @@ -457,7 +458,7 @@ while read line; do else echo "cloning repo..." - git clone "$URL" "$DIR" + git clone "$URL" "$DIR" --depth=1 cd $DIR git checkout $TYPE cd .. @@ -518,6 +519,8 @@ done < $1 echo "Building RetroArch" echo ============================================ +cd $WORK +BUILD="" if [ "${PLATFORM}" == "psp1" ]; then @@ -601,7 +604,7 @@ then else echo "cloning repo..." - git clone "$URL" "$DIR" + git clone "$URL" "$DIR" --depth=1 cd $DIR BUILD="YES" cd .. @@ -620,6 +623,144 @@ then done < $1.ra +fi + +if [ "${PLATFORM}" == "ndk" ]; +then + + while read line; do + + NAME=`echo $line | cut --fields=1 --delimiter=" "` + DIR=`echo $line | cut --fields=2 --delimiter=" "` + URL=`echo $line | cut --fields=3 --delimiter=" "` + TYPE=`echo $line | cut --fields=4 --delimiter=" "` + ENABLED=`echo $line | cut --fields=5 --delimiter=" "` + PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "` + + if [ "${ENABLED}" == "YES" ]; + then + echo "Processing $NAME" + echo ============================================ + echo NAME: $NAME + echo DIR: $DIR + echo PARENT: $PARENTDIR + echo URL: $URL + echo REPO TYPE: $TYPE + echo ENABLED: $ENABLED + + ARGS="" + + TEMP=`echo $line | cut --fields=9 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=10 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=11 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=12 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=13 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + TEMP="" + TEMP=`echo $line | cut --fields=14 --delimiter=" "` + if [ -n ${TEMP} ]; + then + ARGS="${ARGS} ${TEMP}" + fi + + ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" + + echo ARGS: $ARGS + + if [ -d "${PARENTDIR}/${DIR}/.git" ]; + then + cd $PARENTDIR + cd $DIR + echo "pulling from repo... " + OUT=`git pull` + echo $OUT + if [ "${TYPE}" == "PROJECT" ]; + then + RADIR=$DIR + if [[ $OUT == *"Already up-to-date"* ]] + then + BUILD="NO" + else + BUILD="YES" + fi + fi + cd $WORK + + else + echo "cloning repo..." + cd $PARENTDIR + git clone "$URL" "$DIR" --depth=1 + cd $DIR + if [ "${TYPE}" == "PROJECT" ]; + then + BUILD="YES" + fi + cd $WORK + fi + fi + + echo + echo + done < $1.ra + if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; + then + echo "Compiling Shaders" + echo ============================================ + + cd $RADIR + $MAKE -f Makefile.griffin shaders-convert-glsl PYTHON3=$PYTHON + + echo "Processing Assets" + echo ============================================ + + rm -Rv android/phoenix/assets/overlays + cp -Rv media/overlays android/phoenix/assets/ + rm -Rv android/phoenix/assets/shaders_glsl + cp -Rv media/shaders_glsl android/phoenix/assets/ + rm -Rv android/phoenix/assets/autoconfig + cp -Rv media/autoconfig android/phoenix/assets/ + rm -Rv android/phoenix/assets/info + cp -Rv $RARCH_DIR/info android/phoenix/assets/ + + echo "Building" + echo ============================================ + + cd android/phoenix + rm bin/*.apk + android.bat update project --path . --target android-21 + android.bat update project --path libs/googleplay --target android-21 + android.bat update project --path libs/appcompat --target android-21 + + ant clean + ant debug + fi + + + + fi PATH=$ORIGPATH diff --git a/recipes/recipes-android.conf b/recipes/recipes-android.conf new file mode 100644 index 00000000..83403830 --- /dev/null +++ b/recipes/recipes-android.conf @@ -0,0 +1,7 @@ +ANDROID_HOME /c/Toolchains/android/ +NDK_ROOT /c/Toolchains/android/ndk/ +ANDROID_NDK /c/Toolchains/android/ndk/ +PATH /c/Toolchains/android/ant/bin:/c/Toolchains/android/ndk:/c/Toolchains/android/tools:/c/Toolchains/jdk/bin:/c/Toolchains/tools/cg/bin +PLATFORM ndk +MAKE make +PYTHON /c/Toolchains/python3/python.exe diff --git a/recipes/recipes-android.ra b/recipes/recipes-android.ra new file mode 100644 index 00000000..b5bdf52d --- /dev/null +++ b/recipes/recipes-android.ra @@ -0,0 +1,4 @@ +retroarch retroarch https://github.com/libretro/Retroarch.git PROJECT YES . +overlays overlays https://github.com/libretro/common-overlays.git ASSETS YES retroarch/media +shaders shaders_cg https://github.com/libretro/common-shaders.git ASSETS YES retroarch/media +autoconfig autoconfig https://github.com/libretro/retroarch-joypad-autoconfig.git ASSETS YES retroarch/media