diff --git a/libretro-buildbot-recipe.sh b/libretro-buildbot-recipe.sh index c756a51e..5a962d2a 100755 --- a/libretro-buildbot-recipe.sh +++ b/libretro-buildbot-recipe.sh @@ -20,8 +20,7 @@ while read line; do KEY=`echo $line | cut --fields=1 --delimiter=" "` VALUE=`echo $line | cut --fields=2 --delimiter=" "` - if [ "${KEY}" == "PATH" ]; - then + if [ "${KEY}" = "PATH" ]; then export PATH=${VALUE}:${ORIGPATH} echo New PATH: $PATH @@ -29,7 +28,7 @@ while read line; do export ${KEY}=${VALUE} echo $KEY: $VALUE fi -done < $1.conf +done < $1.conf echo echo @@ -49,8 +48,7 @@ read_link() TARGET_FILE="$1" cd $(dirname "$TARGET_FILE") TARGET_FILE=$(basename "$TARGET_FILE") - while [ -L "$TARGET_FILE" ] - do + while [ -L "$TARGET_FILE" ]; do TARGET_FILE=$(readlink "$TARGET_FILE") cd $(dirname "$TARGET_FILE") TARGET_FILE=$(basename "$TARGET_FILE") @@ -70,18 +68,17 @@ fi mkdir -v -p "$RARCH_DIST_DIR" -if [ "${PLATFORM}" == "android" ]; -then +if [ "${PLATFORM}" = "android" ]; then -IFS=' ' read -ra ABIS <<< "$TARGET_ABIS" - for a in "${ABIS[@]}"; do + IFS=' ' read -ra ABIS <<< "$TARGET_ABIS" + for a in "${ABIS[@]}"; do echo $a if [ -d $RARCH_DIST_DIR/${a} ]; then echo "Directory $RARCH_DIST_DIR/${a} already exists, skipping creation..." else mkdir $RARCH_DIST_DIR/${a} fi - done + done fi if [ "$HOST_CC" ]; then @@ -93,7 +90,7 @@ fi if [ -z "$MAKE" ]; then - if uname -s | grep -i MINGW32 > /dev/null 2>&1; then + if uname -s | grep -i MINGW32 > /dev/null 2>&1; then MAKE=mingw32-make else if type gmake > /dev/null 2>&1; then @@ -101,37 +98,37 @@ if [ -z "$MAKE" ]; then else MAKE=make fi - fi + fi fi if [ -z "$CC" ]; then - if [ $FORMAT_COMPILER_TARGET = "osx" ]; then + if [ $FORMAT_COMPILER_TARGET = "osx" ]; then CC=cc - elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then + elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then CC=mingw32-gcc - else + else CC=gcc - fi + fi fi if [ -z "$CXX" ]; then - if [ $FORMAT_COMPILER_TARGET = "osx" ]; then + if [ $FORMAT_COMPILER_TARGET = "osx" ]; then CXX=c++ CXX11="clang++ -std=c++11 -stdlib=libc++" - elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then + elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then CXX=mingw32-g++ CXX11=mingw32-g++ - else + else CXX=g++ CXX11=g++ - fi + fi fi if [ "${CC}" ] && [ "${CXX}" ]; then - COMPILER="CC=${CC} CXX=${CXX}" + COMPILER="CC=${CC} CXX=${CXX}" else - COMPILER="" + COMPILER="" fi echo @@ -148,7 +145,7 @@ RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT check_opengl() { - if [ "${BUILD_LIBRETRO_GL}" ]; then + if [ "${BUILD_LIBRETRO_GL}" ]; then if [ "${ENABLE_GLES}" ]; then echo '=== OpenGL ES enabled ===' export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-gles" @@ -158,14 +155,14 @@ check_opengl() { export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-opengl" export FORMAT_COMPILER_TARGET_ALT="${FORMAT_COMPILER_TARGET}" fi - else + else echo '=== OpenGL disabled in build ===' - fi + fi } reset_compiler_targets() { - export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET - export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT + export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET + export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT } @@ -197,20 +194,17 @@ build_libretro_generic_makefile() { cd $SUBDIR OLDJ=$JOBS - if [ "${NAME}" == "mame078" ]; - then - JOBS=1 + if [ "${NAME}" = "mame078" ]; then + JOBS=1 fi - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean" - ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean - if [ $? -eq 0 ]; - then + ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -218,23 +212,20 @@ build_libretro_generic_makefile() { fi echo "compiling..." - if [ -z "${ARGS}" ] - then + if [ -z "${ARGS}" ]; then echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} else - if [ "${NAME}" == "mame2010" ]; - then + if [ "${NAME}" = "mame2010" ]; then - echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}" buildtools + echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}" buildtools ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} buildtools fi echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" if [ "${MAKEPORTABLE}" == "YES" ]; then @@ -268,13 +259,11 @@ build_libretro_generic_theos() { ln -s $THEOS theos - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean" - ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean - if [ $? -eq 0 ]; - then + ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -282,8 +271,7 @@ build_libretro_generic_theos() { fi echo "compiling..." - if [ -z "${ARGS}" ] - then + if [ -z "${ARGS}" ]; then echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} else @@ -291,8 +279,7 @@ build_libretro_generic_theos() { ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v objs/obj/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} else @@ -317,13 +304,11 @@ build_libretro_generic_jni() { cd ${DIR}/${SUBDIR} for a in "${ABIS[@]}"; do - if [ -z "${NOCLEAN}" ]; - then + if [ -z "${NOCLEAN}" ]; then echo "cleaning up..." echo "cleanup command: ${NDK} -j${JOBS} ${ARGS} APP_ABI=${a} clean" ${NDK} -j${JOBS} ${ARGS} APP_ABI=${a} clean - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $a $1 cleanup success! else echo BUILDBOT JOB: $jobid $a $1 cleanup failure! @@ -331,16 +316,14 @@ build_libretro_generic_jni() { fi echo "compiling for ${a}..." - if [ -z "${ARGS}" ] - then + if [ -z "${ARGS}" ]; then echo "build command: ${NDK} -j${JOBS} APP_ABI=${a}" ${NDK} -j${JOBS} APP_ABI=${a} else echo "build command: ${NDK} -j${JOBS} APP_ABI=${a} ${ARGS} " ${NDK} -j${JOBS} APP_ABI=${a} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1-$a build successful ($jobid)" echo BUILDBOT JOB: $MESSAGE buildbot_log "$MESSAGE" @@ -372,30 +355,26 @@ build_libretro_bsnes_jni() { cd ${DIR}/${SUBDIR} for a in "${ABIS[@]}"; do - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." - echo "cleanup command: ${NDK} -j${JOBS} APP_ABI=${a} clean" + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." + echo "cleanup command: ${NDK} -j${JOBS} APP_ABI=${a} clean" ${NDK} -j${JOBS} APP_ABI=${a} clean - if [ $? -eq 0 ]; - then - echo BUILDBOT JOB: $jobid $1 cleanup success! - else - echo BUILDBOT JOB: $jobid $1 cleanup failure! - fi + if [ $? -eq 0 ]; then + echo BUILDBOT JOB: $jobid $1 cleanup success! + else + echo BUILDBOT JOB: $jobid $1 cleanup failure! + fi fi - echo "compiling for ${a}..." - if [ -z "${ARGS}" ] - then + echo "compiling for ${a}..." + if [ -z "${ARGS}" ]; then echo "build command: ${NDK} -j${JOBS} APP_ABI=${a}" ${NDK} -j${JOBS} APP_ABI=${a} else echo "build command: ${NDK} -j${JOBS} APP_ABI=${a}" ${NDK} -j${JOBS} APP_ABI=${a} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v ../libs/${a}/libretro_${CORENAME}_${PROFILE}.${FORMAT_EXT} $RARCH_DIST_DIR/${a}/${NAME}_${PROFILE}_libretro${FORMAT}.${FORMAT_EXT} else @@ -424,13 +403,11 @@ build_libretro_generic_gl_makefile() { cd $DIR cd $SUBDIR - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean" - ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean - if [ $? -eq 0 ]; - then + ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -438,8 +415,7 @@ build_libretro_generic_gl_makefile() { fi echo "compiling..." - if [ -z "${ARGS}" ]; - then + if [ -z "${ARGS}" ]; then echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} else @@ -447,8 +423,7 @@ build_libretro_generic_gl_makefile() { ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v ${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} else @@ -477,22 +452,19 @@ build_libretro_bsnes() { cd $DIR - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." rm -f obj/*.{o,"${FORMAT_EXT}"} rm -f out/*.{o,"${FORMAT_EXT}"} - if [ "${PROFILE}" == "cpp98" -o "${PROFILE}" == "bnes" ]; - then - ${MAKE} clean - fi + if [ "${PROFILE}" = "cpp98" -o "${PROFILE}" = "bnes" ]; then + ${MAKE} clean + fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -502,11 +474,9 @@ build_libretro_bsnes() { echo "compiling..." - if [ "${PROFILE}" == "cpp98" ]; - then + if [ "${PROFILE}" = "cpp98" ]; then ${MAKE} platform="${PLATFORM}" ${COMPILER} "-j${JOBS}" - elif [ "${PROFILE}" == "bnes" ]; - then + elif [ "${PROFILE}" = "bnes" ]; then echo "build command: ${MAKE} -f Makefile ${COMPILER} "-j${JOBS}" compiler=${BSNESCOMPILER}" platform=${FORMAT_COMPILER_TARGET} ${MAKE} -f Makefile ${COMPILER} "-j${JOBS}" compiler="${BSNESCOMPILER}" platform=${FORMAT_COMPILER_TARGET} else @@ -514,17 +484,14 @@ build_libretro_bsnes() { ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} compiler=${BSNESCOMPILER} ui='target-libretro' profile=${PROFILE} -j${JOBS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" - if [ "${PROFILE}" == "cpp98" ]; - then + if [ "${PROFILE}" = "cpp98" ]; then cp -fv "out/libretro.${FORMAT_EXT}" "${RARCH_DIST_DIR}/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}" - elif [ "${PROFILE}" == "bnes" ]; - then + elif [ "${PROFILE}" = "bnes" ]; then cp -fv "libretro.${FORMAT_EXT}" "${RARCH_DIST_DIR}/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}" else - cp -fv "out/${NAME}_${PROFILE}_libretro$FORMAT.${FORMAT_EXT}" $RARCH_DIST_DIR/${NAME}_${PROFILE}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} + cp -fv "out/${NAME}_libretro$FORMAT.${FORMAT_EXT}" $RARCH_DIST_DIR/${NAME}_${PROFILE}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} fi else MESSAGE="$1 build failure ($jobid)" @@ -552,8 +519,7 @@ while read line; do MAKEFILE=`echo $line | cut --fields=7 --delimiter=" "` SUBDIR=`echo $line | cut --fields=8 --delimiter=" "` - if [ "${ENABLED}" == "YES" ]; - then + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" echo echo URL: $URL @@ -568,73 +534,64 @@ while read line; do ARGS="" TEMP=`echo $line | cut --fields=9 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi - ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" + ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" echo ARGS: $ARGS echo echo - if [ "${TYPE}" == "PROJECT" ]; - then - if [ -d "${DIR}/.git" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then + if [ -d "${DIR}/.git" ]; then cd $DIR echo "pulling from repo... " OUT=`git pull` - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" fi - if [ "${PREVCORE}" == "bsnes" -a "${PREVBUILD}" == "YES" -a "${COMMAND}" == "BSNES" ]; then + if [ "${PREVCORE}" = "bsnes" -a "${PREVBUILD}" = "YES" -a "${COMMAND}" = "BSNES" ]; then FORCE="YES" BUILD="YES" fi - if [ "${PREVCORE}" == "mame" -a "${PREVBUILD}" == "YES" -a "${NAME}" == "mess" ]; then + if [ "${PREVCORE}" = "mame" -a "${PREVBUILD}" = "YES" -a "${NAME}" = "mess" ]; then FORCE="YES" BUILD="YES" fi - if [ "${PREVCORE}" == "mess" -a "${PREVBUILD}" == "YES" -a "${NAME}" == "ume" ]; then + if [ "${PREVCORE}" = "mess" -a "${PREVBUILD}" = "YES" -a "${NAME}" = "ume" ]; then FORCE="YES" BUILD="YES" fi @@ -647,16 +604,13 @@ while read line; do git clone --depth=1 "$URL" "$DIR" BUILD="YES" fi - elif [ "${TYPE}" == "psp_hw_render" ]; - then - if [ -d "${DIR}/.git" ]; - then + elif [ "${TYPE}" = "psp_hw_render" ]; then + if [ -d "${DIR}/.git" ]; then cd $DIR echo "pulling from repo... " OUT=`git pull` - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" @@ -672,16 +626,13 @@ while read line; do BUILD="YES" fi - elif [ "${TYPE}" == "SUBMODULE" ]; - then - if [ -d "${DIR}/.git" ]; - then + elif [ "${TYPE}" == "SUBMODULE" ]; then + if [ -d "${DIR}/.git" ]; then cd $DIR echo "pulling from repo... " OUT=`git pull` - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" @@ -698,28 +649,26 @@ while read line; do cd .. fi - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then echo building core... - if [ "${COMMAND}" == "GENERIC" ]; then + if [ "${COMMAND}" = "GENERIC" ]; then build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_GL" ]; then + elif [ "${COMMAND}" = "GENERIC_GL" ]; then build_libretro_generic_gl_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_ALT" ]; then + elif [ "${COMMAND}" = "GENERIC_ALT" ]; then build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_JNI" ]; then + elif [ "${COMMAND}" = "GENERIC_JNI" ]; then build_libretro_generic_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "BSNES_JNI" ]; then + elif [ "${COMMAND}" = "BSNES_JNI" ]; then build_libretro_bsnes_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_THEOS" ]; then + elif [ "${COMMAND}" = "GENERIC_THEOS" ]; then build_libretro_generic_theos $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "BSNES" ]; then + elif [ "${COMMAND}" = "BSNES" ]; then build_libretro_bsnes $NAME $DIR "${ARGS}" $MAKEFILE ${FORMAT_COMPILER_TARGET} ${CXX11} - + fi + else + echo BUILDBOT JOB: $jobid $NAME already up-to-date... fi - else - echo BUILDBOT JOB: $jobid $NAME already up-to-date... - fi echo fi @@ -728,15 +677,14 @@ while read line; do PREVCORE=$NAME PREVBUILD=$BUILD -done < $1 +done < $1 echo "BUILDBOT JOB: $jobid Building Retroarch" echo cd $WORK BUILD="" -if [ "${PLATFORM}" == "android" ] && [ "${RA}" == "YES" ]; -then +if [ "${PLATFORM}" = "android" ] && [ "${RA}" = "YES" ]; then while read line; do @@ -747,8 +695,7 @@ then ENABLED=`echo $line | cut --fields=5 --delimiter=" "` PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "` - if [ "${ENABLED}" == "YES" ]; - then + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" echo echo NAME: $NAME @@ -761,38 +708,32 @@ then ARGS="" TEMP=`echo $line | cut --fields=9 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi @@ -800,18 +741,15 @@ then echo ARGS: $ARGS - if [ -d "${PARENTDIR}/${DIR}/.git" ]; - then + if [ -d "${PARENTDIR}/${DIR}/.git" ]; then cd $PARENTDIR cd $DIR echo "pulling from repo... " OUT=`git pull` echo $OUT - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then RADIR=$DIR - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" @@ -824,8 +762,7 @@ then cd $PARENTDIR git clone "$URL" "$DIR" --depth=1 cd $DIR - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then BUILD="YES" RADIR=$DIR @@ -836,61 +773,58 @@ then echo echo - done < $1.ra - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + done < $1.ra + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Compiling Shaders" echo - echo RADIR $RADIR - cd $RADIR - $MAKE -f Makefile.griffin shaders-convert-glsl PYTHON3=$PYTHON + echo RADIR $RADIR + cd $RADIR + $MAKE -f Makefile.griffin shaders-convert-glsl PYTHON3=$PYTHON - echo "BUILDBOT JOB: $jobid Processing Assets" - echo + echo "BUILDBOT JOB: $jobid Processing Assets" + echo - mkdir -p android/phoenix/assets/ - rm -Rfv android/phoenix/assets/assets - cp -Rfv media/assets android/phoenix/assets/ - rm -Rfv android/phoenix/assets/libretrodb - cp -Rfv media/libretrodb android/phoenix//assets/libretrodb/ - rm -Rfv android/phoenix/assets/overlays - cp -Rfv media/overlays android/phoenix/assets/ - rm -Rfv android/phoenix/assets/shaders_glsl - cp -Rfv media/shaders_glsl android/phoenix/assets/ - rm -Rfv android/phoenix/assets/autoconfig - cp -Rfv media/autoconfig android/phoenix/assets/ - rm -Rfv android/phoenix/assets/info - cp -Rfv $RARCH_DIR/info android/phoenix/assets/ + mkdir -p android/phoenix/assets/ + rm -Rfv android/phoenix/assets/assets + cp -Rfv media/assets android/phoenix/assets/ + rm -Rfv android/phoenix/assets/libretrodb + cp -Rfv media/libretrodb android/phoenix//assets/libretrodb/ + rm -Rfv android/phoenix/assets/overlays + cp -Rfv media/overlays android/phoenix/assets/ + rm -Rfv android/phoenix/assets/shaders_glsl + cp -Rfv media/shaders_glsl android/phoenix/assets/ + rm -Rfv android/phoenix/assets/autoconfig + cp -Rfv media/autoconfig android/phoenix/assets/ + rm -Rfv android/phoenix/assets/info + cp -Rfv $RARCH_DIR/info android/phoenix/assets/ - echo "BUILDBOT JOB: $jobid Building" - echo - cd android/phoenix - rm bin/*.apk + echo "BUILDBOT JOB: $jobid Building" + echo + cd android/phoenix + rm bin/*.apk - $NDK clean - $NDK -j${JOBS} - ant clean - android update project --path . --target android-21 - android update project --path libs/googleplay --target android-21 - android update project --path libs/appcompat --target android-21 - ant debug - if [ $? -eq 0 ]; - then - MESSAGE="retroarch build successful ($jobid)" - echo $MESSAGE + $NDK clean + $NDK -j${JOBS} + ant clean + android update project --path . --target android-21 + android update project --path libs/googleplay --target android-21 + android update project --path libs/appcompat --target android-21 + ant debug + if [ $? -eq 0 ]; then + MESSAGE="retroarch build successful ($jobid)" + echo $MESSAGE else - MESSAGE="retroarch buildf failed ($jobid)" - echo $MESSAGE + MESSAGE="retroarch buildf failed ($jobid)" + echo $MESSAGE fi - buildbot_log "$MESSAGE" + buildbot_log "$MESSAGE" fi fi -if [ "${PLATFORM}" == "theos_ios" ] && [ "${RA}" == "YES" ]; -then +if [ "${PLATFORM}" = "theos_ios" ] && [ "${RA}" = "YES" ]; then while read line; do @@ -901,8 +835,7 @@ then ENABLED=`echo $line | cut --fields=5 --delimiter=" "` PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "` - if [ "${ENABLED}" == "YES" ]; - then + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" echo echo NAME: $NAME @@ -915,38 +848,32 @@ then ARGS="" TEMP=`echo $line | cut --fields=9 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi @@ -954,18 +881,15 @@ then echo ARGS: $ARGS - if [ -d "${PARENTDIR}/${DIR}/.git" ]; - then + if [ -d "${PARENTDIR}/${DIR}/.git" ]; then cd $PARENTDIR cd $DIR echo "pulling from repo... " OUT=`git pull` echo $OUT - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then RADIR=$DIR - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" @@ -978,8 +902,7 @@ then cd $PARENTDIR git clone "$URL" "$DIR" --depth=1 cd $DIR - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then BUILD="YES" RADIR=$DIR @@ -990,9 +913,8 @@ then echo echo - done < $1.ra - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + done < $1.ra + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Compiling Shaders" echo @@ -1027,8 +949,7 @@ then fi -if [ "${PLATFORM}" == "MINGW64" ] || [ "${PLATFORM}" == "MINGW32" ] && [ "${RA}" == "YES" ]; -then +if [ "${PLATFORM}" = "MINGW64" ] || [ "${PLATFORM}" = "MINGW32" ] && [ "${RA}" = "YES" ]; then while read line; do @@ -1039,8 +960,7 @@ then ENABLED=`echo $line | cut --fields=5 --delimiter=" "` PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "` - if [ "${ENABLED}" == "YES" ]; - then + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" echo echo NAME: $NAME @@ -1059,32 +979,27 @@ then fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi @@ -1092,18 +1007,15 @@ then echo ARGS: $ARGS - if [ -d "${PARENTDIR}/${DIR}/.git" ]; - then + if [ -d "${PARENTDIR}/${DIR}/.git" ]; then cd $PARENTDIR cd $DIR echo "pulling from repo... " OUT=`git pull` echo $OUT - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then RADIR=$DIR - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" @@ -1116,8 +1028,7 @@ then git clone "$URL" "$DIR" --depth=1 cd $DIR - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then BUILD="YES" RADIR=$DIR @@ -1128,9 +1039,8 @@ then echo echo - done < $1.ra - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + done < $1.ra + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then cd $RADIR echo "BUILDBOT JOB: $jobid Building" @@ -1140,8 +1050,7 @@ then cd audio/audio_filters echo "audio filter build command: ${MAKE}" $MAKE - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid audio filter build success! else echo BUILDBOT JOB: $jobid audio filter build failure! @@ -1154,8 +1063,7 @@ then cd gfx/video_filters echo "audio filter build command: ${MAKE}" $MAKE - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid video filter build success! else echo BUILDBOT JOB: $jobid video filter build failure! @@ -1168,8 +1076,7 @@ then echo "cleanup command: $MAKE clean" $MAKE clean - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid retroarch cleanup success! else echo BUILDBOT JOB: $jobid retroarch cleanup failure! @@ -1179,8 +1086,7 @@ then echo "configure command: $CONFIGURE" ${CONFIGURE} - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid retroarch configure success! else echo BUILDBOT JOB: $jobid retroarch configure failure! @@ -1190,8 +1096,7 @@ then echo "build command: $MAKE -j${JOBS}" $MAKE -j${JOBS} - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="retroarch build successful ($jobid)" echo $MESSAGE buildbot_log "$MESSAGE" @@ -1269,8 +1174,7 @@ EOF fi -if [ "${PLATFORM}" == "psp1" ] && [ "${RA}" == "YES" ]; -then +if [ "${PLATFORM}" = "psp1" ] && [ "${RA}" = "YES" ]; then while read line; do @@ -1281,8 +1185,7 @@ then ENABLED=`echo $line | cut --fields=5 --delimiter=" "` PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "` - if [ "${ENABLED}" == "YES" ]; - then + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" echo echo NAME: $NAME @@ -1295,38 +1198,32 @@ then ARGS="" TEMP=`echo $line | cut --fields=9 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi @@ -1334,18 +1231,15 @@ then echo ARGS: $ARGS - if [ -d "${PARENTDIR}/${DIR}/.git" ]; - then + if [ -d "${PARENTDIR}/${DIR}/.git" ]; then cd $PARENTDIR cd $DIR echo "pulling from repo... " OUT=`git pull` echo $OUT - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then RADIR=$DIR - if [[ $OUT == *"Already up-to-date"* ]] - then + if [[ $OUT == *"Already up-to-date"* ]]; then BUILD="NO" else BUILD="YES" @@ -1358,8 +1252,7 @@ then git clone "$URL" "$DIR" --depth=1 cd $DIR - if [ "${TYPE}" == "PROJECT" ]; - then + if [ "${TYPE}" = "PROJECT" ]; then BUILD="YES" RADIR=$DIR @@ -1370,52 +1263,45 @@ then echo echo - done < $1.ra - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + done < $1.ra + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then cd $RADIR - rm -rfv psp1/pkg + rm -rfv psp1/pkg echo "BUILDBOT JOB: $jobid Building" echo - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; then cd dist-scripts - rm *.a + rm *.a cp -v $RARCH_DIST_DIR/*.a . - ls -1 *.a | awk -F "." ' { print "cp " $0 " " $1 "_psp1." $2 }' |sh - - - ./psp1-cores.sh - if [ $? -eq 0 ]; - then - MESSAGE="retroarch build successful ($jobid)" - echo $MESSAGE - else - MESSAGE="retroarch build failed ($jobid)" - echo $MESSAGE - fi - buildbot_log "$MESSAGE" - cd .. + ls -1 *.a | awk -F "." ' { print "cp " $0 " " $1 "_psp1." $2 }' |sh - fi - - echo "Packaging" - echo ============================================ - cp retroarch.cfg retroarch.default.cfg - - - mkdir -p psp1/pkg/ - mkdir -p psp1/pkg/cheats - mkdir -p psp1/pkg/database - mkdir -p psp1/pkg/database/cursors - mkdir -p psp1/pkg/database/rdb - - cp -Rfv media/libretrodb/cht/* psp1/pkg/cheats - cp -Rfv media/libretrodb/rdb/* psp1/pkg/database/rdb - cp -Rfv media/libretrodb/cursors/* psp1/pkg/database/cursors + + ./psp1-cores.sh + if [ $? -eq 0 ]; then + MESSAGE="retroarch build successful ($jobid)" + echo $MESSAGE + else + MESSAGE="retroarch build failed ($jobid)" + echo $MESSAGE + fi + + echo "Packaging" + echo ============================================ + cp retroarch.cfg retroarch.default.cfg + + + mkdir -p psp1/pkg/ + mkdir -p psp1/pkg/cheats + mkdir -p psp1/pkg/database + mkdir -p psp1/pkg/database/cursors + mkdir -p psp1/pkg/database/rdb + + cp -Rfv media/libretrodb/cht/* psp1/pkg/cheats + cp -Rfv media/libretrodb/rdb/* psp1/pkg/database/rdb + cp -Rfv media/libretrodb/cursors/* psp1/pkg/database/cursors fi diff --git a/libretro-buildbot-task.sh b/libretro-buildbot-task.sh index 96d8d025..d41a9ae7 100755 --- a/libretro-buildbot-task.sh +++ b/libretro-buildbot-task.sh @@ -25,8 +25,7 @@ while read line; do KEY=`echo $line | cut --fields=1 --delimiter=" "` VALUE=`echo $line | cut --fields=2 --delimiter=" "` - if [ "${KEY}" == "PATH" ]; - then + if [ "${KEY}" = "PATH" ]; then export PATH=${VALUE}:${ORIGPATH} echo New PATH: $PATH @@ -34,7 +33,7 @@ while read line; do export ${KEY}=${VALUE} echo $KEY: $VALUE fi -done < $1.conf +done < $1.conf echo echo @@ -54,8 +53,7 @@ read_link() TARGET_FILE="$1" cd $(dirname "$TARGET_FILE") TARGET_FILE=$(basename "$TARGET_FILE") - while [ -L "$TARGET_FILE" ] - do + while [ -L "$TARGET_FILE" ]; do TARGET_FILE=$(readlink "$TARGET_FILE") cd $(dirname "$TARGET_FILE") TARGET_FILE=$(basename "$TARGET_FILE") @@ -75,18 +73,17 @@ fi mkdir -v -p "$RARCH_DIST_DIR" -if [ "${PLATFORM}" == "android" ]; -then +if [ "${PLATFORM}" = "android" ]; then -IFS=' ' read -ra ABIS <<< "$TARGET_ABIS" - for a in "${ABIS[@]}"; do - echo $a - if [ -d $RARCH_DIST_DIR/${a} ]; then - echo "Directory $RARCH_DIST_DIR/${a} already exists, skipping creation..." - else - mkdir $RARCH_DIST_DIR/${a} - fi - done + IFS=' ' read -ra ABIS <<< "$TARGET_ABIS" + for a in "${ABIS[@]}"; do + echo $a + if [ -d $RARCH_DIST_DIR/${a} ]; then + echo "Directory $RARCH_DIST_DIR/${a} already exists, skipping creation..." + else + mkdir $RARCH_DIST_DIR/${a} + fi + done fi if [ "$HOST_CC" ]; then @@ -111,32 +108,32 @@ fi if [ -z "$CC" ]; then - if [ $FORMAT_COMPILER_TARGET = "osx" ]; then + if [ $FORMAT_COMPILER_TARGET = "osx" ]; then CC=cc - elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then + elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then CC=mingw32-gcc - else + else CC=gcc - fi + fi fi if [ -z "$CXX" ]; then - if [ $FORMAT_COMPILER_TARGET = "osx" ]; then + if [ $FORMAT_COMPILER_TARGET = "osx" ]; then CXX=c++ CXX11="clang++ -std=c++11 -stdlib=libc++" - elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then + elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then CXX=mingw32-g++ CXX11=mingw32-g++ - else + else CXX=g++ CXX11=g++ - fi + fi fi if [ "${CC}" ] && [ "${CXX}" ]; then - COMPILER="CC=${CC} CXX=${CXX}" + COMPILER="CC=${CC} CXX=${CXX}" else - COMPILER="" + COMPILER="" fi echo @@ -153,7 +150,7 @@ RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT check_opengl() { - if [ "${BUILD_LIBRETRO_GL}" ]; then + if [ "${BUILD_LIBRETRO_GL}" ]; then if [ "${ENABLE_GLES}" ]; then echo '=== OpenGL ES enabled ===' export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-gles" @@ -165,12 +162,12 @@ check_opengl() { fi else echo '=== OpenGL disabled in build ===' - fi + fi } reset_compiler_targets() { - export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET - export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT + export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET + export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT } @@ -199,21 +196,18 @@ build_libretro_generic_makefile() { cd $DIR cd $SUBDIR - if [ "${NAME}" == "mame078" ]; - then - OLDJ=$JOBS + if [ "${NAME}" = "mame078" ]; then + OLDJ=$JOBS JOBS=1 fi - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean" - ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean - if [ $? -eq 0 ]; - then + ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -221,23 +215,20 @@ build_libretro_generic_makefile() { fi echo "compiling..." - if [ -z "${ARGS}" ] - then + if [ -z "${ARGS}" ]; then echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} else - if [ "${NAME}" == "mame2010" ]; - then + if [ "${NAME}" = "mame2010" ]; then - echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}" buildtools + echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}" buildtools ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} buildtools fi echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v ${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}.${FORMAT_EXT} else @@ -266,13 +257,11 @@ build_libretro_generic_theos() { ln -s $THEOS theos - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean" - ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean - if [ $? -eq 0 ]; - then + ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -280,8 +269,7 @@ build_libretro_generic_theos() { fi echo "compiling..." - if [ -z "${ARGS}" ] - then + if [ -z "${ARGS}" ]; then echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} else @@ -289,8 +277,7 @@ build_libretro_generic_theos() { ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v objs/obj/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} else @@ -315,13 +302,11 @@ build_libretro_generic_jni() { cd ${DIR}/${SUBDIR} for a in "${ABIS[@]}"; do - if [ -z "${NOCLEAN}" ]; - then + if [ -z "${NOCLEAN}" ]; then echo "cleaning up..." echo "cleanup command: ${NDK} -j${JOBS} ${ARGS} APP_ABI=${a} clean" ${NDK} -j${JOBS} ${ARGS} APP_ABI=${a} clean - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $a $1 cleanup success! else echo BUILDBOT JOB: $jobid $a $1 cleanup failure! @@ -329,16 +314,14 @@ build_libretro_generic_jni() { fi echo "compiling for ${a}..." - if [ -z "${ARGS}" ] - then + if [ -z "${ARGS}" ]; then echo "build command: ${NDK} -j${JOBS} APP_ABI=${a}" ${NDK} -j${JOBS} APP_ABI=${a} else echo "build command: ${NDK} -j${JOBS} APP_ABI=${a} ${ARGS} " ${NDK} -j${JOBS} APP_ABI=${a} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1-$a build successful ($jobid)" echo BUILDBOT JOB: $MESSAGE buildbot_log "$MESSAGE" @@ -349,8 +332,8 @@ build_libretro_generic_jni() { buildbot_log "$MESSAGE" fi done - - + + } @@ -370,30 +353,26 @@ build_libretro_bsnes_jni() { cd ${DIR}/${SUBDIR} for a in "${ABIS[@]}"; do - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." - echo "cleanup command: ${NDK} -j${JOBS} APP_ABI=${a} clean" + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." + echo "cleanup command: ${NDK} -j${JOBS} APP_ABI=${a} clean" ${NDK} -j${JOBS} APP_ABI=${a} clean - if [ $? -eq 0 ]; - then - echo BUILDBOT JOB: $jobid $1 cleanup success! - else - echo BUILDBOT JOB: $jobid $1 cleanup failure! - fi + if [ $? -eq 0 ]; then + echo BUILDBOT JOB: $jobid $1 cleanup success! + else + echo BUILDBOT JOB: $jobid $1 cleanup failure! + fi fi - echo "compiling for ${a}..." - if [ -z "${ARGS}" ] - then + echo "compiling for ${a}..." + if [ -z "${ARGS}" ]; then echo "build command: ${NDK} -j${JOBS} APP_ABI=${a}" ${NDK} -j${JOBS} APP_ABI=${a} else echo "build command: ${NDK} -j${JOBS} APP_ABI=${a}" ${NDK} -j${JOBS} APP_ABI=${a} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v ../libs/${a}/libretro_${CORENAME}_${PROFILE}.${FORMAT_EXT} $RARCH_DIST_DIR/${a}/${NAME}_${PROFILE}_libretro${FORMAT}.${FORMAT_EXT} else @@ -422,13 +401,11 @@ build_libretro_generic_gl_makefile() { cd $DIR cd $SUBDIR - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean" - ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean - if [ $? -eq 0 ]; - then + ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -436,8 +413,7 @@ build_libretro_generic_gl_makefile() { fi echo "compiling..." - if [ -z "${ARGS}" ]; - then + if [ -z "${ARGS}" ]; then echo "build command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}" ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} else @@ -445,8 +421,7 @@ build_libretro_generic_gl_makefile() { ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" cp -v ${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} else @@ -475,22 +450,19 @@ build_libretro_bsnes() { cd $DIR - if [ -z "${NOCLEAN}" ]; - then - echo "cleaning up..." + if [ -z "${NOCLEAN}" ]; then + echo "cleaning up..." rm -f obj/*.{o,"${FORMAT_EXT}"} rm -f out/*.{o,"${FORMAT_EXT}"} - if [ "${PROFILE}" == "cpp98" -o "${PROFILE}" == "bnes" ]; - then - ${MAKE} clean - fi + if [ "${PROFILE}" = "cpp98" -o "${PROFILE}" = "bnes" ]; then + ${MAKE} clean + fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid $1 cleanup success! else echo BUILDBOT JOB: $jobid $1 cleanup failure! @@ -500,11 +472,9 @@ build_libretro_bsnes() { echo "compiling..." - if [ "${PROFILE}" == "cpp98" ]; - then + if [ "${PROFILE}" = "cpp98" ]; then ${MAKE} platform="${PLATFORM}" ${COMPILER} "-j${JOBS}" - elif [ "${PROFILE}" == "bnes" ]; - then + elif [ "${PROFILE}" = "bnes" ]; then echo "build command: ${MAKE} -f Makefile ${COMPILER} "-j${JOBS}" compiler=${BSNESCOMPILER}" platform=${FORMAT_COMPILER_TARGET} ${MAKE} -f Makefile ${COMPILER} "-j${JOBS}" compiler="${BSNESCOMPILER}" platform=${FORMAT_COMPILER_TARGET} else @@ -512,14 +482,11 @@ build_libretro_bsnes() { ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} compiler=${BSNESCOMPILER} ui='target-libretro' profile=${PROFILE} -j${JOBS} fi - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="$1 build successful ($jobid)" - if [ "${PROFILE}" == "cpp98" ]; - then + if [ "${PROFILE}" = "cpp98" ]; then cp -fv "out/libretro.${FORMAT_EXT}" "${RARCH_DIST_DIR}/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}" - elif [ "${PROFILE}" == "bnes" ]; - then + elif [ "${PROFILE}" = "bnes" ]; then cp -fv "libretro.${FORMAT_EXT}" "${RARCH_DIST_DIR}/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}" else cp -fv "out/${NAME}_libretro$FORMAT.${FORMAT_EXT}" $RARCH_DIST_DIR/${NAME}_${PROFILE}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} @@ -537,8 +504,7 @@ build_libretro_bsnes() { #sleep 10 export jobid=$1 -if [ -z "$2" ] -then +if [ -z "$2" ]; then echo no argument supplied else echo processing $2 only @@ -560,19 +526,16 @@ while read line; do SUBDIR=`echo $line | cut --fields=8 --delimiter=" "` - if [ ! -z "$TASK" ] - then - if [ "${TASK}" != "${NAME}" ] - then + if [ ! -z "$TASK" ]; then + if [ "${TASK}" != "${NAME}" ]; then continue fi fi - if [ "${ENABLED}" == "YES" ]; - then + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" - echo + echo echo URL: $URL echo REPO TYPE: $TYPE echo ENABLED: $ENABLED @@ -586,69 +549,61 @@ while read line; do ARGS="" TEMP=`echo $line | cut --fields=9 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi - ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" + ARGS="${ARGS%"${ARGS##*[![:space:]]}"}" - echo ARGS: $ARGS - echo - echo - - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then - echo building core... - if [ "${COMMAND}" == "GENERIC" ]; then - build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_GL" ]; then - build_libretro_generic_gl_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_ALT" ]; then - build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_JNI" ]; then - build_libretro_generic_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "BSNES_JNI" ]; then - build_libretro_bsnes_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "GENERIC_THEOS" ]; then - build_libretro_generic_theos $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" - elif [ "${COMMAND}" == "BSNES" ]; then - build_libretro_bsnes $NAME $DIR "${ARGS}" $MAKEFILE ${FORMAT_COMPILER_TARGET} ${CXX11} + echo ARGS: $ARGS + echo + echo + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then + echo building core... + if [ "${COMMAND}" = "GENERIC" ]; then + build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}" + elif [ "${COMMAND}" = "GENERIC_GL" ]; then + build_libretro_generic_gl_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}" + elif [ "${COMMAND}" = "GENERIC_ALT" ]; then + build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" + elif [ "${COMMAND}" = "GENERIC_JNI" ]; then + build_libretro_generic_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" + elif [ "${COMMAND}" = "BSNES_JNI" ]; then + build_libretro_bsnes_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" + elif [ "${COMMAND}" = "GENERIC_THEOS" ]; then + build_libretro_generic_theos $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}" + elif [ "${COMMAND}" = "BSNES" ]; then + build_libretro_bsnes $NAME $DIR "${ARGS}" $MAKEFILE ${FORMAT_COMPILER_TARGET} ${CXX11} + fi + else + echo BUILDBOT JOB: $jobid $NAME already up-to-date... fi - else - echo BUILDBOT JOB: $jobid $NAME already up-to-date... - fi echo fi @@ -657,23 +612,20 @@ while read line; do PREVCORE=$NAME PREVBUILD=$BUILD -done < $1 +done < $1 echo cd $WORK BUILD="" -if [ ! -z "$TASK" ] -then - if [ "${TASK}" != "retroarch" ] - then - exit +if [ ! -z "$TASK" ]; then + if [ "${TASK}" != "retroarch" ]; then + exit fi fi -if [ "${PLATFORM}" == "MINGW64" ] || [ "${PLATFORM}" == "MINGW32" ] && [ "${RA}" == "YES" ]; -then +if [ "${PLATFORM}" = "MINGW64" ] || [ "${PLATFORM}" = "MINGW32" ] && [ "${RA}" = "YES" ]; then while read line; do @@ -684,15 +636,12 @@ then ENABLED=`echo $line | cut --fields=5 --delimiter=" "` PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "` - if [ ! -z "$TASK" ] - then - if [ "${TASK}" != "${NAME}" ] - then + if [ ! -z "$TASK" ]; then + if [ "${TASK}" != "${NAME}" ]; then continue fi - fi - if [ "${ENABLED}" == "YES" ]; - then + fi + if [ "${ENABLED}" = "YES" ]; then echo "BUILDBOT JOB: $jobid Processing $NAME" echo echo NAME: $NAME @@ -705,38 +654,32 @@ then ARGS="" TEMP=`echo $line | cut --fields=9 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=10 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=11 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=12 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=13 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi TEMP="" TEMP=`echo $line | cut --fields=14 --delimiter=" "` - if [ -n ${TEMP} ]; - then + if [ -n ${TEMP} ]; then ARGS="${ARGS} ${TEMP}" fi @@ -748,9 +691,8 @@ then echo echo - done < $1.ra - if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ]; - then + done < $1.ra + if [ "${BUILD}" = "YES" -o "${FORCE}" = "YES" ]; then cd $3 echo "BUILDBOT JOB: $jobid Building" @@ -760,8 +702,7 @@ then cd audio/audio_filters echo "audio filter build command: ${MAKE}" $MAKE - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid audio filter build success! else echo BUILDBOT JOB: $jobid audio filter build failure! @@ -774,8 +715,7 @@ then cd gfx/video_filters echo "audio filter build command: ${MAKE}" $MAKE - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid video filter build success! else echo BUILDBOT JOB: $jobid video filter build failure! @@ -788,8 +728,7 @@ then echo "cleanup command: $MAKE clean" $MAKE clean - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid retroarch cleanup success! else echo BUILDBOT JOB: $jobid retroarch cleanup failure! @@ -799,8 +738,7 @@ then echo "configure command: $CONFIGURE" ${CONFIGURE} - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then echo BUILDBOT JOB: $jobid retroarch configure success! else echo BUILDBOT JOB: $jobid retroarch configure failure! @@ -810,8 +748,7 @@ then echo "build command: $MAKE -j${JOBS}" $MAKE -j${JOBS} - if [ $? -eq 0 ]; - then + if [ $? -eq 0 ]; then MESSAGE="retroarch build successful ($jobid)" echo $MESSAGE buildbot_log "$MESSAGE" diff --git a/libretro-config.sh b/libretro-config.sh index 0e5f0cff..b2ee448a 100755 --- a/libretro-config.sh +++ b/libretro-config.sh @@ -13,13 +13,10 @@ case "$platform" in ## ios) - # NOTE: This config requires a Mac with an Xcode version new enough for - # its xcrun program to support -show-sdk-path. That pretty much - # limits us to Xcode 5 and above unless someone wants to implement - # older Xcode version support using an alternate method. Any such - # support could only be for jailbreakers as any libretro core that - # could ever be added to the App Store would require a recent SDK - # and Xcode version to build. + # NOTE: This config requires a Mac with an Xcode installation. These + # scripts will work at least as far as 10.5 that we're sure of, but + # we build with clang targeting iOS >= 5. We'll accept patches for + # older versions of iOS. DIST_DIR="ios" FORMAT_EXT=dylib @@ -34,13 +31,28 @@ case "$platform" in IOSVER_MINOR=${iosver#*.} IOSVER=${IOSVER_MAJOR}${IOSVER_MINOR} - # Apple requires this stuff + # Tell system clang to build for iOS CC="clang -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK" CXX="clang++ -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK" CXX11="clang++ -std=c++11 -stdlib=libc++ -arch armv7 -miphoneos-version-min=5.0 -isysroot $IOSSDK" ;; + theos_ios) + DIST_DIR="theos_ios" + BUILD_PRODUCT_PREFIX="objs/obj" + FORMAT_EXT=dylib + IOS=1 + ARCH=armv7 + FORMAT=_ios + FORMAT_COMPILER_TARGET=theos_ios + FORMAT_COMPILER_TARGET_ALT=theos_ios + + # Make sure that the cross bins you need are first in your path + CXX11="clang++ -std=c++11 -stdlib=libc++ -miphoneos-version-min=5.0" + + ;; + ## ## Original libretro-config path ## @@ -105,15 +117,15 @@ B ARM=true FORMAT_COMPILER_TARGET="psp1" DIST_DIR="psp1" ;; - *wii*) - FORMAT_EXT="a" - FORMAT_COMPILER_TARGET="wii" - DIST_DIR="wii" - ;; - *ios|theos_ios*) + *wii*) + FORMAT_EXT="a" + FORMAT_COMPILER_TARGET="wii" + DIST_DIR="wii" + ;; + theos_ios*) FORMAT_EXT="dylib" FORMAT_COMPILER_TARGET="theos_ios" - DIST_DIR="theos" + DIST_DIR="theos_ios" ;; android) FORMAT_EXT="so"