From ec5ebfbf20ae1e1ea2f9f16d6b67fde89382d214 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Fri, 6 Feb 2015 05:25:47 -0800 Subject: [PATCH 1/3] Updated .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ef54053a..fc1f612d 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ /libretro-vecx/ /libretro-virtualjaguar/ /libretro-yabause/ +/libretro-dat-pull/ /libretrodb/ /retroarch/ /build-summary.log From 4b0923c0e73aa08f8ac57a017051804fa1d35148 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Fri, 6 Feb 2015 05:30:53 -0800 Subject: [PATCH 2/3] Reduce variable expansions in libretro-fetch.sh --- libretro-fetch.sh | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/libretro-fetch.sh b/libretro-fetch.sh index 1caf84a7..3e10e2df 100755 --- a/libretro-fetch.sh +++ b/libretro-fetch.sh @@ -44,16 +44,17 @@ log_verbose() { # fetch_git # Clones or pulls updates from a git repository into a local directory fetch_git() { + fetch_dir="${WORKDIR}/${2}" if [ -n "${3}" ]; then echo "=== Fetching ${3} ===" fi - if [ -d "${WORKDIR}/${2}/.git" ]; then - log_verbose "${WORKDIR}/${2}:git pull" - cd "${WORKDIR}/${2}" + if [ -d "${fetch_dir}/.git" ]; then + log_verbose "${fetch_dir}:git pull" + cd "${fetch_dir}" git pull else - log_verbose "git clone \"${1}\" \"${WORKDIR}/${2}\"" - git clone "${1}" "${WORKDIR}/${2}" + log_verbose "git clone \"${1}\" \"${fetch_dir}\"" + git clone "${1}" "${fetch_dir}" fi if [ -n "${3}" ]; then echo "=== Fetched ===" @@ -64,20 +65,21 @@ fetch_git() { # Clones or pulls updates from a git repository (and its submodules, if any) # into a local directory fetch_git_submodules() { + fetch_dir="${WORKDIR}/${2}" if [ -n "${3}" ]; then echo "=== Fetching ${3} ===" fi - if [ -d "${WORKDIR}/${2}/.git" ]; then - cd "${WORKDIR}/${2}" - log_verbose "${WORKDIR}/${2}:git pull" + if [ -d "${fetch_dir}/.git" ]; then + cd "${fetch_dir}" + log_verbose "${fetch_dir}:git pull" git pull - log_verbose "${WORKDIR}/${2}:git submodule foreach git pull origin master" + log_verbose "${fetch_dir}:git submodule foreach git pull origin master" git submodule foreach git pull origin master else - log_verbose "git clone \"${1}\" \"${WORKDIR}/${2}\"" - git clone "${1}" "${WORKDIR}/${2}" - cd "${WORKDIR}/${2}" - log_verbose "${WORKDIR}/${2}:git submodule update --init" + log_verbose "git clone \"${1}\" \"${fetch_dir}\"" + git clone "${1}" "${fetch_dir}" + cd "${fetch_dir}" + log_verbose "${fetch_dir}:git submodule update --init" git submodule update --init fi if [ -n "${3}" ]; then @@ -92,18 +94,19 @@ fetch_git_submodules() { # Basically if the core has a ton of external dependencies, you may not want # them updated automatically fetch_git_submodules_no_update() { + fetch_dir="${WORKDIR}/${2}" if [ -n "${3}" ]; then echo "=== Fetching ${3} ===" fi - if [ -d "${WORKDIR}/${2}/.git" ]; then - cd "${WORKDIR}/${2}" - log_verbose "${WORKDIR}/${2}:git pull" + if [ -d "${fetch_dir}/.git" ]; then + cd "${fetch_dir}" + log_verbose "${fetch_dir}:git pull" git pull else - log_verbose "git clone \"${1}\" \"${WORKDIR}/${2}\"" - git clone "${1}" "${WORKDIR}/${2}" - cd "${WORKDIR}/${2}" - log_verbose "${WORKDIR}/${2}:git submodule update --init" + log_verbose "git clone \"${1}\" \"${fetch_dir}\"" + git clone "${1}" "${fetch_dir}" + cd "${fetch_dir}" + log_verbose "${fetch_dir}:git submodule update --init" git submodule update --init fi if [ -n "${3}" ]; then From bc44b338fa9b2e17f107f2684536a624ee667e7e Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Fri, 6 Feb 2015 08:24:46 -0800 Subject: [PATCH 3/3] Pass #1 removing excess CWD commands --- libretro-build-common.sh | 76 +++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/libretro-build-common.sh b/libretro-build-common.sh index e88f1d90..b7f5c92f 100755 --- a/libretro-build-common.sh +++ b/libretro-build-common.sh @@ -59,10 +59,10 @@ reset_compiler_targets() { } build_libretro_pcsx_rearmed_interpreter() { - cd "${WORKDIR}" - if [ -d 'libretro-pcsx_rearmed' ]; then + build_dir="${WORKDIR}/libretro-pcsx_rearmed" + if [ -d "${build_dir}" ]; then echo '=== Building PCSX ReARMed Interpreter ===' - cd libretro-pcsx_rearmed + cd "${build_dir}" if [ -z "${NOCLEAN}" ]; then "${MAKE}" -f Makefile.libretro platform="${FORMAT_COMPILER_TARGET}" ${COMPILER} "-j${JOBS}" clean || die 'Failed to clean PCSX ReARMed' @@ -81,11 +81,10 @@ build_libretro_pcsx_rearmed_interpreter() { # $4 is Makefile name # $5 is preferred platform build_libretro_generic_makefile_subcore() { - cd ${WORKDIR} - if [ -d "libretro-${1}" ]; then + build_dir="${WORKDIR}/libretro-${1}" + if [ -d "${build_dir}" ]; then echo "=== Building ${2} ===" - cd libretro-${1}/ - cd ${3} + cd "${build_dir}/${3}" if [ -z "${NOCLEAN}" ]; then make -f ${4} platform=${5} -j$JOBS clean || die "Failed to clean ${2}" @@ -124,11 +123,10 @@ copy_core_to_dist() { # $3 is Makefile name # $4 is preferred platform build_libretro_generic_makefile() { - cd "${WORKDIR}" - if [ -d "libretro-${1}" ]; then + build_dir="${WORKDIR}/libretro-${1}" + if [ -d "${build_dir}" ]; then echo "=== Building ${1} ===" - cd libretro-${1} - cd ${2} + cd "${build_dir}/${2}" if [ -z "${NOCLEAN}" ]; then "${MAKE}" -f ${3} platform="${4}" ${COMPILER} "-j${JOBS}" clean || die "Failed to build ${1}" @@ -363,11 +361,11 @@ build_libretro_ppsspp() { build_libretro_mame() { - cd "${WORKDIR}" - if [ -d 'libretro-mame' ]; then + build_dir="${WORKDIR}/libretro-mame" + if [ -d "${build_dir}" ]; then echo '' echo '=== Building MAME ===' - cd libretro-mame + cd "${build_dir}" if [ "$IOS" ]; then echo '=== Building MAME (iOS) ===' @@ -396,11 +394,11 @@ build_libretro_mame() { } build_libretro_mess() { - cd "${WORKDIR}" - if [ -d 'libretro-mame' ]; then + build_dir="${WORKDIR}/libretro-mame" + if [ -d "${build_dir}" ]; then echo '' echo '=== Building MESS ===' - cd libretro-mame + cd "${build_dir}" if [ "$X86_64" = "true" ]; then echo '=== Building MESS64 ===' @@ -423,11 +421,11 @@ build_libretro_mess() { } rebuild_libretro_mess() { - cd "${WORKDIR}" - if [ -d 'libretro-mame' ]; then + build_dir="${WORKDIR}/libretro-mame" + if [ -d "${build_dir}" ]; then echo '' echo '=== Building MESS ===' - cd libretro-mame + cd "${build_dir}" if [ "$X86_64" = "true" ]; then echo '=== Building MESS64 ===' @@ -450,11 +448,11 @@ rebuild_libretro_mess() { } build_libretro_ume() { - cd "${WORKDIR}" - if [ -d 'libretro-mame' ]; then + build_dir="${WORKDIR}/libretro-mame" + if [ -d "${build_dir}" ]; then echo '' echo '=== Building UME ===' - cd libretro-mame + cd "${build_dir}" if [ "$X86_64" = "true" ]; then echo '=== Building UME64 ===' @@ -477,11 +475,11 @@ build_libretro_ume() { } rebuild_libretro_ume() { - cd "${WORKDIR}" - if [ -d 'libretro-mame' ]; then + build_dir="${WORKDIR}/libretro-mame" + if [ -d "${build_dir}" ]; then echo '' - echo '=== Building MESS ===' - cd libretro-mame + echo '=== Building UME ===' + cd "${build_dir}" if [ "$X86_64" = "true" ]; then echo '=== Building UME64 ===' @@ -508,10 +506,10 @@ rebuild_libretro_ume() { # $3 is profile name # $4 is compiler build_libretro_bsnes_modern() { - cd "${WORKDIR}" - if [ -d "libretro-${1}" ]; then + build_dir="${WORKDIR}/libretro-${1}" + if [ -d "${build_dir}" ]; then echo "=== Building ${1} ${3} ===" - cd libretro-${1} + cd ${build_dir} if [ -z "${NOCLEAN}" ]; then rm -f obj/*.{o,"${FORMAT_EXT}"} @@ -539,10 +537,10 @@ build_libretro_bsnes_mercury() { build_libretro_bsnes_cplusplus98() { CORENAME="bsnes_cplusplus98" - cd "${WORKDIR}" - if [ -d "libretro-${CORENAME}" ]; then + build_dir="${WORKDIR}/libretro-${CORENAME}" + if [ -d "${build_dir}" ]; then echo "=== Building ${CORENAME} ===" - cd libretro-${CORENAME} + cd ${build_dir} if [ -z "${NOCLEAN}" ]; then "${MAKE}" clean || die "Failed to clean ${CORENAME}" @@ -556,10 +554,10 @@ build_libretro_bsnes_cplusplus98() { } build_libretro_bnes() { - cd "${WORKDIR}" - if [ -d 'libretro-bnes' ]; then + build_dir="${WORKDIR}/libretro-bnes" + if [ -d "${build_dir}" ]; then echo '=== Building bNES ===' - cd libretro-bnes + cd ${build_dir} mkdir -p obj if [ -z "${NOCLEAN}" ]; then @@ -575,9 +573,9 @@ build_libretro_bnes() { build_libretro_mupen64() { check_opengl - cd "${WORKDIR}" - if [ -d 'libretro-mupen64plus' ]; then - cd libretro-mupen64plus + build_dir="${WORKDIR}/libretro-mupen64plus" + if [ -d "${build_dir}" ]; then + cd "${build_dir}" mkdir -p obj if [ "${X86}" ] && [ "${X86_64}" ]; then