Skip to content

Commit

Permalink
scripts: Include meson and ninja in mac toolchain.
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ndot authored and bradleysepos committed Sep 17, 2019
1 parent 74ad81c commit d0fea86
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions scripts/mac-toolchain-build
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function mac_toolchain_build {
MAKEJOBS="4"
fi
SUDO=
TOTAL=6
TOTAL=8

# functions
function print_fail_and_exit {
Expand Down Expand Up @@ -89,6 +89,12 @@ function mac_toolchain_build {
printf "Downloading [%02i/%02i] %s " "6" "${TOTAL}" "nasm 2.14.02"
curl -Lf --connect-timeout 30 https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 -o "nasm-2.14.02.tar.bz2" >/dev/null 2>&1 || print_fail_and_exit
echo -en "${CREL}"
printf "Downloading [%02i/%02i] %s " "7" "${TOTAL}" "ninja 1.9.0"
curl -Lf --connect-timeout 30 https://github.com/ninja-build/ninja/archive/v1.9.0.tar.gz -o "ninja-1.9.0.tar.gz" >/dev/null 2>&1 || print_fail_and_exit
echo -en "${CREL}"
printf "Downloading [%02i/%02i] %s " "8" "${TOTAL}" "meson 0.51.2"
curl -Lf --connect-timeout 30 https://github.com/mesonbuild/meson/archive/0.51.2.tar.gz -o "meson-0.51.2.tar.gz" >/dev/null 2>&1 || print_fail_and_exit
echo -en "${CREL}"
printf "Downloading [%02i/%02i] complete.\n" "${TOTAL}" "${TOTAL}"

# autoconf
Expand Down Expand Up @@ -157,9 +163,28 @@ function mac_toolchain_build {
${SUDO} make install >>../nasm-2.14.02.log 2>&1 || print_fail_and_exit
echo -en "${CREL}"

# ninja
cd "${TEMP_DIR}"
printf "Building [%02i/%02i] %s " "7" "${TOTAL}" "ninja 1.9.0"
[[ "${SUDO}" != "" ]] && ${SUDO} -v
tar -xf ninja-1.9.0.tar.gz >/dev/null 2>&1 || print_fail_and_exit
cd ninja-1.9.0 >/dev/null 2>&1 || print_fail_and_exit
./configure.py --bootstrap >../ninja-1.9.0.log 2>&1 || print_fail_and_exit
${SUDO} mv ninja /usr/local/bin >>../ninja-1.9.0.log 2>&1 || print_fail_and_exit
echo -en "${CREL}"

# meson
cd "${TEMP_DIR}"
printf "Building [%02i/%02i] %s " "8" "${TOTAL}" "meson 0.51.2"
[[ "${SUDO}" != "" ]] && ${SUDO} -v
tar -xf meson-0.51.2.tar.gz >/dev/null 2>&1 || print_fail_and_exit
cd meson-0.51.2 >/dev/null 2>&1 || print_fail_and_exit
${SUDO} python3 setup.py install >>../meson-0.51.2.log 2>&1 || print_fail_and_exit
echo -en "${CREL}"

# done
printf "Building [%02i/%02i] complete.\n" "${TOTAL}" "${TOTAL}"
rm -rf "${TEMP_DIR}"
${SUDO} rm -rf "${TEMP_DIR}"
if [[ "${PREFIX}" != "/usr/local" ]]; then
echo "bin: ${PREFIX}/bin"
echo " add to your shell startup script (${HOME}/.bash_profile):"
Expand Down

0 comments on commit d0fea86

Please sign in to comment.