Files
runner-images/images/ubuntu/scripts/build/install-homebrew.sh
T

32 lines
1.1 KiB
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-04-10 14:20:16 +05:00
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-homebrew.sh
## Desc: Install Homebrew on Linux
## Caveat: Brew MUST NOT be used to install any tool during the image build to avoid dependencies, which may come along with the tool
2020-04-10 14:20:16 +05:00
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/etc-environment.sh
2021-04-14 19:34:49 +03:00
source $HELPER_SCRIPTS/install.sh
2020-04-10 14:20:16 +05:00
# Install the Homebrew on Linux
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
2024-03-14 10:53:11 +01:00
# Invoke shellenv to make brew available during running session
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
2023-12-26 12:50:52 +01:00
set_etc_environment_variable HOMEBREW_NO_AUTO_UPDATE 1
set_etc_environment_variable HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS 3650
2020-04-10 14:20:16 +05:00
# Validate the installation ad hoc
echo "Validate the installation reloading /etc/environment"
2023-12-26 12:50:52 +01:00
reload_etc_environment
2020-04-10 14:20:16 +05:00
gfortran=$(brew --prefix)/bin/gfortran
# Remove gfortran symlink, not to conflict with system gfortran
if [[ -e $gfortran ]]; then
rm $gfortran
fi
invoke_tests "Tools" "Homebrew"