Skip to content

Commit

Permalink
scripts: Update to mac-toolchain-build 2.11.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
galad87 committed Apr 30, 2024
1 parent b9e531f commit 744c022
Showing 1 changed file with 46 additions and 25 deletions.
71 changes: 46 additions & 25 deletions scripts/mac-toolchain-build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# mac-toolchain-build - download and build common macOS toolchain components
#
# Copyright 2023 Bradley Sepos
# Copyright 2024 Bradley Sepos
# Released under the MIT License. See LICENSE for details.
# https://github.com/bradleysepos/mac-toolchain-build

Expand Down Expand Up @@ -141,7 +141,8 @@ function mac_toolchain_build {
set -o pipefail

# package names
local AUTOCONF_NAME AUTOMAKE_NAME CMAKE_NAME LIBTOOL_NAME MESON_NAME NASM_NAME NINJA_NAME PKGCONFIG_NAME NAMES
local M4_NAME AUTOCONF_NAME AUTOMAKE_NAME CMAKE_NAME LIBTOOL_NAME MESON_NAME NASM_NAME NINJA_NAME PKGCONFIG_NAME NAMES
M4_NAME="m4"
AUTOCONF_NAME="autoconf"
AUTOMAKE_NAME="automake"
CMAKE_NAME="cmake"
Expand All @@ -150,22 +151,24 @@ function mac_toolchain_build {
NASM_NAME="nasm"
NINJA_NAME="ninja"
PKGCONFIG_NAME="pkg-config"
NAMES=("${AUTOCONF_NAME}" "${AUTOMAKE_NAME}" "${CMAKE_NAME}" "${LIBTOOL_NAME}" "${MESON_NAME}" "${NASM_NAME}" "${NINJA_NAME}" "${PKGCONFIG_NAME}")
NAMES=("${M4_NAME}" "${AUTOCONF_NAME}" "${AUTOMAKE_NAME}" "${CMAKE_NAME}" "${LIBTOOL_NAME}" "${MESON_NAME}" "${NASM_NAME}" "${NINJA_NAME}" "${PKGCONFIG_NAME}")

# versions
local AUTOCONF_VER AUTOMAKE_VER CMAKE_VER LIBTOOL_VER MESON_VER NASM_VER NINJA_VER PKGCONFIG_VER VERSIONS
AUTOCONF_VER="2.71"
local M4_VER AUTOCONF_VER AUTOMAKE_VER CMAKE_VER LIBTOOL_VER MESON_VER NASM_VER NINJA_VER PKGCONFIG_VER VERSIONS
M4_VER="1.4.19"
AUTOCONF_VER="2.72"
AUTOMAKE_VER="1.16.5"
CMAKE_VER="3.27.4"
CMAKE_VER="3.29.2"
LIBTOOL_VER="2.4.7"
MESON_VER="1.2.1"
NASM_VER="2.15.05"
NINJA_VER="1.11.1"
MESON_VER="1.4.0"
NASM_VER="2.16.03"
NINJA_VER="1.12.0"
PKGCONFIG_VER="0.29.2"
VERSIONS=("${AUTOCONF_VER}" "${AUTOMAKE_VER}" "${CMAKE_VER}" "${LIBTOOL_VER}" "${MESON_VER}" "${NASM_VER}" "${NINJA_VER}" "${PKGCONFIG_VER}")
VERSIONS=("${M4_VER}" "${AUTOCONF_VER}" "${AUTOMAKE_VER}" "${CMAKE_VER}" "${LIBTOOL_VER}" "${MESON_VER}" "${NASM_VER}" "${NINJA_VER}" "${PKGCONFIG_VER}")

# filenames
local AUTOCONF_PKG AUTOMAKE_PKG CMAKE_PKG LIBTOOL_PKG MESON_PKG NASM_PKG NINJA_PKG PKGCONFIG_PKG PKGS
local M4_PKG AUTOCONF_PKG AUTOMAKE_PKG CMAKE_PKG LIBTOOL_PKG MESON_PKG NASM_PKG NINJA_PKG PKGCONFIG_PKG PKGS
M4_PKG="m4-${M4_VER}.tar.bz2"
AUTOCONF_PKG="autoconf-${AUTOCONF_VER}.tar.gz"
AUTOMAKE_PKG="automake-${AUTOMAKE_VER}.tar.gz"
CMAKE_PKG="cmake-${CMAKE_VER}.tar.gz"
Expand All @@ -174,10 +177,11 @@ function mac_toolchain_build {
NASM_PKG="nasm-${NASM_VER}.tar.bz2"
NINJA_PKG="ninja-${NINJA_VER}.tar.gz"
PKGCONFIG_PKG="pkg-config-${PKGCONFIG_VER}.tar.gz"
PKGS=("${AUTOCONF_PKG}" "${AUTOMAKE_PKG}" "${CMAKE_PKG}" "${LIBTOOL_PKG}" "${MESON_PKG}" "${NASM_PKG}" "${NINJA_PKG}" "${PKGCONFIG_PKG}")
PKGS=("${M4_PKG}" "${AUTOCONF_PKG}" "${AUTOMAKE_PKG}" "${CMAKE_PKG}" "${LIBTOOL_PKG}" "${MESON_PKG}" "${NASM_PKG}" "${NINJA_PKG}" "${PKGCONFIG_PKG}")

# urls
local AUTOCONF_URLS AUTOMAKE_URLS CMAKE_URLS LIBTOOL_URLS MESON_URLS NASM_URLS NINJA_URLS PKGCONFIG_URLS URLS_VARNAMES
local M4_URLS AUTOCONF_URLS AUTOMAKE_URLS CMAKE_URLS LIBTOOL_URLS MESON_URLS NASM_URLS NINJA_URLS PKGCONFIG_URLS URLS_VARNAMES
M4_URLS=("https://ftp.gnu.org/gnu/m4/m4-${M4_VER}.tar.bz2")
AUTOCONF_URLS=("https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VER}.tar.gz")
AUTOMAKE_URLS=("https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER}.tar.gz")
CMAKE_URLS=("https://cmake.org/files/v${CMAKE_VER%.*}/cmake-${CMAKE_VER}.tar.gz")
Expand All @@ -186,24 +190,25 @@ function mac_toolchain_build {
NASM_URLS=("https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VER}/nasm-${NASM_VER}.tar.bz2")
NINJA_URLS=("https://github.com/ninja-build/ninja/archive/v${NINJA_VER}.tar.gz")
PKGCONFIG_URLS=("https://pkg-config.freedesktop.org/releases/pkg-config-${PKGCONFIG_VER}.tar.gz")
URLS_VARNAMES=('AUTOCONF_URLS' 'AUTOMAKE_URLS' 'CMAKE_URLS' 'LIBTOOL_URLS' 'MESON_URLS' 'NASM_URLS' 'NINJA_URLS' 'PKGCONFIG_URLS')
URLS_VARNAMES=('M4_URLS' 'AUTOCONF_URLS' 'AUTOMAKE_URLS' 'CMAKE_URLS' 'LIBTOOL_URLS' 'MESON_URLS' 'NASM_URLS' 'NINJA_URLS' 'PKGCONFIG_URLS')

# checksums
local AUTOCONF_SHA256 AUTOMAKE_SHA256 CMAKE_SHA256 LIBTOOL_SHA256 MESON_SHA256 NASM_SHA256 NINJA_SHA256 PKGCONFIG_SHA256 CHECKSUMS
AUTOCONF_SHA256="431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c"
local M4_SHA256 AUTOCONF_SHA256 AUTOMAKE_SHA256 CMAKE_SHA256 LIBTOOL_SHA256 MESON_SHA256 NASM_SHA256 NINJA_SHA256 PKGCONFIG_SHA256 CHECKSUMS
M4_SHA256="b306a91c0fd93bc4280cfc2e98cb7ab3981ff75a187bea3293811f452c89a8c8"
AUTOCONF_SHA256="afb181a76e1ee72832f6581c0eddf8df032b83e2e0239ef79ebedc4467d92d6e"
AUTOMAKE_SHA256="07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605"
CMAKE_SHA256="0a905ca8635ca81aa152e123bdde7e54cbe764fdd9a70d62af44cad8b92967af"
CMAKE_SHA256="36db4b6926aab741ba6e4b2ea2d99c9193222132308b4dc824d4123cb730352e"
LIBTOOL_SHA256="04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8"
MESON_SHA256="e1f3b32b636cc86496261bd89e63f00f206754697c7069788b62beed5e042713"
NASM_SHA256="3c4b8339e5ab54b1bcb2316101f8985a5da50a3f9e504d43fa6f35668bee2fd0"
NINJA_SHA256="31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea"
MESON_SHA256="61382f295378bddcd9bebb3a9a9065b1cbc671fa41b80964ab02726f9a5f3a88"
NASM_SHA256="bef3de159bcd61adf98bb7cc87ee9046e944644ad76b7633f18ab063edb29e57"
NINJA_SHA256="8b2c86cd483dc7fcb7975c5ec7329135d210099a89bc7db0590a07b0bbfe49a5"
PKGCONFIG_SHA256="6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591"
CHECKSUMS=("${AUTOCONF_SHA256}" "${AUTOMAKE_SHA256}" "${CMAKE_SHA256}" "${LIBTOOL_SHA256}" "${MESON_SHA256}" "${NASM_SHA256}" "${NINJA_SHA256}" "${PKGCONFIG_SHA256}")
CHECKSUMS=("${M4_SHA256}" "${AUTOCONF_SHA256}" "${AUTOMAKE_SHA256}" "${CMAKE_SHA256}" "${LIBTOOL_SHA256}" "${MESON_SHA256}" "${NASM_SHA256}" "${NINJA_SHA256}" "${PKGCONFIG_SHA256}")

# internal vars
local NAME VERSION SELF SELF_NAME HELP SUDO TOTAL
NAME="mac-toolchain-build"
VERSION="2.10.0"
VERSION="2.11.0"
SELF="${BASH_SOURCE[0]}"
SELF_NAME=$(basename "${SELF}")
HELP="\
Expand Down Expand Up @@ -504,7 +509,7 @@ default install-dir: /usr/local"
local INDEX
export PATH="${PREFIX}/bin${PATH:+:$PATH}"

# autoconf
# m4
INDEX=0
printf "Building [%02i/%02i] %s " "$((INDEX+1))" "${TOTAL}" "${NAMES[$INDEX]} ${VERSIONS[$INDEX]}"
if [[ "${SKIP[$INDEX]}" == true ]]; then
Expand All @@ -520,6 +525,22 @@ default install-dir: /usr/local"
echo ""
fi

# autoconf
INDEX=$((INDEX+1))
printf "Building [%02i/%02i] %s " "$((INDEX+1))" "${TOTAL}" "${NAMES[$INDEX]} ${VERSIONS[$INDEX]}"
if [[ "${SKIP[$INDEX]}" == true ]]; then
echo "(${INSTALLED_VERSIONS[$INDEX]} installed, skipping)"
else
[[ "${SUDO}" != "" ]] && ${SUDO} -v
touch "${BUILD_DIR}/${NAMES[$INDEX]}.log"
mkdir -pv "${BUILD_DIR}/${NAMES[$INDEX]}" > "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
cd "${BUILD_DIR}/${NAMES[$INDEX]}"
"${SOURCE_DIR}/${NAMES[$INDEX]}/${PKGS[$INDEX]%\.tar\.*}/configure" --prefix="${PREFIX}" >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
make -j "${JOBS}" >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
${SUDO} make install >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
echo ""
fi

# automake
INDEX=$((INDEX+1))
printf "Building [%02i/%02i] %s " "$((INDEX+1))" "${TOTAL}" "${NAMES[$INDEX]} ${VERSIONS[$INDEX]}"
Expand Down Expand Up @@ -598,7 +619,7 @@ default install-dir: /usr/local"
touch "${BUILD_DIR}/${NAMES[$INDEX]}.log"
mkdir -pv "${BUILD_DIR}/${NAMES[$INDEX]}" > "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
cd "${BUILD_DIR}/${NAMES[$INDEX]}"
"${SOURCE_DIR}/${NAMES[$INDEX]}/${PKGS[$INDEX]%\.tar\.*}/configure" --prefix="${PREFIX}" --enable-sections --enable-lto >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
"${SOURCE_DIR}/${NAMES[$INDEX]}/${PKGS[$INDEX]%\.tar\.*}/configure" --prefix="${PREFIX}" >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
make -j "${JOBS}" AR=ar RANLIB=ranlib >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
${SUDO} make install >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
echo ""
Expand Down Expand Up @@ -629,7 +650,7 @@ default install-dir: /usr/local"
touch "${BUILD_DIR}/${NAMES[$INDEX]}.log"
mkdir -pv "${BUILD_DIR}/${NAMES[$INDEX]}" > "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
cd "${BUILD_DIR}/${NAMES[$INDEX]}"
"${SOURCE_DIR}/${NAMES[$INDEX]}/${PKGS[$INDEX]%\.tar\.*}/configure" --prefix="${PREFIX}" --with-internal-glib --disable-host-tool >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
"${SOURCE_DIR}/${NAMES[$INDEX]}/${PKGS[$INDEX]%\.tar\.*}/configure" --prefix="${PREFIX}" --with-internal-glib --disable-host-tool CFLAGS="-Wno-int-conversion" >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
make -j "${JOBS}" >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
${SUDO} make install >> "${BUILD_DIR}/${NAMES[$INDEX]}.log" 2>&1 || return 1
echo ""
Expand Down

0 comments on commit 744c022

Please sign in to comment.