From 81be125a547ba2fa2343ae36cce8812bd711c5b4 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 12 Apr 2024 11:45:39 -0400 Subject: [PATCH] ENH: Support arm64 in macpython-download-cache-and-build-module-wheels.sh --- ...-download-cache-and-build-module-wheels.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/macpython-download-cache-and-build-module-wheels.sh b/scripts/macpython-download-cache-and-build-module-wheels.sh index 40d28e8..5ebad4a 100755 --- a/scripts/macpython-download-cache-and-build-module-wheels.sh +++ b/scripts/macpython-download-cache-and-build-module-wheels.sh @@ -42,15 +42,20 @@ brew update brew install zstd aria2 gnu-tar doxygen ninja brew upgrade cmake +if [[ $(arch) == "arm64" ]]; then + tarball_arch="-arm64" +else + tarball_arch="" +fi # Fetch ITKPythonBuilds archive containing ITK build artifacts -echo "Fetching https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.3.0}/ITKPythonBuilds-macosx.tar.zst" -if [[ ! -f ITKPythonBuilds-macosx.tar.zst ]]; then - aria2c -c --file-allocation=none -o ITKPythonBuilds-macosx.tar.zst -s 10 -x 10 https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.3.0}/ITKPythonBuilds-macosx.tar.zst +echo "Fetching https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.3.0}/ITKPythonBuilds-macosx${tarball_arch}.tar.zst" +if [[ ! -f ITKPythonBuilds-macosx${tarball_arch}.tar.zst ]]; then + aria2c -c --file-allocation=none -o ITKPythonBuilds-macosx${tarball_arch}.tar.zst -s 10 -x 10 https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${ITK_PACKAGE_VERSION:=v5.3.0}/ITKPythonBuilds-macosx${tarball_arch}.tar.zst fi -unzstd --long=31 ITKPythonBuilds-macosx.tar.zst -o ITKPythonBuilds-macosx.tar -PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" -tar xf ITKPythonBuilds-macosx.tar --checkpoint=10000 --checkpoint-action=dot -rm ITKPythonBuilds-macosx.tar +unzstd --long=31 ITKPythonBuilds-macosx${tarball_arch}.tar.zst -o ITKPythonBuilds-macosx${tarball_arch}.tar +PATH="$(dirname $(brew list gnu-tar | grep gnubin)):$PATH" +tar xf ITKPythonBuilds-macosx${tarball_arch}.tar --checkpoint=10000 --checkpoint-action=dot +rm ITKPythonBuilds-macosx${tarball_arch}.tar # Optional: Update build scripts if [[ -n ${ITKPYTHONPACKAGE_TAG} ]]; then