libANN availability seems erratic, with Macports sometimes reporting:
Error: Port libANN not found
only for a retry of the job to succeed. This change introduces an auto-retry
loop on libANN’s installation, hoping this will ameliorate the issue.
sudo installer -package MacPorts-2.7.2-12-Monterey.pkg -target /
export PATH=/opt/local/bin:${PATH}
+# `port install` with retry because packages sometimes transiently 404
+function port_install {
+ for i in 1 2 3; do
+ set +e
+ sudo port install "$@"
+ RET=$?
+ set -e
+ if [ ${RET} -eq 0 ]; then
+ return 0
+ fi
+ sleep $((10 * 2 ** (${i} - 1))) # exponential back off
+ done
+ return -1
+}
+
# lib/mingle dependency
-sudo port install libANN
+port_install libANN
sudo installer -package MacPorts-2.7.2-12-Monterey.pkg -target /
export PATH=/opt/local/bin:${PATH}
+# `port install` with retry because packages sometimes transiently 404
+function port_install {
+ for i in 1 2 3; do
+ set +e
+ sudo port install "$@"
+ RET=$?
+ set -e
+ if [ ${RET} -eq 0 ]; then
+ return 0
+ fi
+ sleep $((10 * 2 ** (${i} - 1))) # exponential back off
+ done
+ return -1
+}
+
# lib/mingle dependency
-sudo port install libANN
+port_install libANN
python3 -m pip install --requirement requirements.txt